Skip to content

Commit 52cc8e3

Browse files
Merge pull request #1394 from hongkailiu/OTA-1966-c
OTA-1966: Install namespace/openshift-lightspeed only when TechPreview is enabled
2 parents fa129da + 593a469 commit 52cc8e3

4 files changed

Lines changed: 13 additions & 9 deletions

install/0000_00_cluster-version-operator_45_openshift-lightspeed_namespace.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ kind: Namespace
33
metadata:
44
name: openshift-lightspeed
55
annotations:
6-
kubernetes.io/description: This manifest is only for testing purpose and will be removed when its own operator becomes available on the cluster.
6+
kubernetes.io/description: This manifest is only for testing purpose and will be removed before 5.0 GA or figure out how to install the cluster-update-advisory-prompt ConfigMap on a cluster where the openshift-lightspeed Namespace is installed by the OLM-installed OpenShift Lightspeed operator.
77
include.release.openshift.io/self-managed-high-availability: "true"
88
workload.openshift.io/allowed: "management"
9+
release.openshift.io/feature-set: TechPreviewNoUpgrade

install/0000_00_cluster-version-operator_50_lightspeed-prompts.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
apiVersion: v1
33
kind: ConfigMap
44
metadata:
5-
name: ota-advisory-prompt
5+
name: cluster-update-advisory-prompt
66
namespace: openshift-lightspeed
77
annotations:
88
include.release.openshift.io/self-managed-high-availability: "true"

pkg/proposal/controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ type Config struct {
8585
func DefaultConfig() Config {
8686
return Config{
8787
Namespace: envOrDefault("LIGHTSPEED_PROPOSAL_NAMESPACE", "openshift-lightspeed"),
88-
PromptConfigMap: envOrDefault("LIGHTSPEED_PROMPT_CONFIGMAP", "ota-advisory-prompt"),
88+
PromptConfigMap: envOrDefault("LIGHTSPEED_PROMPT_CONFIGMAP", "cluster-update-advisory-prompt"),
8989
}
9090
}
9191

pkg/proposal/controller_test.go

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,15 @@ Update path: Recommended
138138
for _, tt := range tests {
139139
t.Run(tt.name, func(t *testing.T) {
140140
c := NewController(tt.updatesGetterFunc, tt.client, tt.cvGetterFunc, func(_ context.Context, namespace, name string, _ metav1.GetOptions) (*corev1.ConfigMap, error) {
141-
return &corev1.ConfigMap{
142-
Data: map[string]string{
143-
"prompt": "prompt-abc",
144-
"foo": "bar",
145-
},
146-
}, nil
141+
if namespace == "openshift-lightspeed" && name == "cluster-update-advisory-prompt" {
142+
return &corev1.ConfigMap{
143+
Data: map[string]string{
144+
"prompt": "prompt-abc",
145+
"foo": "bar",
146+
},
147+
}, nil
148+
}
149+
return nil, fmt.Errorf("ConfigMap %s not found in namespace %s", name, namespace)
147150
}, func() string {
148151
return "4.22.1"
149152
})

0 commit comments

Comments
 (0)