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
f3ba27a5
Unverified
Commit
f3ba27a5
authored
Mar 19, 2018
by
Anthony Yeh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ReplicaSet: Use apps/v1 RS in integration test.
parent
b2783603
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
2 deletions
+18
-2
util.go
test/integration/deployment/util.go
+1
-1
replicaset_test.go
test/integration/replicaset/replicaset_test.go
+0
-0
replicaset.go
test/utils/replicaset.go
+17
-1
No files found.
test/integration/deployment/util.go
View file @
f3ba27a5
...
...
@@ -418,7 +418,7 @@ func (d *deploymentTester) listUpdatedPods() ([]v1.Pod, error) {
}
func
(
d
*
deploymentTester
)
waitRSStable
(
replicaset
*
v1beta1
.
ReplicaSet
)
error
{
return
testutil
.
WaitRSStable
(
d
.
t
,
d
.
c
,
replicaset
,
pollInterval
,
pollTimeout
)
return
testutil
.
Wait
Extensions
RSStable
(
d
.
t
,
d
.
c
,
replicaset
,
pollInterval
,
pollTimeout
)
}
func
(
d
*
deploymentTester
)
scaleDeployment
(
newReplicas
int32
)
error
{
...
...
test/integration/replicaset/replicaset_test.go
View file @
f3ba27a5
This diff is collapsed.
Click to expand it.
test/utils/replicaset.go
View file @
f3ba27a5
...
...
@@ -81,7 +81,22 @@ func UpdateExtensionsReplicaSetWithRetries(c clientset.Interface, namespace, nam
}
// Verify .Status.Replicas is equal to .Spec.Replicas
func
WaitRSStable
(
t
*
testing
.
T
,
clientSet
clientset
.
Interface
,
rs
*
extensions
.
ReplicaSet
,
pollInterval
,
pollTimeout
time
.
Duration
)
error
{
func
WaitRSStable
(
t
*
testing
.
T
,
clientSet
clientset
.
Interface
,
rs
*
apps
.
ReplicaSet
,
pollInterval
,
pollTimeout
time
.
Duration
)
error
{
desiredGeneration
:=
rs
.
Generation
if
err
:=
wait
.
PollImmediate
(
pollInterval
,
pollTimeout
,
func
()
(
bool
,
error
)
{
newRS
,
err
:=
clientSet
.
AppsV1
()
.
ReplicaSets
(
rs
.
Namespace
)
.
Get
(
rs
.
Name
,
metav1
.
GetOptions
{})
if
err
!=
nil
{
return
false
,
err
}
return
newRS
.
Status
.
ObservedGeneration
>=
desiredGeneration
&&
newRS
.
Status
.
Replicas
==
*
rs
.
Spec
.
Replicas
,
nil
});
err
!=
nil
{
return
fmt
.
Errorf
(
"failed to verify .Status.Replicas is equal to .Spec.Replicas for replicaset %q: %v"
,
rs
.
Name
,
err
)
}
return
nil
}
// TODO(#55714): Remove after Deployment tests use apps/v1 ReplicaSet.
func
WaitExtensionsRSStable
(
t
*
testing
.
T
,
clientSet
clientset
.
Interface
,
rs
*
extensions
.
ReplicaSet
,
pollInterval
,
pollTimeout
time
.
Duration
)
error
{
desiredGeneration
:=
rs
.
Generation
if
err
:=
wait
.
PollImmediate
(
pollInterval
,
pollTimeout
,
func
()
(
bool
,
error
)
{
newRS
,
err
:=
clientSet
.
ExtensionsV1beta1
()
.
ReplicaSets
(
rs
.
Namespace
)
.
Get
(
rs
.
Name
,
metav1
.
GetOptions
{})
...
...
@@ -95,6 +110,7 @@ func WaitRSStable(t *testing.T, clientSet clientset.Interface, rs *extensions.Re
return
nil
}
// TODO(#55714): Remove after Deployment tests use apps/v1 ReplicaSet.
func
UpdateExtensionsReplicaSetStatusWithRetries
(
c
clientset
.
Interface
,
namespace
,
name
string
,
applyUpdate
UpdateExtensionsReplicaSetFunc
,
logf
LogfFn
,
pollInterval
,
pollTimeout
time
.
Duration
)
(
*
extensions
.
ReplicaSet
,
error
)
{
var
rs
*
extensions
.
ReplicaSet
var
updateErr
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