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
d0b5de85
Commit
d0b5de85
authored
Mar 20, 2017
by
Janet Kuo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a test for semantically equal DaemonSet updates
parent
eb771444
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
0 deletions
+53
-0
test-cmd-util.sh
hack/make-rules/test-cmd-util.sh
+26
-0
rollingupdate-daemonset.yaml
hack/testdata/rollingupdate-daemonset.yaml
+27
-0
No files found.
hack/make-rules/test-cmd-util.sh
View file @
d0b5de85
...
@@ -66,6 +66,7 @@ static="static"
...
@@ -66,6 +66,7 @@ static="static"
storageclass
=
"storageclass"
storageclass
=
"storageclass"
subjectaccessreviews
=
"subjectaccessreviews"
subjectaccessreviews
=
"subjectaccessreviews"
thirdpartyresources
=
"thirdpartyresources"
thirdpartyresources
=
"thirdpartyresources"
daemonsets
=
"daemonsets"
# Stops the running kubectl proxy, if there is one.
# Stops the running kubectl proxy, if there is one.
...
@@ -2574,6 +2575,22 @@ run_rs_tests() {
...
@@ -2574,6 +2575,22 @@ run_rs_tests() {
fi
fi
}
}
run_daemonset_tests
()
{
kube::log::status
"Testing kubectl(v1:daemonsets)"
### Create a rolling update DaemonSet
# Pre-condition: no DaemonSet exists
kube::test::get_object_assert daemonsets
"{{range.items}}{{
$id_field
}}:{{end}}"
''
# Command
kubectl apply
-f
hack/testdata/rollingupdate-daemonset.yaml
"
${
kube_flags
[@]
}
"
# Template Generation should be 1
kube::test::get_object_assert
'daemonsets bind'
"{{
${
template_generation_field
}
}}"
'1'
kubectl apply
-f
hack/testdata/rollingupdate-daemonset.yaml
"
${
kube_flags
[@]
}
"
# Template Generation should stay 1
kube::test::get_object_assert
'daemonsets bind'
"{{
${
template_generation_field
}
}}"
'1'
kubectl delete
-f
hack/testdata/rollingupdate-daemonset.yaml
"
${
kube_flags
[@]
}
"
}
run_multi_resources_tests
()
{
run_multi_resources_tests
()
{
kube::log::status
"Testing kubectl(v1:multiple resources)"
kube::log::status
"Testing kubectl(v1:multiple resources)"
...
@@ -2798,6 +2815,7 @@ runTests() {
...
@@ -2798,6 +2815,7 @@ runTests() {
deployment_second_image_field
=
"(index .spec.template.spec.containers 1).image"
deployment_second_image_field
=
"(index .spec.template.spec.containers 1).image"
change_cause_annotation
=
'.*kubernetes.io/change-cause.*'
change_cause_annotation
=
'.*kubernetes.io/change-cause.*'
pdb_min_available
=
".spec.minAvailable"
pdb_min_available
=
".spec.minAvailable"
template_generation_field
=
".spec.templateGeneration"
# Make sure "default" namespace exists.
# Make sure "default" namespace exists.
if
kube::test::if_supports_resource
"
${
namespaces
}
"
;
then
if
kube::test::if_supports_resource
"
${
namespaces
}
"
;
then
...
@@ -3180,6 +3198,14 @@ runTests() {
...
@@ -3180,6 +3198,14 @@ runTests() {
fi
fi
##################
# DaemonSets #
##################
if
kube::test::if_supports_resource
"
${
daemonsets
}
"
;
then
run_daemonset_tests
fi
###########################
###########################
# Replication controllers #
# Replication controllers #
###########################
###########################
...
...
hack/testdata/rollingupdate-daemonset.yaml
0 → 100644
View file @
d0b5de85
apiVersion
:
extensions/v1beta1
kind
:
DaemonSet
metadata
:
name
:
bind
spec
:
updateStrategy
:
type
:
RollingUpdate
rollingUpdate
:
maxUnavailable
:
10%
template
:
metadata
:
labels
:
service
:
bind
spec
:
affinity
:
podAntiAffinity
:
requiredDuringSchedulingIgnoredDuringExecution
:
-
labelSelector
:
matchExpressions
:
-
key
:
"
service"
operator
:
"
In"
values
:
[
"
bind"
]
topologyKey
:
"
kubernetes.io/hostname"
namespaces
:
[]
containers
:
-
name
:
kubernetes-pause
image
:
gcr.io/google-containers/pause:2.0
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