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
12455bf5
Commit
12455bf5
authored
Oct 17, 2016
by
Michail Kargakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hack: add test for overlapping selectors in deployments
parent
8351450a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
6 deletions
+13
-6
test-cmd.sh
hack/make-rules/test-cmd.sh
+7
-0
deployment.go
test/e2e/deployment.go
+6
-6
No files found.
hack/make-rules/test-cmd.sh
View file @
12455bf5
...
@@ -2249,6 +2249,13 @@ __EOF__
...
@@ -2249,6 +2249,13 @@ __EOF__
kubectl get rs nginx-618515232
-o
yaml |
grep
"deployment.kubernetes.io/revision-history: 1,3"
kubectl get rs nginx-618515232
-o
yaml |
grep
"deployment.kubernetes.io/revision-history: 1,3"
# Check that trying to watch the status of a superseded revision returns an error
# Check that trying to watch the status of a superseded revision returns an error
!
kubectl rollout status deployment/nginx
--revision
=
3
!
kubectl rollout status deployment/nginx
--revision
=
3
cat
hack/testdata/deployment-revision1.yaml |
$SED
"s/name: nginx
$/
name: nginx2/"
| kubectl create
-f
-
"
${
kube_flags
[@]
}
"
# Newest deployment should be marked as overlapping
kubectl get deployment nginx2
-o
yaml
"
${
kube_flags
[@]
}
"
|
grep
"deployment.kubernetes.io/error-selector-overlapping-with"
# Oldest deployment should not be marked as overlapping
!
kubectl get deployment nginx
-o
yaml
"
${
kube_flags
[@]
}
"
|
grep
"deployment.kubernetes.io/error-selector-overlapping-with"
# Deletion of both deployments should not be blocked
kubectl delete deployment nginx2
"
${
kube_flags
[@]
}
"
# Clean up
# Clean up
kubectl delete deployment nginx
"
${
kube_flags
[@]
}
"
kubectl delete deployment nginx
"
${
kube_flags
[@]
}
"
...
...
test/e2e/deployment.go
View file @
12455bf5
...
@@ -1255,11 +1255,11 @@ func testOverlappingDeployment(f *framework.Framework) {
...
@@ -1255,11 +1255,11 @@ func testOverlappingDeployment(f *framework.Framework) {
Expect
(
err
)
.
NotTo
(
HaveOccurred
(),
"Failed creating the second deployment"
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
(),
"Failed creating the second deployment"
)
// Wait for overlapping annotation updated to both deployments
// Wait for overlapping annotation updated to both deployments
By
(
"Waiting for both deployments to have overlapping annotations"
)
By
(
"Waiting for the overlapping deployment to have overlapping annotation"
)
err
=
framework
.
WaitForOverlappingAnnotationMatch
(
c
,
ns
,
deploy
.
Name
,
deployOverlapping
.
Name
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
(),
"Failed to update the first deployment's overlapping annotation"
)
err
=
framework
.
WaitForOverlappingAnnotationMatch
(
c
,
ns
,
deployOverlapping
.
Name
,
deploy
.
Name
)
err
=
framework
.
WaitForOverlappingAnnotationMatch
(
c
,
ns
,
deployOverlapping
.
Name
,
deploy
.
Name
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
(),
"Failed to update the second deployment's overlapping annotation"
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
(),
"Failed to update the second deployment's overlapping annotation"
)
err
=
framework
.
WaitForOverlappingAnnotationMatch
(
c
,
ns
,
deploy
.
Name
,
""
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
(),
"The deployment that holds the oldest selector shouldn't have the overlapping annotation"
)
// Only the first deployment is synced
// Only the first deployment is synced
By
(
"Checking only the first overlapping deployment is synced"
)
By
(
"Checking only the first overlapping deployment is synced"
)
...
@@ -1311,11 +1311,11 @@ func testOverlappingDeployment(f *framework.Framework) {
...
@@ -1311,11 +1311,11 @@ func testOverlappingDeployment(f *framework.Framework) {
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
// Wait for overlapping annotation updated to both deployments
// Wait for overlapping annotation updated to both deployments
By
(
"Waiting for both deployments to have overlapping annotations"
)
By
(
"Waiting for the third deployment to have the overlapping annotation"
)
err
=
framework
.
WaitForOverlappingAnnotationMatch
(
c
,
ns
,
deployOverlapping
.
Name
,
deployLater
.
Name
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
(),
"Failed to update the second deployment's overlapping annotation"
)
err
=
framework
.
WaitForOverlappingAnnotationMatch
(
c
,
ns
,
deployLater
.
Name
,
deployOverlapping
.
Name
)
err
=
framework
.
WaitForOverlappingAnnotationMatch
(
c
,
ns
,
deployLater
.
Name
,
deployOverlapping
.
Name
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
(),
"Failed to update the third deployment's overlapping annotation"
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
(),
"Failed to update the third deployment's overlapping annotation"
)
err
=
framework
.
WaitForOverlappingAnnotationMatch
(
c
,
ns
,
deployOverlapping
.
Name
,
""
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
(),
"The deployment that holds the oldest selector shouldn't have the overlapping annotation"
)
// The second deployment shouldn't be synced
// The second deployment shouldn't be synced
By
(
"Checking the second deployment is not synced"
)
By
(
"Checking the second deployment is not synced"
)
...
...
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