Skip to content

Commit d28a7d1

Browse files
committed
Add distro values when clusterManagers contains OpenShift
Signed-off-by: RokibulHasan7 <mdrokibulhasan@appscode.com>
1 parent a4eae15 commit d28a7d1

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ require (
88
github.com/google/gofuzz v1.2.0
99
github.com/spf13/cobra v1.10.2
1010
go.bytebuilders.dev/license-verifier v0.15.0
11+
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56
1112
gomodules.xyz/logs v0.0.7
1213
gomodules.xyz/x v0.0.17
1314
helm.sh/helm/v3 v3.19.5
@@ -248,7 +249,6 @@ require (
248249
go.yaml.in/yaml/v3 v3.0.4 // indirect
249250
gocloud.dev v0.41.0 // indirect
250251
golang.org/x/crypto v0.46.0 // indirect
251-
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect
252252
golang.org/x/net v0.47.0 // indirect
253253
golang.org/x/oauth2 v0.33.0 // indirect
254254
golang.org/x/sync v0.19.0 // indirect

pkg/feature_installer/opscenter_features.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
profilev1alpha1 "github.com/kluster-manager/cluster-profile/apis/profile/v1alpha1"
2424
"github.com/kluster-manager/cluster-profile/pkg/utils"
2525

26+
"golang.org/x/exp/slices"
2627
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
2728
"k8s.io/apimachinery/pkg/util/json"
2829
"k8s.io/client-go/tools/clientcmd"
@@ -110,6 +111,15 @@ func GetOverrideValues(overrides map[string]any, clusterMetadata *kmapi.ClusterI
110111
return nil, err
111112
}
112113
}
114+
115+
if slices.Contains(clusterMetadata.ClusterManagers, kmapi.ClusterManagerOpenShift.Name()) {
116+
if err := unstructured.SetNestedField(overrides, true, "distro", "openshift"); err != nil {
117+
return nil, err
118+
}
119+
if err := unstructured.SetNestedField(overrides, "all", "distro", "ubi"); err != nil {
120+
return nil, err
121+
}
122+
}
113123
}
114124
return overrides, nil
115125
}

0 commit comments

Comments
 (0)