From 26a4146b40ce0073cf852fe02799ca2d7502b221 Mon Sep 17 00:00:00 2001 From: Rokibul Hasan Date: Tue, 8 Oct 2024 20:07:24 +0600 Subject: [PATCH] Remove overrideValues func for stash-presets (#4) Signed-off-by: Rokibul Hasan --- pkg/feature_installer/opscenter_features.go | 26 --------------------- 1 file changed, 26 deletions(-) diff --git a/pkg/feature_installer/opscenter_features.go b/pkg/feature_installer/opscenter_features.go index 62bebb81..0dbba6b5 100644 --- a/pkg/feature_installer/opscenter_features.go +++ b/pkg/feature_installer/opscenter_features.go @@ -64,10 +64,6 @@ func InitializeServer(fakeServer *FakeServer, profile *profilev1alpha1.ManagedCl "name": clusterMetadata.Name, } - if err := overrideStashPresetsValues(overrides, clusterMetadata); err != nil { - return nil, err - } - if clusterMetadata.CAPI != nil { if clusterMetadata.CAPI.Provider != "" { if err := unstructured.SetNestedField(overrides, clusterMetadata.CAPI.Provider, "clusterMetadata", "capi", "provider"); err != nil { @@ -174,25 +170,3 @@ func DeployRelease(apiConfig *api.Config, deployOpts *action.DeployOptions) erro } return err } - -func overrideStashPresetsValues(overrides map[string]interface{}, clusterMetadata *kmapi.ClusterInfo) error { - if err := unstructured.SetNestedField(overrides, clusterMetadata.Name, "helm", "releases", "stash-presets", "values", "clusterMetadata", "name"); err != nil { - return err - } - - if err := unstructured.SetNestedField(overrides, clusterMetadata.UID, "helm", "releases", "stash-presets", "values", "clusterMetadata", "uid"); err != nil { - return err - } - - prefix := clusterMetadata.Name + "/backups" - provider, found, err := unstructured.NestedString(overrides, "helm", "releases", "stash-presets", "values", "kubestash", "backend", "provider") - if err != nil { - return err - } - if found { - if err = unstructured.SetNestedField(overrides, prefix, "helm", "releases", "stash-presets", "values", "kubestash", "backend", provider, "spec", "prefix"); err != nil { - return err - } - } - return nil -}