Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
7a385bf2
Commit
7a385bf2
authored
Apr 26, 2019
by
Xiangyang Chu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix wrong pipe in grep -q
parent
906058bf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
11 deletions
+10
-11
apply.sh
test/cmd/apply.sh
+9
-9
apps.sh
test/cmd/apps.sh
+1
-2
No files found.
test/cmd/apply.sh
View file @
7a385bf2
...
...
@@ -33,7 +33,7 @@ run_kubectl_apply_tests() {
# Post-Condition: pod "test-pod" is created
kube::test::get_object_assert
'pods test-pod'
"{{
${
labels_field
:?
}
.name}}"
'test-pod-label'
# Post-Condition: pod "test-pod" has configuration annotation
grep
-q
kubectl.kubernetes.io/last-applied-configuration
<<<
kubectl get pods test-pod
-o
yaml
"
${
kube_flags
[@]
:?
}
"
grep
-q
kubectl.kubernetes.io/last-applied-configuration
<<<
"
$(
kubectl get pods test-pod
-o
yaml
"
${
kube_flags
[@]
:?
}
"
)
"
# Clean up
kubectl delete pods test-pod
"
${
kube_flags
[@]
:?
}
"
...
...
@@ -46,18 +46,18 @@ run_kubectl_apply_tests() {
# Post-Condition: deployment "test-deployment-retainkeys" created
kube::test::get_object_assert deployments
"{{range.items}}{{
${
id_field
:?
}
}}{{end}}"
'test-deployment-retainkeys'
# Post-Condition: deployment "test-deployment-retainkeys" has defaulted fields
grep
-q
RollingUpdate
<<<
kubectl get deployments test-deployment-retainkeys
-o
yaml
"
${
kube_flags
[@]
:?
}
"
grep
-q
maxSurge
<<<
kubectl get deployments test-deployment-retainkeys
-o
yaml
"
${
kube_flags
[@]
:?
}
"
grep
-q
maxUnavailable
<<<
kubectl get deployments test-deployment-retainkeys
-o
yaml
"
${
kube_flags
[@]
:?
}
"
grep
-q
emptyDir
<<<
kubectl get deployments test-deployment-retainkeys
-o
yaml
"
${
kube_flags
[@]
:?
}
"
grep
-q
RollingUpdate
<<<
"
$(
kubectl get deployments test-deployment-retainkeys
-o
yaml
"
${
kube_flags
[@]
:?
}
"
)
"
grep
-q
maxSurge
<<<
"
$(
kubectl get deployments test-deployment-retainkeys
-o
yaml
"
${
kube_flags
[@]
:?
}
"
)
"
grep
-q
maxUnavailable
<<<
"
$(
kubectl get deployments test-deployment-retainkeys
-o
yaml
"
${
kube_flags
[@]
:?
}
"
)
"
grep
-q
emptyDir
<<<
"
$(
kubectl get deployments test-deployment-retainkeys
-o
yaml
"
${
kube_flags
[@]
:?
}
"
)
"
# Command: apply a deployment "test-deployment-retainkeys" should clear
# defaulted fields and successfully update the deployment
[[
"
$(
kubectl apply
-f
hack/testdata/retainKeys/deployment/deployment-after.yaml
"
${
kube_flags
[@]
:?
}
"
)
"
]]
# Post-Condition: deployment "test-deployment-retainkeys" has updated fields
grep
-q
Recreate
<<<
kubectl get deployments test-deployment-retainkeys
-o
yaml
"
${
kube_flags
[@]
:?
}
"
!
grep
-q
RollingUpdate
<<<
kubectl get deployments test-deployment-retainkeys
-o
yaml
"
${
kube_flags
[@]
:?
}
"
grep
-q
hostPath
<<<
kubectl get deployments test-deployment-retainkeys
-o
yaml
"
${
kube_flags
[@]
:?
}
"
!
grep
-q
emptyDir
<<<
kubectl get deployments test-deployment-retainkeys
-o
yaml
"
${
kube_flags
[@]
:?
}
"
grep
-q
Recreate
<<<
"
$(
kubectl get deployments test-deployment-retainkeys
-o
yaml
"
${
kube_flags
[@]
:?
}
"
)
"
!
grep
-q
RollingUpdate
<<<
"
$(
kubectl get deployments test-deployment-retainkeys
-o
yaml
"
${
kube_flags
[@]
:?
}
"
)
"
grep
-q
hostPath
<<<
"
$(
kubectl get deployments test-deployment-retainkeys
-o
yaml
"
${
kube_flags
[@]
:?
}
"
)
"
!
grep
-q
emptyDir
<<<
"
$(
kubectl get deployments test-deployment-retainkeys
-o
yaml
"
${
kube_flags
[@]
:?
}
"
)
"
# Clean up
kubectl delete deployments test-deployment-retainkeys
"
${
kube_flags
[@]
:?
}
"
...
...
test/cmd/apps.sh
View file @
7a385bf2
...
...
@@ -326,8 +326,7 @@ run_deployment_tests() {
newrs
=
"
$(
kubectl describe deployment nginx |
grep
NewReplicaSet |
awk
'{print $2}'
)
"
rs
=
"
$(
kubectl get rs
"
${
newrs
}
"
-o
yaml
)
"
kube::test::if_has_string
"
${
rs
}
"
"deployment.kubernetes.io/revision:
\"
6
\"
"
cat
hack/testdata/deployment-revision1.yaml |
${
SED
}
"s/name: nginx
$/
name: nginx2/"
| kubectl create
-f
-
"
${
kube_flags
[@]
}
"
#${SED} "s/name: nginx$/name: nginx2/" hack/testdata/deployment-revision1.yaml | kubectl create -f - "${kube_flags[@]:?}"
${
SED
}
"s/name: nginx
$/
name: nginx2/"
hack/testdata/deployment-revision1.yaml | kubectl create
-f
-
"
${
kube_flags
[@]
:?
}
"
# Deletion of both deployments should not be blocked
kubectl delete deployment nginx2
"
${
kube_flags
[@]
:?
}
"
# Clean up
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment