Repository navigation
EPMDEDP-17422: fix: Grant the RBAC that controller references need - #325
Closed
geekhubuser wants to merge 1 commit into
Closed
geekhubuser wants to merge 1 commit into
geekhubuser wants to merge 1 commit into
Conversation
8 of 11 tasks
- Grant update on stages/finalizers: the CDStageDeploy created for a Stage carries a controller reference to it with blockOwnerDeletion - Declare delete on secrets at the GitServer controller, which changes the owner references of its credential Secret - Mirror stages/finalizers into the chart Role - Add an envtest guard with OwnerReferencesPermissionEnforcement over config/rbac and the chart Role, with a negative row - Document the grants a new ownerReference write needs in CLAUDE.md
geekhubuser
force-pushed
the
EPMDEDP-17422
branch
from
November 2, 2026 11:09
6a96b56 to
34b36f2
Compare
Collaborator
Pipeline
|
| Status | Task | Duration |
|---|---|---|
| ✓ Passed | github-set-pending-status | 8s |
| ✓ Passed | fetch-repository | 11s |
| ✓ Passed | init-values | 6s |
| ✓ Passed | get-cache | 1m55s |
| ✓ Passed | commit-validate | 6s |
| ✓ Passed | dockerfile-lint | 8s |
| ✓ Passed | helm-lint | 7s |
| ✓ Passed | helm-docs | 13s |
| ✓ Passed | build | 50s |
| ✓ Passed | sonar | 21s |
| ✓ Passed | save-cache | 7s |
| ✓ Passed | buildkit-build | 28s |
| ✓ Passed | github-report-pipeline-status | 7s |
Pushing new commits re-runs this pipeline automatically.
To re-run it without new commits, comment/recheck.
Member
Author
|
Closing: there is no request for this yet, so there is no point in fixing it now. The missing grants matter only with the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
With the kube-apiserver admission plugin
OwnerReferencesPermissionEnforcement(on by default on OpenShift), 2.36.0 cannot create the CDStageDeploy of an Auto Environment:The CDStageDeploy carries a controller reference to its Stage (
put_cd_stage_deploy.go:242), and the plugin then requiresupdateonstages/finalizers. EPMDEDP-17305 rebuilt the Role from the markers, and no marker declared this permission, because no API call needs it. 2.35.0 had it through the hand-written Role.This change adds the marker at the CodebaseImageStream controller, regenerates
config/rbac/role.yaml, and mirrors the rule into the chart Role. The GitServer controller now also declares thedeleteon secrets it needs when it changes the owner references of its credential Secret. Today that grant comes only from the Codebase controller's marker.Because the call-site rule cannot see grants that only the admission plugin consumes, a guard test checks them.
controllers/rbac_test.gostarts envtest with the plugin and bindsconfig/rbac/role.yamland the chart Role, each in a namespace of its own, to a non-admin user. It then writes every owner reference the controllers set, and includes a negative row.CLAUDE.mdgets the matching convention line.Fixes EPMDEDP-17422 (codebase-operator part; the cd-pipeline-operator part is a separate PR)
Type of change
How Has This Been Tested?
kind (Kubernetes 1.36.4) with
OwnerReferencesPermissionEnforcementon, both operators from their EPMDEDP-17422 branches. For the codebase-operator image, the branch binary was put on the 2.36.0 image, because the Dockerfile's pinned Alpine packages no longer install. The fix itself is the Role.cdstagedeployments ... is forbidden: cannot set blockOwnerDeletion if an ownerReference refers to a resource you can't set finalizers on, no CDStageDeployStage/app-dev,blockOwnerDeletion: trueUnit checks in
golang:1.26(Go 1.26.9):Stage controls a new CDStageDeployfails, in both Roles, with the production errorstages/finalizersremoved from one Role onlyStage controls a new CDStageDeployfailsmake testmake lintmake manifestsstages/finalizersline inconfig/rbac/role.yaml; no driftChecklist: