mirror of
https://github.com/rancher/rancher-docs.git
synced 2026-09-26 04:58:07 +00:00
Fix delete with preconditions example
This commit is contained in:
@@ -17,6 +17,7 @@ kubectl patch feature ext-kubeconfigs -p '{"spec":{"value":false}}'
|
|||||||
## Creating a Kubeconfig
|
## Creating a Kubeconfig
|
||||||
|
|
||||||
Only a **valid and active** Rancher user can create a Kubeconfig.
|
Only a **valid and active** Rancher user can create a Kubeconfig.
|
||||||
|
E.g. using a service account `system:admin` will lead to the following error:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
kubectl create -o jsonpath='{.status.value}' -f -<<EOF
|
kubectl create -o jsonpath='{.status.value}' -f -<<EOF
|
||||||
@@ -118,13 +119,17 @@ kubectl delete kubeconfig kubeconfig-zp786
|
|||||||
kubeconfig.ext.cattle.io "kubeconfig-zp786" deleted
|
kubeconfig.ext.cattle.io "kubeconfig-zp786" deleted
|
||||||
```
|
```
|
||||||
|
|
||||||
To delete a Kubeconfig using a precondition:
|
To delete a Kubeconfig using preconditions:
|
||||||
```sh
|
```sh
|
||||||
kubectl delete --raw /apis/ext.cattle.io/v1/kubeconfigs -f -<<EOF
|
cat <<EOF | k delete --raw /apis/ext.cattle.io/v1/kubeconfigs/kubeconfig-zp786 -f -
|
||||||
apiVersion: v1
|
{
|
||||||
kind: DeleteOptions
|
"apiVersion": "v1",
|
||||||
preconditions:
|
"kind": "DeleteOptions",
|
||||||
uid: 52183e05-d382-47d2-b4b9-d0735823ce90
|
"preconditions": {
|
||||||
|
"uid": "52183e05-d382-47d2-b4b9-d0735823ce90",
|
||||||
|
"resourceVersion": "31331505"
|
||||||
|
}
|
||||||
|
}
|
||||||
EOF
|
EOF
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user