Skip to content

Commit

Permalink
Remove overrideValues func for stash-presets (#4)
Browse files Browse the repository at this point in the history
Signed-off-by: Rokibul Hasan <mdrokibulhasan@appscode.com>
  • Loading branch information
RokibulHasan7 authored Oct 8, 2024
1 parent 3772c1e commit 26a4146
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions pkg/feature_installer/opscenter_features.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
}

0 comments on commit 26a4146

Please sign in to comment.