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
7b8f9508
Commit
7b8f9508
authored
Feb 19, 2017
by
Michail Kargakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Spew replica sets in any deployment upgrade test failure
parent
1ad5cea2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
deployments.go
test/e2e/upgrades/deployments.go
+15
-0
No files found.
test/e2e/upgrades/deployments.go
View file @
7b8f9508
...
...
@@ -113,12 +113,15 @@ func (t *DeploymentUpgradeTest) Test(f *framework.Framework, done <-chan struct{
_
,
allOldRSs
,
newRS
,
err
:=
deploymentutil
.
GetAllReplicaSets
(
t
.
d
,
f
.
ClientSet
)
framework
.
ExpectNoError
(
err
)
if
newRS
==
nil
{
By
(
t
.
spewReplicaSets
(
newRS
,
allOldRSs
))
framework
.
ExpectNoError
(
fmt
.
Errorf
(
"expected a new replica set for deployment %q"
,
t
.
d
.
Name
))
}
if
newRS
.
UID
!=
t
.
newRS
.
UID
{
By
(
t
.
spewReplicaSets
(
newRS
,
allOldRSs
))
framework
.
ExpectNoError
(
fmt
.
Errorf
(
"expected new replica set:
\n
%#v
\n
got new replica set:
\n
%#v
\n
"
,
t
.
newRS
,
newRS
))
}
if
len
(
allOldRSs
)
!=
1
{
By
(
t
.
spewReplicaSets
(
newRS
,
allOldRSs
))
errString
:=
fmt
.
Sprintf
(
"expected one old replica set, got %d
\n
"
,
len
(
allOldRSs
))
for
i
:=
range
allOldRSs
{
rs
:=
allOldRSs
[
i
]
...
...
@@ -127,6 +130,7 @@ func (t *DeploymentUpgradeTest) Test(f *framework.Framework, done <-chan struct{
framework
.
ExpectNoError
(
fmt
.
Errorf
(
errString
))
}
if
allOldRSs
[
0
]
.
UID
!=
t
.
oldRS
.
UID
{
By
(
t
.
spewReplicaSets
(
newRS
,
allOldRSs
))
framework
.
ExpectNoError
(
fmt
.
Errorf
(
"expected old replica set:
\n
%#v
\n
got old replica set:
\n
%#v
\n
"
,
t
.
oldRS
,
allOldRSs
[
0
]))
}
}
...
...
@@ -135,3 +139,14 @@ func (t *DeploymentUpgradeTest) Test(f *framework.Framework, done <-chan struct{
func
(
t
*
DeploymentUpgradeTest
)
Teardown
(
f
*
framework
.
Framework
)
{
// rely on the namespace deletion to clean up everything
}
func
(
t
*
DeploymentUpgradeTest
)
spewReplicaSets
(
newRS
*
extensions
.
ReplicaSet
,
allOldRSs
[]
*
extensions
.
ReplicaSet
)
string
{
msg
:=
fmt
.
Sprintf
(
"old replica sets prior to the upgrade:
\n
%#v
\n
"
,
t
.
oldRS
)
msg
+=
fmt
.
Sprintf
(
"new replica sets prior to the upgrade:
\n
%#v
\n
"
,
t
.
newRS
)
msg
+=
fmt
.
Sprintf
(
"new replica set after the upgrade:
\n
%#v
\n
"
,
newRS
)
msg
+=
fmt
.
Sprintf
(
"old replica sets after the upgrade:
\n
"
)
for
i
:=
range
allOldRSs
{
msg
+=
fmt
.
Sprintf
(
"%#v
\n
"
,
allOldRSs
[
i
])
}
return
msg
}
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