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
1d128614
Commit
1d128614
authored
Jun 08, 2016
by
Piotr Szczesniak
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #26957 from jszczepkowski/kac-tests-cleanup
Added extra logging to cluster autoscaler e2e tests.
parents
878c8d41
95a59734
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
cluster_size_autoscaling.go
test/e2e/cluster_size_autoscaling.go
+4
-4
No files found.
test/e2e/cluster_size_autoscaling.go
View file @
1d128614
...
@@ -87,6 +87,7 @@ var _ = framework.KubeDescribe("Cluster size autoscaling [Slow]", func() {
...
@@ -87,6 +87,7 @@ var _ = framework.KubeDescribe("Cluster size autoscaling [Slow]", func() {
})
})
AfterEach
(
func
()
{
AfterEach
(
func
()
{
By
(
fmt
.
Sprintf
(
"Restoring initial size of the cluster"
))
setMigSizes
(
originalSizes
)
setMigSizes
(
originalSizes
)
framework
.
ExpectNoError
(
framework
.
WaitForClusterSize
(
c
,
nodeCount
,
scaleDownTimeout
))
framework
.
ExpectNoError
(
framework
.
WaitForClusterSize
(
c
,
nodeCount
,
scaleDownTimeout
))
})
})
...
@@ -173,11 +174,11 @@ var _ = framework.KubeDescribe("Cluster size autoscaling [Slow]", func() {
...
@@ -173,11 +174,11 @@ var _ = framework.KubeDescribe("Cluster size autoscaling [Slow]", func() {
}
}
}
}
By
(
fmt
.
Sprintf
(
"Annotating nodes of the smallest MIG: %s"
,
minMig
))
nodes
,
err
:=
GetGroupNodes
(
minMig
)
nodes
,
err
:=
GetGroupNodes
(
minMig
)
defer
removeLabels
(
nodes
)
defer
removeLabels
(
nodes
)
nodesMap
:=
map
[
string
]
struct
{}{}
nodesMap
:=
map
[
string
]
struct
{}{}
ExpectNoError
(
err
)
ExpectNoError
(
err
)
By
(
fmt
.
Sprintf
(
"Annotating nodes of the smallest MIG(%s): %v"
,
minMig
,
nodes
))
for
_
,
node
:=
range
nodes
{
for
_
,
node
:=
range
nodes
{
updateLabelsForNode
(
f
,
node
,
labels
,
nil
)
updateLabelsForNode
(
f
,
node
,
labels
,
nil
)
nodesMap
[
node
]
=
struct
{}{}
nodesMap
[
node
]
=
struct
{}{}
...
@@ -191,11 +192,10 @@ var _ = framework.KubeDescribe("Cluster size autoscaling [Slow]", func() {
...
@@ -191,11 +192,10 @@ var _ = framework.KubeDescribe("Cluster size autoscaling [Slow]", func() {
framework
.
ExpectNoError
(
WaitForClusterSizeFunc
(
f
.
Client
,
framework
.
ExpectNoError
(
WaitForClusterSizeFunc
(
f
.
Client
,
func
(
size
int
)
bool
{
return
size
>=
nodeCount
+
1
},
scaleUpTimeout
))
func
(
size
int
)
bool
{
return
size
>=
nodeCount
+
1
},
scaleUpTimeout
))
By
(
"Setting labels for new nodes"
)
newNodes
,
err
:=
GetGroupNodes
(
minMig
)
newNodes
,
err
:=
GetGroupNodes
(
minMig
)
defer
removeLabels
(
newNodes
)
defer
removeLabels
(
newNodes
)
ExpectNoError
(
err
)
ExpectNoError
(
err
)
By
(
fmt
.
Sprintf
(
"Setting labels for new nodes: %v"
,
newNodes
))
for
_
,
node
:=
range
newNodes
{
for
_
,
node
:=
range
newNodes
{
if
_
,
old
:=
nodesMap
[
node
];
!
old
{
if
_
,
old
:=
nodesMap
[
node
];
!
old
{
updateLabelsForNode
(
f
,
node
,
labels
,
nil
)
updateLabelsForNode
(
f
,
node
,
labels
,
nil
)
...
@@ -383,7 +383,6 @@ func WaitForClusterSizeFunc(c *client.Client, sizeFunc func(int) bool, timeout t
...
@@ -383,7 +383,6 @@ func WaitForClusterSizeFunc(c *client.Client, sizeFunc func(int) bool, timeout t
}
}
func
setMigSizes
(
sizes
map
[
string
]
int
)
{
func
setMigSizes
(
sizes
map
[
string
]
int
)
{
By
(
fmt
.
Sprintf
(
"Restoring initial size of the cluster"
))
for
mig
,
desiredSize
:=
range
sizes
{
for
mig
,
desiredSize
:=
range
sizes
{
currentSize
,
err
:=
GroupSize
(
mig
)
currentSize
,
err
:=
GroupSize
(
mig
)
framework
.
ExpectNoError
(
err
)
framework
.
ExpectNoError
(
err
)
...
@@ -406,4 +405,5 @@ func updateLabelsForNode(f *framework.Framework, node string, addLabels map[stri
...
@@ -406,4 +405,5 @@ func updateLabelsForNode(f *framework.Framework, node string, addLabels map[stri
}
}
_
,
err
=
f
.
Client
.
Nodes
()
.
Update
(
n
)
_
,
err
=
f
.
Client
.
Nodes
()
.
Update
(
n
)
ExpectNoError
(
err
)
ExpectNoError
(
err
)
By
(
fmt
.
Sprintf
(
"Labels successfully updated for node %s"
,
node
))
}
}
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