Skip to content

Classifier v1.12.0 migration fails: classifier-manager RBAC lacks namespaces get #485

Description

@nilpntr

The upgrade migration added in v1.12.0 needs get on namespaces, but the classifier controller RBAC (config/rbac/role.yaml, mirrored into the helm chart) does not grant it. The migrate initContainer crash-loops and classifier-manager never becomes Ready.

Where

migration.go Gets the namespace of each matching cluster:

return fmt.Errorf("checking namespace %s: %w", d.ref.Namespace, err)

This runs for e.g. a management-cluster SveltosCluster registered in its own namespace (agent.managementCluster=true).

Symptom

main.go:291] "migration failed" err="migrating classifier default-classifier:
checking namespace <ns>: namespaces \"<ns>\" is forbidden:
User \"system:serviceaccount:projectsveltos:classifier-manager\" cannot get
resource \"namespaces\" in API group \"\" in the namespace \"<ns>\""

classifier-manager Deployment then reports ProgressDeadlineExceeded; any Argo/Flux app wrapping it stays Degraded.

Root cause

classifier-manager-role grants no namespaces verb. It needs, on the core ("") group:

resources: [namespaces], verbs: [get, list, watch]

Fix

Add the kubebuilder RBAC marker where the migration/reconciler reads namespaces so it propagates to config/rbac/role.yaml on make manifests:

// +kubebuilder:rbac:groups="",resources=namespaces,verbs=get;list;watch

I opened a chart-side stopgap so consumers are unblocked now: projectsveltos/helm-charts#199 — but it will be re-dropped on the next chart regen unless the marker lands here.

Repro

Install chart 1.12.1 with agent.managementCluster=true, let the mgmt SveltosCluster register, observe the classifier-manager migrate initContainer crash-loop.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions