Skip to content

Commit

Permalink
lca: Adding oadpConent to ImageBasedUpgrade. (openshift-kni#235)
Browse files Browse the repository at this point in the history
This aims at helping with bckup/restore automation.

Signed-off-by: Alexander Chuzhoy <[email protected]>
  • Loading branch information
achuzhoy authored Feb 1, 2024
1 parent 03518df commit 1de123d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions pkg/lca/imagebasedupgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,23 @@ func (builder *ImageBasedUpgradeBuilder) WithSeedImage(
return builder
}

// WithOadpContent adds oadpContent to be used by the imagebasedupgrade.
// This is used for backup/restore during upgrade.
func (builder *ImageBasedUpgradeBuilder) WithOadpContent(
oadpContentConfigMapName, oadpContentConfigMapNamespace string) *ImageBasedUpgradeBuilder {
if valid, _ := builder.validate(); !valid {
return builder
}

glog.V(100).Infof("Appending oadpContent's configmap name %s in namespace %s to the imagebasedupgrade",
oadpContentConfigMapName, oadpContentConfigMapNamespace)

builder.Definition.Spec.OADPContent = append(builder.Definition.Spec.OADPContent,
lcav1alpha1.ConfigMapRef{Name: oadpContentConfigMapName, Namespace: oadpContentConfigMapNamespace})

return builder
}

// WithSeedImageVersion sets the seed image version used by the imagebasedupgrade.
func (builder *ImageBasedUpgradeBuilder) WithSeedImageVersion(
seedImageVersion string) *ImageBasedUpgradeBuilder {
Expand Down

0 comments on commit 1de123d

Please sign in to comment.