Skip to content

Commit

Permalink
Merge pull request #373 from gianlucam76/update-secret
Browse files Browse the repository at this point in the history
(feat) when updating Secret with kubeconfig add entry
  • Loading branch information
gianlucam76 authored Oct 28, 2024
2 parents c0b2882 + b5676d3 commit 764de57
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 764de57

Please sign in to comment.