Skip to content

Commit 25572ae

Browse files
committed
controller: hypershift: relax configmap rbac rules
On HyperShift, we need to read configmaps from different namespaces, namely from the `openshift-config-managed` namespace. The only viable option is to move back the ConfigMap read permission as cluster role, while keeping the write/mutation permission as namespaced role. Ideally, we would have injected a specific role+rolebinding in the manifest bundle, but turns out that OLM always overwrites the namespace in the namespaced manifests (and that would perfectly make sense) so we cna't add permissions about a different namespace. AI-attribution: AIA PAI Ce Hin R claude-4.6-opus-1M v1.0 Signed-off-by: Francesco Romani <fromani@redhat.com>
1 parent 8406f55 commit 25572ae

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

internal/controller/kubeletconfig_controller.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,9 @@ type kubeletConfigHandler struct {
8686
}
8787

8888
// Namespace Scoped
89-
//+kubebuilder:rbac:groups="",resources=configmaps,verbs=create;delete;get;list;update;watch,namespace="numaresources"
89+
//+kubebuilder:rbac:groups="",resources=configmaps,verbs=create;delete;update,namespace="numaresources"
9090
// Cluster Scoped
91+
//+kubebuilder:rbac:groups="",resources=configmaps,verbs=get;list;watch
9192
//+kubebuilder:rbac:groups=machineconfiguration.openshift.io,resources=kubeletconfigs,verbs=get;list;watch
9293
//+kubebuilder:rbac:groups=machineconfiguration.openshift.io,resources=kubeletconfigs/finalizers,verbs=update
9394

0 commit comments

Comments
 (0)