Skip to content

Bug: updateDashboardCreds relies on deprecated ServiceAccount.Secrets field removed in Kubernetes 1.24+Β #489

Description

@mdryaan

πŸ“œ Description

pkg/hub/controllers/cluster/reconciler.go, updateDashboardCreds (lines 506–571) reads credentials via sa.Secrets[0].Name. The ServiceAccount.Secrets field was deprecated in Kubernetes 1.22 and removed in 1.24. In modern clusters this field is always empty, causing updateDashboardCreds to return an error "ServiceAccount has no secret" on every reconcile.

πŸ‘Ÿ Reproduction steps

  1. Run the operator against a Kubernetes 1.24+ cluster.
  2. Observe Error getting service account secret: ServiceAccount has no secret in logs on every cluster reconcile until the dashboard is manually disabled.

πŸ‘ Expected behavior

Dashboard credentials should be fetched by listing secrets with the kubernetes.io/service-account.name annotation, or the feature should be gated behind a capability check.

πŸ‘Ž Actual Behavior

Dashboard credential update always fails on Kubernetes 1.24+, generating an error event and blocking the reconcile early return.

🐚 Relevant log output

Version

No response

πŸ–₯️ What operating system are you seeing the problem on?

No response

βœ… Proposed Solution

Use r.MeshClient.List to find secrets annotated with kubernetes.io/service-account.name=kubeslice-kubernetes-dashboard instead of reading sa.Secrets.

πŸ‘€ Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find any similar issue

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Labels

bugSomething isn't working

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