mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 20:53:33 +00:00
Add test from #47578
This commit is contained in:
parent
9fe19d1074
commit
222f6ae37f
@ -2851,6 +2851,16 @@ run_deployment_tests() {
|
|||||||
# Clean up
|
# Clean up
|
||||||
kubectl delete deployment test-nginx-apps "${kube_flags[@]}"
|
kubectl delete deployment test-nginx-apps "${kube_flags[@]}"
|
||||||
|
|
||||||
|
### Test kubectl create deployment should not fail validation
|
||||||
|
# Pre-Condition: No deployment exists.
|
||||||
|
kube::test::get_object_assert deployment "{{range.items}}{{$id_field}}:{{end}}" ''
|
||||||
|
# Command
|
||||||
|
kubectl create -f hack/testdata/deployment-with-UnixUserID.yaml "${kube_flags[@]}"
|
||||||
|
# Post-Condition: Deployment "deployment-with-unixuserid" is created.
|
||||||
|
kube::test::get_object_assert deployment "{{range.items}}{{$id_field}}:{{end}}" 'deployment-with-unixuserid:'
|
||||||
|
# Clean up
|
||||||
|
kubectl delete deployment deployment-with-unixuserid "${kube_flags[@]}"
|
||||||
|
|
||||||
### Test cascading deletion
|
### Test cascading deletion
|
||||||
## Test that rs is deleted when deployment is deleted.
|
## Test that rs is deleted when deployment is deleted.
|
||||||
# Pre-condition: no deployment exists
|
# Pre-condition: no deployment exists
|
||||||
|
18
hack/testdata/deployment-with-UnixUserID.yaml
vendored
Normal file
18
hack/testdata/deployment-with-UnixUserID.yaml
vendored
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
apiVersion: extensions/v1beta1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: deployment-with-unixuserid
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: nginx
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: nginx
|
||||||
|
image: nginx:1.7.9
|
||||||
|
securityContext:
|
||||||
|
runAsNonRoot: true
|
||||||
|
runAsUser: 65534
|
||||||
|
|
Loading…
Reference in New Issue
Block a user