Add munger to verify kubectl -f targets, fix docs
This commit is contained in:
@@ -34,7 +34,7 @@ When you create a resource such as pod, and then retrieve the created
|
||||
resource, a number of the fields of the resource are added.
|
||||
You can see this at work in the following example:
|
||||
```
|
||||
$ cat > original.yaml <<EOF
|
||||
$ cat > /tmp/original.yaml <<EOF
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
@@ -45,17 +45,17 @@ spec:
|
||||
image: busybox
|
||||
restartPolicy: Never
|
||||
EOF
|
||||
$ kubectl create -f original.yaml
|
||||
$ kubectl create -f /tmp/original.yaml
|
||||
pods/original
|
||||
$ kubectl get pods/original -o yaml > current.yaml
|
||||
$ kubectl get pods/original -o yaml > /tmp/current.yaml
|
||||
pods/original
|
||||
$ wc -l original.yaml current.yaml
|
||||
51 current.yaml
|
||||
9 original.yaml
|
||||
$ wc -l /tmp/original.yaml /tmp/current.yaml
|
||||
51 /tmp/current.yaml
|
||||
9 /tmp/original.yaml
|
||||
60 total
|
||||
```
|
||||
The resource we posted had only 9 lines, but the one we got back had 51 lines.
|
||||
If you `diff original.yaml current.yaml`, you can see the fields added to the pod.
|
||||
If you `diff -u /tmp/original.yaml /tmp/current.yaml`, you can see the fields added to the pod.
|
||||
The system adds fields in several ways:
|
||||
- Some fields are added synchronously with creation of the resource and some are set asynchronously.
|
||||
- For example: `metadata.uid` is set synchronously. (Read more about [metadata](../devel/api-conventions.md#metadata)).
|
||||
|
Reference in New Issue
Block a user