Skip to content

(bug) drop namespaces RBAC dependency from migration#486

Merged
gianlucam76 merged 1 commit into
projectsveltos:mainfrom
gianlucam76:prep
Jul 9, 2026
Merged

(bug) drop namespaces RBAC dependency from migration#486
gianlucam76 merged 1 commit into
projectsveltos:mainfrom
gianlucam76:prep

Conversation

@gianlucam76

@gianlucam76 gianlucam76 commented Jul 9, 2026

Copy link
Copy Markdown
Member

The migrate initContainer (added in v1.11.0 to move per-cluster status from Classifier.status onto ClassifierReport.status) checks each stale/pending entry in the deprecated status arrays by Get-ing that cluster's Namespace, to decide whether the entry refers to a cluster that's since been deleted. classifier-manager-role has never granted get on core namespaces, so any upgrade that still has real data in those arrays (going from pre-v1.11.0 straight to a current release, skipping the intermediate versions that already ran the migration once and cleared the fields) hits:

migrating classifier default-classifier: checking namespace : namespaces "" is forbidden: ...

and the initContainer crash-loops, so classifier-manager never becomes Ready.

Instead of granting the new namespaces permission, check whether the cluster the entry actually refers to (SveltosCluster or CAPI Cluster) still exists, via migrationClusterExists. classifier-manager-role already grants get;list;watch on both sveltosclusters and cluster.x-k8s.io/clusters for other reconcilers, so this needs no new RBAC.

Fixes #485

The migrate initContainer (added in v1.11.0 to move per-cluster status from Classifier.status
onto ClassifierReport.status) checks each stale/pending entry in the deprecated status arrays by
Get-ing that cluster's Namespace, to decide whether the entry refers to a cluster that's since
been deleted. classifier-manager-role has never granted get on core namespaces, so any upgrade
that still has real data in those arrays (going from pre-v1.11.0 straight to a current release,
skipping the intermediate versions that already ran the migration once and cleared the fields) hits:

migrating classifier default-classifier: checking namespace <ns>: namespaces "<ns>" is forbidden: ...

and the initContainer crash-loops, so classifier-manager never becomes Ready.

Instead of granting the new namespaces permission, check whether the cluster the entry actually refers
to (SveltosCluster or CAPI Cluster) still exists, via migrationClusterExists. classifier-manager-role
already grants get;list;watch on both sveltosclusters and cluster.x-k8s.io/clusters for other reconcilers,
so this needs no new RBAC.
@gianlucam76 gianlucam76 merged commit 496d5da into projectsveltos:main Jul 9, 2026
14 checks passed
@gianlucam76 gianlucam76 deleted the prep branch July 9, 2026 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant