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
43159a48
Commit
43159a48
authored
Jan 05, 2017
by
Michail Kargakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix the overlapping e2e test for deployments
Fix the test to correctly expect the older deployment to be marked as overlapping since that has the newest selector that overlaps.
parent
5dc96b52
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
deployment.go
test/e2e/deployment.go
+8
-8
No files found.
test/e2e/deployment.go
View file @
43159a48
...
...
@@ -1194,27 +1194,27 @@ func testOverlappingDeployment(f *framework.Framework) {
podLabels
=
map
[
string
]
string
{
"name"
:
nginxImageName
}
By
(
fmt
.
Sprintf
(
"Creating deployment %q"
,
deploymentName
))
d
=
newDeployment
(
deploymentName
,
replicas
,
podLabels
,
nginxImageName
,
nginxImage
,
extensions
.
RollingUpdateDeploymentStrategyType
,
nil
)
deployLater
,
err
:=
c
.
Extensions
()
.
Deployments
(
ns
)
.
Create
(
d
)
thirdDeployment
,
err
:=
c
.
Extensions
()
.
Deployments
(
ns
)
.
Create
(
d
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
(),
"Failed creating the third deployment"
)
// Wait for it to be updated to revision 1
err
=
framework
.
WaitForDeploymentRevisionAndImage
(
c
,
ns
,
deployLater
.
Name
,
"1"
,
nginxImage
)
err
=
framework
.
WaitForDeploymentRevisionAndImage
(
c
,
ns
,
thirdDeployment
.
Name
,
"1"
,
nginxImage
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
(),
"The third deployment failed to update to revision 1"
)
// Update the second deployment's selector to make it overlap with the third deployment
By
(
fmt
.
Sprintf
(
"Updating deployment %q selector to make it overlap with existing one"
,
deployOverlapping
.
Name
))
deployOverlapping
,
err
=
framework
.
UpdateDeploymentWithRetries
(
c
,
ns
,
deployOverlapping
.
Name
,
func
(
update
*
extensions
.
Deployment
)
{
update
.
Spec
.
Selector
=
deployLater
.
Spec
.
Selector
update
.
Spec
.
Template
.
Labels
=
deployLater
.
Spec
.
Template
.
Labels
update
.
Spec
.
Selector
=
thirdDeployment
.
Spec
.
Selector
update
.
Spec
.
Template
.
Labels
=
thirdDeployment
.
Spec
.
Template
.
Labels
update
.
Spec
.
Template
.
Spec
.
Containers
[
0
]
.
Image
=
redisImage
})
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
// Wait for overlapping annotation updated to both deployments
By
(
"Waiting for the
thir
d deployment to have the overlapping annotation"
)
err
=
framework
.
WaitForOverlappingAnnotationMatch
(
c
,
ns
,
deploy
Later
.
Name
,
deployOverlapping
.
Name
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
(),
"Failed to update the
thir
d deployment's overlapping annotation"
)
err
=
framework
.
WaitForOverlappingAnnotationMatch
(
c
,
ns
,
deployOverlapping
.
Name
,
""
)
By
(
"Waiting for the
secon
d deployment to have the overlapping annotation"
)
err
=
framework
.
WaitForOverlappingAnnotationMatch
(
c
,
ns
,
deploy
Overlapping
.
Name
,
thirdDeployment
.
Name
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
(),
"Failed to update the
secon
d deployment's overlapping annotation"
)
err
=
framework
.
WaitForOverlappingAnnotationMatch
(
c
,
ns
,
thirdDeployment
.
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
...
...
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