Skip to content

Add ConfigMap permissions to operator ClusterRole#235

Merged
mitchnielsen merged 1 commit intomainfrom
fix-configmap-permissions
Dec 17, 2025
Merged

Add ConfigMap permissions to operator ClusterRole#235
mitchnielsen merged 1 commit intomainfrom
fix-configmap-permissions

Conversation

@mitchnielsen
Copy link
Member

@mitchnielsen mitchnielsen commented Dec 17, 2025

Summary

The operator needs to read ConfigMaps from any namespace where users deploy PrefectWorkPools or PrefectServers. This was missed when PR #194 added ConfigMap watching for base job templates - the controller calls Watches(&corev1.ConfigMap{}, ...) which requires cluster-wide list/watch permissions to sync the informer at startup.

Without these permissions, the operator fails with RBAC errors and enters CrashLoopBackOff.

The existing unit tests didn't catch this because envtest doesn't enforce RBAC - it's a simulated API server that grants all permissions. This kind of issue only surfaces when deploying to a real cluster. To confirm this, I deployed to a local cluster:

$ kubectl get pods -n prefect-system
NAME                                READY   STATUS    RESTARTS   AGE
prefect-operator-564fbfd7c9-kr5k6   1/1     Running   0          4m30s

Closes #234

The operator needs to read ConfigMaps from any namespace where users
deploy PrefectWorkPools or PrefectServers. This was missed when PR #194
added ConfigMap watching for base job templates - the controller calls
`Watches(&corev1.ConfigMap{}, ...)` which requires cluster-wide list/watch
permissions to sync the informer at startup.

Without these permissions, the operator fails with RBAC errors and enters
CrashLoopBackOff.

Closes #234

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@mitchnielsen mitchnielsen self-assigned this Dec 17, 2025
@mitchnielsen mitchnielsen added the fix Fix-related changes label Dec 17, 2025
@mitchnielsen mitchnielsen marked this pull request as ready for review December 17, 2025 18:37
@mitchnielsen mitchnielsen requested review from a team as code owners December 17, 2025 18:37
@mitchnielsen mitchnielsen merged commit d66f832 into main Dec 17, 2025
6 checks passed
@mitchnielsen mitchnielsen deleted the fix-configmap-permissions branch December 17, 2025 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Fix-related changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing permissions for ConfigMaps causes Operator initialization failure

2 participants