trim whitespaces in manifests

This commit is contained in:
makocchi-git
2020-12-02 15:43:10 +09:00
parent c7545c18be
commit 28c964b5c9
@@ -216,12 +216,17 @@ kubectl-user create -f- <<EOF
apiVersion: v1 apiVersion: v1
kind: Pod kind: Pod
metadata: metadata:
name: pause name: pause
spec: spec:
containers: containers:
- name: pause - name: pause
image: k8s.gcr.io/pause image: k8s.gcr.io/pause
EOF EOF
```
The output is similar to this:
```
Error from server (Forbidden): error when creating "STDIN": pods "pause" is forbidden: unable to validate against any pod security policy: [] Error from server (Forbidden): error when creating "STDIN": pods "pause" is forbidden: unable to validate against any pod security policy: []
``` ```
@@ -264,12 +269,17 @@ kubectl-user create -f- <<EOF
apiVersion: v1 apiVersion: v1
kind: Pod kind: Pod
metadata: metadata:
name: pause name: pause
spec: spec:
containers: containers:
- name: pause - name: pause
image: k8s.gcr.io/pause image: k8s.gcr.io/pause
EOF EOF
```
The output is similar to this
```
pod "pause" created pod "pause" created
``` ```
@@ -281,14 +291,19 @@ kubectl-user create -f- <<EOF
apiVersion: v1 apiVersion: v1
kind: Pod kind: Pod
metadata: metadata:
name: privileged name: privileged
spec: spec:
containers: containers:
- name: pause - name: pause
image: k8s.gcr.io/pause image: k8s.gcr.io/pause
securityContext: securityContext:
privileged: true privileged: true
EOF EOF
```
The output is similar to this:
```
Error from server (Forbidden): error when creating "STDIN": pods "privileged" is forbidden: unable to validate against any pod security policy: [spec.containers[0].securityContext.privileged: Invalid value: true: Privileged containers are not allowed] Error from server (Forbidden): error when creating "STDIN": pods "privileged" is forbidden: unable to validate against any pod security policy: [spec.containers[0].securityContext.privileged: Invalid value: true: Privileged containers are not allowed]
``` ```