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
a99adcdf
Commit
a99adcdf
authored
Oct 08, 2016
by
Kubernetes Submit Queue
Committed by
GitHub
Oct 08, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #34343 from mikedanese/prune-tests
Automatic merge from submit-queue kubectl: add two more test of kubectl apply --prune @pwittrock
parents
e10f1227
6d17a878
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
0 deletions
+32
-0
test-cmd.sh
hack/make-rules/test-cmd.sh
+32
-0
No files found.
hack/make-rules/test-cmd.sh
View file @
a99adcdf
...
@@ -1075,6 +1075,38 @@ __EOF__
...
@@ -1075,6 +1075,38 @@ __EOF__
# cleanup
# cleanup
kubectl delete pods b
kubectl delete pods b
# same thing without prune for a sanity check
# Pre-Condition: no POD exists
kube::test::get_object_assert pods
"{{range.items}}{{
$id_field
}}:{{end}}"
''
# apply a
kubectl apply
-l
prune-group
=
true
-f
hack/testdata/prune/a.yaml
"
${
kube_flags
[@]
}
"
# check right pod exists
kube::test::get_object_assert
'pods a'
"{{
${
id_field
}
}}"
'a'
# check wrong pod doesn't exist
output_message
=
$(
!
kubectl get pods b 2>&1
"
${
kube_flags
[@]
}
"
)
kube::test::if_has_string
"
${
output_message
}
"
'pods "b" not found'
# apply b
kubectl apply
-l
prune-group
=
true
-f
hack/testdata/prune/b.yaml
"
${
kube_flags
[@]
}
"
# check both pods exist
kube::test::get_object_assert
'pods a'
"{{
${
id_field
}
}}"
'a'
kube::test::get_object_assert
'pods b'
"{{
${
id_field
}
}}"
'b'
# check wrong pod doesn't exist
# cleanup
kubectl delete pod/a pod/b
## kubectl apply --prune requires a --all flag to select everything
output_message
=
$(
!
kubectl apply
--prune
-f
hack/testdata/prune 2>&1
"
${
kube_flags
[@]
}
"
)
kube::test::if_has_string
"
${
output_message
}
"
\
'all resources selected for prune without explicitly passing --all'
# should apply everything
kubectl apply
--all
--prune
-f
hack/testdata/prune
kube::test::get_object_assert
'pods a'
"{{
${
id_field
}
}}"
'a'
kube::test::get_object_assert
'pods b'
"{{
${
id_field
}
}}"
'b'
kubectl delete pod/a pod/b
## kubectl run should create deployments or jobs
## kubectl run should create deployments or jobs
# Pre-Condition: no Job exists
# Pre-Condition: no Job exists
kube::test::get_object_assert
jobs
"{{range.items}}{{
$id_field
}}:{{end}}"
''
kube::test::get_object_assert
jobs
"{{range.items}}{{
$id_field
}}:{{end}}"
''
...
...
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