Skip to content

Commit e832938

Browse files
committed
Add namespacemanagement/status to RBAC, and tweak test contents
Signed-off-by: Rizwana777 <rizwananaaz177@gmail.com>
1 parent 766cb0e commit e832938

4 files changed

Lines changed: 18 additions & 9 deletions

File tree

bundle/manifests/gitops-operator.clusterserviceversion.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ metadata:
180180
capabilities: Deep Insights
181181
console.openshift.io/plugins: '["gitops-plugin"]'
182182
containerImage: quay.io/redhat-developer/gitops-operator
183-
createdAt: "2025-08-20T01:09:37Z"
183+
createdAt: "2025-08-21T01:20:45Z"
184184
description: Enables teams to adopt GitOps principles for managing cluster configurations
185185
and application delivery across hybrid multi-cluster Kubernetes environments.
186186
features.operators.openshift.io/disconnected: "true"
@@ -494,6 +494,7 @@ spec:
494494
- experiments
495495
- experiments/finalizers
496496
- namespacemanagements
497+
- namespacemanagements/status
497498
- rollouts
498499
- rollouts/finalizers
499500
- rollouts/scale

config/rbac/role.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ rules:
143143
- experiments
144144
- experiments/finalizers
145145
- namespacemanagements
146+
- namespacemanagements/status
146147
- rollouts
147148
- rollouts/finalizers
148149
- rollouts/scale

controllers/gitopsservice_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ type ReconcileGitopsService struct {
198198
//+kubebuilder:rbac:groups=argoproj.io,resources=notificationsconfigurations;notificationsconfigurations/finalizers,verbs=*
199199
//+kubebuilder:rbac:groups=apiextensions.k8s.io,resources=customresourcedefinitions,verbs=get;list;watch;
200200
//+kubebuilder:rbac:groups="apiregistration.k8s.io",resources="apiservices",verbs=get;list
201-
//+kubebuilder:rbac:groups="argoproj.io",resources=namespacemanagements,verbs=create;get;list;watch;update;patch;delete;deletecollection
201+
//+kubebuilder:rbac:groups="argoproj.io",resources=namespacemanagements;namespacemanagements/status,verbs=create;get;list;watch;update;patch;delete;deletecollection
202202

203203
// Reconcile reads that state of the cluster for a GitopsService object and makes changes based on the state read
204204
// and what is in the GitopsService.Spec

test/openshift/e2e/ginkgo/sequential/1-113_validate_namespacemanagement_test.go

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,24 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() {
2828
ctx context.Context
2929
k8sClient client.Client
3030
nmName string = "nm-test"
31+
32+
randomNS *corev1.Namespace
33+
nsTest_1_9_custom *corev1.Namespace
34+
cleanupFunc1 func()
35+
cleanupFunc2 func()
3136
)
3237

3338
BeforeEach(func() {
3439
fixture.EnsureSequentialCleanSlate()
3540
k8sClient, _ = utils.GetE2ETestKubeClient()
3641
ctx = context.Background()
42+
})
43+
44+
AfterEach(func() {
45+
defer cleanupFunc1()
46+
defer cleanupFunc2()
47+
48+
fixture.OutputDebugOnFail(randomNS.Name, nsTest_1_9_custom.Name)
3749

3850
})
3951

@@ -50,11 +62,9 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() {
5062
By("Enabling namespaceManagement via env var")
5163
fixture.SetEnvInOperatorSubscriptionOrDeployment("ALLOW_NAMESPACE_MANAGEMENT_IN_NAMESPACE_SCOPED_INSTANCES", "true")
5264

53-
nsTest_1_9_custom, cleanupFunc1 := fixture.CreateNamespaceWithCleanupFunc("test-1-9-custom")
54-
defer cleanupFunc1()
65+
nsTest_1_9_custom, cleanupFunc1 = fixture.CreateNamespaceWithCleanupFunc("test-1-9-custom")
5566

56-
randomNS, cleanupFunc2 := fixture.CreateRandomE2ETestNamespaceWithCleanupFunc()
57-
defer cleanupFunc2()
67+
randomNS, cleanupFunc2 = fixture.CreateRandomE2ETestNamespaceWithCleanupFunc()
5868

5969
By("creating simple namespace-scoped Argo CD")
6070
argoCDInRandomNS := &argov1beta1api.ArgoCD{
@@ -134,9 +144,6 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() {
134144
},
135145
}
136146
Expect(k8sClient.Create(ctx, app)).To(Succeed())
137-
defer func() { // cleanup on test exit
138-
Expect(k8sClient.Delete(ctx, app)).To(Succeed())
139-
}()
140147

141148
By("verifying that Argo CD is able to deploy to that other namespace")
142149
Eventually(app, "4m", "5s").Should(appFixture.HaveHealthStatusCode(health.HealthStatusHealthy))

0 commit comments

Comments
 (0)