chore: Describe RBAC rules, remove unnecessary rules#380
Draft
NickLarsenNZ wants to merge 2 commits intomainfrom
Draft
chore: Describe RBAC rules, remove unnecessary rules#380NickLarsenNZ wants to merge 2 commits intomainfrom
NickLarsenNZ wants to merge 2 commits intomainfrom
Conversation
16 tasks
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.
Part of stackabletech/issues#798
Note
This was initially generated by a coding assistant to see how well it can inspect code and review the RBAC rules. the changes will be properly checked before reviews are requested.
Removed
""events(entire resource)get,list,watch,create,delete,patchRecorderusesevents.k8s.io/v1(confirmed inkube-rs@fe69cc4/kube-runtime/src/events.rs). The csi-provisioner v5.3.0 sidecar also usesevents.k8s.io. Corev1events are never written.listeners.stackable.techlistenersupdateclient.update()calls exist anywhere in the codebase. All mutation usesapply_patch(SSA →patchverb) ormerge_patch(patchverb).listeners.stackable.techlisteners/finalizers(entire resource)patch,create,delete,updateController(confirmed inkube-rs@fe69cc4/kube-runtime/src/controller/mod.rs) does not add finalizers automatically. Added in commitb2559c3but never used.listeners.stackable.techlisteners/statuscreate,delete,updatepatch(viaclient.apply_patch_status()).create,delete, andupdateon a subresource are not meaningful here.listeners.stackable.techpodlistenersdelete,updatePodListenersis not indelete_orphaned_resources(confirmed inoperator-rs@7486017/src/cluster_resources.rs). There are noclient.delete::<PodListeners>()calls.updateis unused for the same reason as above.Fixed
createonlistenerclassesmade unconditional (moved outside{{- if .Values.maintenance.customResourceDefinitions.maintain }})main.rscallsclient.create_if_missing()on presetListenerClassobjects unconditionally at startup. With the old conditional,createwould be absent whenmaintain: false, silently breaking preset ListenerClass deployment.servicesdeletecorrecteddeleteis actually needed for ClusterResources orphan cleanup (commitc1f49eb).Kept (with justification)
""servicesget,list,watch,create,patch,deletecreate+patch);getforReconciliationPausedstrategy; watched by controller (list+watch); orphan-cleaned byClusterResources(delete).""persistentvolumesget,list,watch,create,patch,deleteget: CSI node driver fetches PVs on volume publish.list+watch: controller watches PVs for reconciliation triggers; reconcile lists PVs by label selector.patch+create: CSI node driver patches PV labels via SSA.create+delete: external-provisioner sidecar creates/deletes PVs for PVC lifecycle.""nodesget,list,watchget: operator fetches specific nodes to resolve NodePort addresses.list+watch: external-provisioner sidecar requires these for topology-aware provisioning (--feature-gates=Topology=true).""persistentvolumeclaimsget,list,watchget: CSI controller and node driver fetch PVCs to read Listener selector annotations.list+watch: external-provisioner sidecar monitors PVCs to trigger provisioning.""endpointsget,list,watchget_optis called innode_names_for_nodeport_listeneras a fallback for older volumes.""nodes/proxygetKubeletConfig::fetchinoperator-rs@7486017/src/utils/kubelet.rsto read the kubelet'sconfigzAPI for automatic cluster domain detection.storage.k8s.iocsinodes,storageclassesget,list,watch""podsget,patchget), and merge-patches them to add a Listener membership label used as a Service selector (patch).events.k8s.ioeventscreate,patchRecordercreates newevents.k8s.io/v1Event objects and merge-patches existing ones to increment the repeat count.listeners.stackable.techlistenerclassesget,list,watch,create(+ conditionalpatch)list+watch+get).create:main.rscallsclient.create_if_missing()for preset ListenerClasses unconditionally at startup. Conditionalpatchretained for potential CRD maintenance field-manager ownership.listeners.stackable.techlistenersget,list,watch,create,patch,deletelist+watch+get). CSI node driver applies Listeners via SSA for class-based volumes (create+patch). Orphaned Listeners are removed byClusterResources(delete).listeners.stackable.techlisteners/statuspatchclient.apply_patch_status()inlistener_controller.rswrites ingress address status via SSA.listeners.stackable.techpodlistenerscreate,patchPodListenersobject on first volume mount (create), then merge-patches it to add entries for additional volumes (patch).security.openshift.iosecuritycontextconstraintslistener-sccuselistener-sccSCC on OpenShift (conditional on OpenShift detection).apiextensions.k8s.iocustomresourcedefinitionscreate,patch,list,watchmaintenance.customResourceDefinitions.maintain: true(the default). The operator patches CRDs to inject the conversion webhook certificate, and lists/watches CRDs for the startup readiness condition.