Skip to content

Commit 53e182a

Browse files
scotwellsclaude
andcommitted
fix(rbac): grant the instance controller permission to emit events
The instance controller emits Warning events on Instances (QuotaNoBudget, ImageUnavailable, InstanceCrashing, ConfigurationError, NetworkFailedToCreate, …) via the event recorder, but no RBAC rule granted it. Every write was rejected — "events is forbidden: ... cannot create resource events in API group \"\" in the namespace ns-<uid>" — so the user-facing signals explaining why an instance is stuck never reached the Instance (kubectl describe / activity timeline). Reconciliation was unaffected; this is an observability gap. Add the kubebuilder marker and regenerate the role. The regen also syncs a pre-existing work.karmada.io/resourcebindings rule (from an existing marker that wasn't reflected in the committed role). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 5458503 commit 53e182a

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

config/components/controller_rbac/role.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ kind: ClusterRole
44
metadata:
55
name: compute
66
rules:
7+
- apiGroups:
8+
- ""
9+
resources:
10+
- events
11+
verbs:
12+
- create
13+
- patch
714
- apiGroups:
815
- ""
916
resources:

internal/controller/instance_controller.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ type InstanceReconciler struct {
189189
// +kubebuilder:rbac:groups=compute.datumapis.com,resources=instances/finalizers,verbs=update
190190
// +kubebuilder:rbac:groups=quota.miloapis.com,resources=resourceclaims,verbs=get;list;watch;create;delete
191191
// +kubebuilder:rbac:groups="",resources=namespaces,verbs=get
192+
// +kubebuilder:rbac:groups="",resources=events,verbs=create;patch
192193

193194
func (r *InstanceReconciler) Reconcile(ctx context.Context, req mcreconcile.Request) (_ ctrl.Result, err error) {
194195
logger := log.FromContext(ctx)

0 commit comments

Comments
 (0)