(bug) Set SveltosCluster.Spec.KubeconfigKeyName #385
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When a cluster is registered with Sveltos, a Secret containing the cluster's kubeconfig is created.
The kubeconfig is stored under the key kubeconfig within this Secret.
If Sveltos renews the token, the key is updated to re-kubeconfig, and the
SveltosCluster.Spec.KubeconfigKeyName
is updated to reflect this change.If you run the
sveltosctl register cluster
command again, the Secret's data is reset, and the cluster's kubeconfig is once again stored under the kubeconfig key.Previously, this would cause issues because the
SveltosCluster.Spec.KubeconfigKeyName
was not updated back to kubeconfig.This PR resolves that problem by ensuring that
SveltosCluster.Spec.KubeconfigKeyName
is correctly updated to match the key in the Secret, preventing Sveltos components from failing to find the cluster's kubeconfig.Fixes 1323