From 1de123d9319848563b993fe821fc547c58e4edbb Mon Sep 17 00:00:00 2001 From: Alexander Chuzhoy Date: Thu, 1 Feb 2024 12:18:38 -0500 Subject: [PATCH] lca: Adding oadpConent to ImageBasedUpgrade. (#235) This aims at helping with bckup/restore automation. Signed-off-by: Alexander Chuzhoy --- pkg/lca/imagebasedupgrade.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/pkg/lca/imagebasedupgrade.go b/pkg/lca/imagebasedupgrade.go index 640e3f1bb..fa93d5ba7 100644 --- a/pkg/lca/imagebasedupgrade.go +++ b/pkg/lca/imagebasedupgrade.go @@ -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 {