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
e4fc811a
Commit
e4fc811a
authored
Feb 07, 2018
by
Jun Xiang Tee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
verify no extra RS was created when re-creating a deployment
parent
0caa20c6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
2 deletions
+16
-2
deployment.go
test/e2e/apps/deployment.go
+16
-2
No files found.
test/e2e/apps/deployment.go
View file @
e4fc811a
...
...
@@ -760,11 +760,18 @@ func testDeploymentsControllerRef(f *framework.Framework) {
err
=
framework
.
WaitForDeploymentComplete
(
c
,
deploy
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
framework
.
Logf
(
"Checking its ReplicaSet has the right controllerRef"
)
framework
.
Logf
(
"Verifying Deployment %q has only one ReplicaSet"
,
deploymentName
)
rsList
:=
listDeploymentReplicaSets
(
c
,
ns
,
podLabels
)
Expect
(
len
(
rsList
.
Items
))
.
Should
(
Equal
(
1
))
framework
.
Logf
(
"Obtaining the ReplicaSet's UID"
)
orphanedRSUID
:=
rsList
.
Items
[
0
]
.
UID
framework
.
Logf
(
"Checking the ReplicaSet has the right controllerRef"
)
err
=
checkDeploymentReplicaSetsControllerRef
(
c
,
ns
,
deploy
.
UID
,
podLabels
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
framework
.
Logf
(
"Deleting Deployment %q and orphaning its ReplicaSet
s
"
,
deploymentName
)
framework
.
Logf
(
"Deleting Deployment %q and orphaning its ReplicaSet"
,
deploymentName
)
err
=
orphanDeploymentReplicaSets
(
c
,
deploy
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
...
...
@@ -783,6 +790,13 @@ func testDeploymentsControllerRef(f *framework.Framework) {
framework
.
Logf
(
"Waiting for the ReplicaSet to have the right controllerRef"
)
err
=
checkDeploymentReplicaSetsControllerRef
(
c
,
ns
,
deploy
.
UID
,
podLabels
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
framework
.
Logf
(
"Verifying no extra ReplicaSet is created (Deployment %q still has only one ReplicaSet after adoption)"
,
deploymentName
)
rsList
=
listDeploymentReplicaSets
(
c
,
ns
,
podLabels
)
Expect
(
len
(
rsList
.
Items
))
.
Should
(
Equal
(
1
))
framework
.
Logf
(
"Verifying the ReplicaSet has the same UID as the orphaned ReplicaSet"
)
Expect
(
rsList
.
Items
[
0
]
.
UID
)
.
Should
(
Equal
(
orphanedRSUID
))
}
func
checkDeploymentReplicaSetsControllerRef
(
c
clientset
.
Interface
,
ns
string
,
uid
types
.
UID
,
label
map
[
string
]
string
)
error
{
...
...
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