Skip to content

Commit 0536e0f

Browse files
anik120openshift-merge-bot[bot]
authored andcommitted
configure watchnamespace using spec.config for OTE tests
1 parent 1d824fc commit 0536e0f

File tree

1 file changed

+19
-9
lines changed

1 file changed

+19
-9
lines changed

openshift/tests-extension/test/olmv1-singleownnamespace.go

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
. "github.com/onsi/gomega"
1212

1313
corev1 "k8s.io/api/core/v1"
14+
apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
1415
"k8s.io/apimachinery/pkg/api/meta"
1516
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1617
"k8s.io/apimachinery/pkg/util/rand"
@@ -92,10 +93,13 @@ var _ = Describe("[sig-olmv1][OCPFeatureGate:NewOLMOwnSingleNamespace][Skipped:D
9293
_ = k8sClient.Delete(context.Background(), crb, client.PropagationPolicy(metav1.DeletePropagationForeground))
9394
})
9495

95-
By("creating ClusterExtension with the watch-namespace annotation")
96+
By("creating ClusterExtension with the watch-namespace configured")
9697
ce := helpers.NewClusterExtensionObject("quay-operator", "3.14.2", ceName, saName, namespace)
97-
ce.Annotations = map[string]string{
98-
"olm.operatorframework.io/watch-namespace": namespace,
98+
ce.Spec.Config = &olmv1.ClusterExtensionConfig{
99+
ConfigType: "Inline",
100+
Inline: &apiextensionsv1.JSON{
101+
Raw: []byte(fmt.Sprintf(`{"watchNamespace": "%s"}`, namespace)),
102+
},
99103
}
100104
Expect(k8sClient.Create(ctx, ce)).To(Succeed(), "failed to create ClusterExtension %q", ceName)
101105
By("registering cleanup for ClusterExtension")
@@ -181,10 +185,13 @@ var _ = Describe("[sig-olmv1][OCPFeatureGate:NewOLMOwnSingleNamespace][Skipped:D
181185
_ = k8sClient.Delete(context.Background(), crb, client.PropagationPolicy(metav1.DeletePropagationForeground))
182186
})
183187

184-
By("creating ClusterExtension with the watch-namespace annotation")
188+
By("creating ClusterExtension with the watch-namespace configured")
185189
ce := helpers.NewClusterExtensionObject("quay-operator", "3.14.2", ceName, saName, namespace)
186-
ce.Annotations = map[string]string{
187-
"olm.operatorframework.io/watch-namespace": namespace,
190+
ce.Spec.Config = &olmv1.ClusterExtensionConfig{
191+
ConfigType: "Inline",
192+
Inline: &apiextensionsv1.JSON{
193+
Raw: []byte(fmt.Sprintf(`{"watchNamespace": "%s"}`, namespace)),
194+
},
188195
}
189196
Expect(k8sClient.Create(ctx, ce)).To(Succeed(), "failed to create ClusterExtension %q", ceName)
190197
By("registering cleanup for ClusterExtension")
@@ -270,10 +277,13 @@ var _ = Describe("[sig-olmv1][OCPFeatureGate:NewOLMOwnSingleNamespace][Skipped:D
270277
_ = k8sClient.Delete(context.Background(), crb, client.PropagationPolicy(metav1.DeletePropagationForeground))
271278
})
272279

273-
By("creating ClusterExtension with the watch-namespace annotation")
280+
By("creating ClusterExtension with the watch-namespace configured")
274281
ce := helpers.NewClusterExtensionObject("openshift-pipelines-operator-rh", "1.17.1", ceName, saName, namespace)
275-
ce.Annotations = map[string]string{
276-
"olm.operatorframework.io/watch-namespace": namespace,
282+
ce.Spec.Config = &olmv1.ClusterExtensionConfig{
283+
ConfigType: "Inline",
284+
Inline: &apiextensionsv1.JSON{
285+
Raw: []byte(fmt.Sprintf(`{"watchNamespace": "%s"}`, namespace)),
286+
},
277287
}
278288
Expect(k8sClient.Create(ctx, ce)).To(Succeed(), "failed to create ClusterExtension %q", ceName)
279289
By("registering cleanup for ClusterExtension")

0 commit comments

Comments
 (0)