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
b285e27f
Commit
b285e27f
authored
Mar 24, 2017
by
Maciej Pytel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix flaky cluster-autoscaler e2e
parent
13e2f5d9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
4 deletions
+19
-4
cluster_size_autoscaling.go
test/e2e/cluster_size_autoscaling.go
+19
-4
No files found.
test/e2e/cluster_size_autoscaling.go
View file @
b285e27f
...
...
@@ -26,6 +26,7 @@ import (
"strings"
"time"
"k8s.io/apimachinery/pkg/api/errors"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/fields"
"k8s.io/apimachinery/pkg/util/intstr"
...
...
@@ -740,11 +741,25 @@ func runReplicatedPodOnEachNode(f *framework.Framework, nodes []v1.Node, id stri
if
err
!=
nil
{
return
err
}
*
rc
.
Spec
.
Replicas
=
int32
(
i
+
1
)
rc
,
err
=
f
.
ClientSet
.
Core
()
.
ReplicationControllers
(
f
.
Namespace
.
Name
)
.
Update
(
rc
)
if
err
!=
nil
{
return
err
// Update replicas count, to create new pods that will be allocated on node
// (we retry 409 errors in case rc reference got out of sync)
for
j
:=
0
;
j
<
3
;
j
++
{
*
rc
.
Spec
.
Replicas
=
int32
(
i
+
1
)
rc
,
err
=
f
.
ClientSet
.
Core
()
.
ReplicationControllers
(
f
.
Namespace
.
Name
)
.
Update
(
rc
)
if
err
==
nil
{
break
}
if
!
errors
.
IsConflict
(
err
)
{
return
err
}
glog
.
Warningf
(
"Got 409 conflict when trying to scale RC, retries left: %v"
,
3
-
j
)
rc
,
err
=
f
.
ClientSet
.
Core
()
.
ReplicationControllers
(
f
.
Namespace
.
Name
)
.
Get
(
id
,
metav1
.
GetOptions
{})
if
err
!=
nil
{
return
err
}
}
err
=
wait
.
PollImmediate
(
5
*
time
.
Second
,
podTimeout
,
func
()
(
bool
,
error
)
{
rc
,
err
=
f
.
ClientSet
.
Core
()
.
ReplicationControllers
(
f
.
Namespace
.
Name
)
.
Get
(
id
,
metav1
.
GetOptions
{})
if
err
!=
nil
||
rc
.
Status
.
ReadyReplicas
<
int32
(
i
+
1
)
{
...
...
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