openshift / openshift/openshift-velero-plugin

Add backup/restore support for Shipwright Build resources (S2I successor)

Open
#445 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
55
Forks
45
Avg merge
3d 10h
Merged PRs (30d)
11

Description

Background

OpenShift is shifting S2I (source-to-image) build tooling from BuildConfig/Build to Shipwright (productized as "Red Hat OpenShift Builds"). See the workshop overview: https://rhthsa.github.io/developer-advocacy-2025/openshift-developer-workshop-2025/01-shipwright.html

Shipwright introduces new CRDs that replace BuildConfig/Build:

  • Build
  • BuildStrategy / ClusterBuildStrategy
  • BuildRun

Shipwright still supports S2I as one of its build strategies (alongside Buildah, Buildpacks, etc.), so clusters migrating off BuildConfig will have these new resource types in their namespaces instead.

Current state

This plugin already has backup/restore handling for the legacy build resources:

  • velero-plugins/buildconfig/restore.go — rewrites push secrets and docker image references (spec.output.to, strategy from fields, source images) on restore, remapping between backup registry and restore registry, and applying namespace mapping.
  • velero-plugins/build/restore.go — skips restoring Build objects directly (lets BuildConfig recreate them) but exposes UpdateCommonSpec, the shared logic used by the buildconfig plugin.
  • velero-plugins/imagecopy/imagestream.go — handles copying images between registries and updating image references for ImageStream resources.

None of this currently applies to Shipwright's Build/BuildRun/BuildStrategy/ClusterBuildStrategy resources, so clusters using Shipwright instead of BuildConfig will not have their build definitions' registry/secret references correctly rewritten on restore (e.g. output.image, output.pushSecret, source git/secret refs, strategy parameter refs pointing at internal registry paths).

Ask

Track adding equivalent Backup/Restore Item Action plugins for Shipwright resources:

  • Build — restore item action to rewrite spec.output.image and spec.output.pushSecret (and any other registry/secret references) analogous to build.UpdateCommonSpec, with backup/restore registry hostname swap and namespace mapping support.
  • BuildRun — determine whether restore should be skipped (similar to how Build restore is skipped in favor of BuildConfig recreating it) or whether in-flight BuildRuns need any reference rewriting.
  • BuildStrategy / ClusterBuildStrategy — evaluate whether these carry any registry/secret references that need rewriting, or if they are safe to restore as-is (cluster-scoped strategy definitions typically don't reference per-namespace secrets).
  • Determine whether imagecopy needs to account for images produced by Shipwright builds (e.g. if output.image targets the internal registry via an ImageStream tag reference vs. a plain registry path).
  • Add BackupItemAction handling if needed (e.g. excluding managed fields, consistent with other resource plugins).

References

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading velero-plugins/buildconfig/restore.go, velero-plugins/build/restore.go, and velero-plugins/imagecopy/imagestream.go to understand existing registry and secret rewriting. Then inspect the Shipwright Build, BuildRun, BuildStrategy, and ClusterBuildStrategy resource definitions and determine which actions and tests are needed; done means backup and restore correctly handle required references, scope mapping, and image-copy behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
devops
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.