Skip to content

Commit 720831b

Browse files
Ambient Code Botclaude
andcommitted
fix(rbac): add delete verb for networkpolicies to allow cleanup of stale and proxy egress NPs
The EP-1998 controller implementation calls r.Delete on NetworkPolicies in two places: cleanupMigratedNetworkPolicies (pruning stale entries) and createOrApplyProxyEgressNetworkPolicy (removing the policy when proxy is not configured). Without delete permission, these calls fail with 403, causing reconcile to abort before reaching createOrApplyDeployments. This blocked the env var test from seeing LOG_LEVEL applied to the deployment. Ref: openshift/enhancements#1998 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 52bad5d commit 720831b

3 files changed

Lines changed: 3 additions & 1 deletion

File tree

bundle/manifests/openshift-external-secrets-operator.clusterserviceversion.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,7 @@ spec:
605605
- networkpolicies
606606
verbs:
607607
- create
608+
- delete
608609
- get
609610
- list
610611
- update

config/rbac/role.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ rules:
181181
- networkpolicies
182182
verbs:
183183
- create
184+
- delete
184185
- get
185186
- list
186187
- update

pkg/controller/external_secrets/controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ type Reconciler struct {
104104
// +kubebuilder:rbac:groups="",resources=events;secrets;services;serviceaccounts,verbs=get;list;watch;create;update;delete;patch
105105
// +kubebuilder:rbac:groups=apps,resources=deployments,verbs=get;list;watch;create;update
106106
// +kubebuilder:rbac:groups=cert-manager.io,resources=certificates;clusterissuers;issuers,verbs=get;list;watch;create;update
107-
// +kubebuilder:rbac:groups=networking.k8s.io,resources=networkpolicies,verbs=get;list;watch;create;update
107+
// +kubebuilder:rbac:groups=networking.k8s.io,resources=networkpolicies,verbs=get;list;watch;create;update;delete
108108
// +kubebuilder:rbac:groups="",resources=namespaces,verbs=get;list;watch;create;update;patch
109109

110110
// +kubebuilder:rbac:groups="",resources=endpoints,verbs=get;list;watch

0 commit comments

Comments
 (0)