Change Updating a kubeconfig section

This commit is contained in:
Peter Matseykanets
2025-07-14 11:52:25 -04:00
parent 31e4df5090
commit 6b96b010fd
+3 -9
View File
@@ -156,16 +156,10 @@ kubectl delete --raw /apis/ext.cattle.io/v1/kubeconfigs?labelSelector=foo%3Dbar
#### Updating a Kubeconfig
Only the metadata and the `spec.description` field can be updated. All other `spec` fields are immutable.
Only the `metadata`, e.g. adding a label or an annotation, and the `spec.description` field can be updated. All other `spec` fields are immutable.
To add a label to a Kubeconfig:
To edit a Kubeconfig:
```sh
kubectl patch kubeconfig kubeconfig-zp786 -p '{"metadata":{"labels":{"foo":"bar"}}}'
```
To change the description of a Kubeconfig:
```sh
kubectl patch kubeconfig kubeconfig-zp786 -p '{"spec":{"description":"Updated description"}}'
kubectl edit kubeconfig kubeconfig-zp786
```