Skip to content

fix: restore kubeconfig Secret cache invalidation - #1955

Merged
gianlucam76 merged 1 commit into
projectsveltos:mainfrom
gianlucam76:bug-1954
Sep 10, 2026
Merged

fix: restore kubeconfig Secret cache invalidation#1955
gianlucam76 merged 1 commit into
projectsveltos:mainfrom
gianlucam76:bug-1954

Conversation

@gianlucam76

Copy link
Copy Markdown
Member

addon-controller never picks up a kubeconfig Secret's content changing until the pod itself restarts. This was reproduced: point a SveltosCluster's kubeconfig Secret at a new cluster's API server and delete the old cluster. Addon-controller keeps dialing the old, now-defunct IP indefinitely (dial tcp :6443: i/o timeout).

PR #1920 scoped the manager's Secret cache to type == addons.projectsveltos.io/cluster-profile (policyRef Secrets only), made unconditional. The ClusterSummaryReconciler's Secret watch is built on that same scoped informer, so a kubeconfig Secret update for a Secret of a different type was never seen. The watch handler (requeueClusterSummaryForReference) already calls clustercache.RemoveSecret correctly on every Secret event it sees.

The fix consist in flipping the scoping from an allowlist to a denylist. Cache every Secret except Helm's own release-history storage (type == helm.sh/release.v1),

Fixes #1954

addon-controller never picks up a kubeconfig Secret's content changing until the pod restarts.
This was reproduced: point a SveltosCluster's kubeconfig Secret at a new cluster's API server and
delete the old cluster. Addon-controller keeps dialing the old, now-defunct IP indefinitely
(dial tcp <old-ip>:6443: i/o timeout).

PR projectsveltos#1920 scoped the manager's Secret cache to type == addons.projectsveltos.io/cluster-profile (policyRef Secrets only),
made unconditional.  The ClusterSummaryReconciler's Secret watch is built on that same scoped informer, so a kubeconfig
Secret update for a Secret of a different type was never seen.
The watch handler (requeueClusterSummaryForReference) already calls clustercache.RemoveSecret correctly on every Secret
event it sees.

The fix consist in flipping the scoping from an allowlist to a denylist. Cache every Secret except Helm's own release-history
storage (type == helm.sh/release.v1),

Fixes projectsveltos#1954
@gianlucam76
gianlucam76 merged commit 801cc6a into projectsveltos:main Sep 10, 2026
12 checks passed
@gianlucam76
gianlucam76 deleted the bug-1954 branch September 10, 2026 09:51
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.

Kubeconfig endpoint change is never picked up: clustercache invalidation broken since #1920 (v1.14.0)

1 participant