Skip to content

fix: invalidate workload identity cache when SveltosCluster spec changes#641

Merged
gianlucam76 merged 1 commit into
projectsveltos:mainfrom
gianlucam76:reset-client
Jul 14, 2026
Merged

fix: invalidate workload identity cache when SveltosCluster spec changes#641
gianlucam76 merged 1 commit into
projectsveltos:mainfrom
gianlucam76:reset-client

Conversation

@gianlucam76

Copy link
Copy Markdown
Member

getWorkloadIdentityRestConfig caches the built rest.Config per cluster in an in-memory wiCache, keyed only by namespace/name. Eviction is only wired up in each component's SveltosCluster delete handler nothing invalidates the cache on update. So editing spec.workloadIdentity had no effect until the cached cloud token neared its natural expiry

The fix consist in hashing spec.workloadIdentity and store it alongside the cached rest.Config. The cache is now only considered valid when both the hash matches the current spec and it isn't near expiry

getWorkloadIdentityRestConfig caches the built rest.Config per cluster in
an in-memory wiCache, keyed only by namespace/name.
Eviction is only wired up in each component's SveltosCluster delete handler
nothing invalidates the cache on update. So editing spec.workloadIdentity
had no effect until the cached cloud token neared its natural expiry

The fix consist in hashing spec.workloadIdentity and store it alongside
the cached rest.Config. The cache is now only considered valid when both
the hash matches the current spec and it isn't near expiry
@gianlucam76
gianlucam76 merged commit 259ff77 into projectsveltos:main Jul 14, 2026
2 checks passed
@gianlucam76
gianlucam76 deleted the reset-client branch July 14, 2026 21:08
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.

1 participant