Skip to content

Commit

Permalink
(feat) when updating Secret with kubeconfig add entry
Browse files Browse the repository at this point in the history
Instead of resetting the Data section, just add/update the entry
with kubeconfig.
  • Loading branch information
mgianluc committed Oct 28, 2024
1 parent c0b2882 commit b5676d3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/clusterproxy/clusterproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,11 @@ func UpdateSveltosSecretData(ctx context.Context, logger logr.Logger, c client.C
clusterNamespace, secretName))
}

secret.Data = map[string][]byte{
kubeconfigKey: []byte(kubeconfig),
if secret.Data == nil {
secret.Data = map[string][]byte{}
}
secret.Data[kubeconfigKey] = []byte(kubeconfig)

return c.Update(ctx, secret)
}

Expand Down

0 comments on commit b5676d3

Please sign in to comment.