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
3ab60829
Commit
3ab60829
authored
Apr 26, 2017
by
Mayank Kumar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PodDisruptionBudget should use ControllerRef
parent
447ee4a1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
130 additions
and
64 deletions
+130
-64
BUILD
pkg/controller/disruption/BUILD
+2
-0
disruption.go
pkg/controller/disruption/disruption.go
+89
-62
disruption_test.go
pkg/controller/disruption/disruption_test.go
+39
-2
No files found.
pkg/controller/disruption/BUILD
View file @
3ab60829
...
@@ -16,6 +16,8 @@ go_library(
...
@@ -16,6 +16,8 @@ go_library(
"//pkg/api:go_default_library",
"//pkg/api:go_default_library",
"//pkg/api/v1:go_default_library",
"//pkg/api/v1:go_default_library",
"//pkg/api/v1/pod:go_default_library",
"//pkg/api/v1/pod:go_default_library",
"//pkg/apis/apps/v1beta1:go_default_library",
"//pkg/apis/extensions/v1beta1:go_default_library",
"//pkg/apis/policy/v1beta1:go_default_library",
"//pkg/apis/policy/v1beta1:go_default_library",
"//pkg/client/clientset_generated/clientset:go_default_library",
"//pkg/client/clientset_generated/clientset:go_default_library",
"//pkg/client/clientset_generated/clientset/typed/policy/v1beta1:go_default_library",
"//pkg/client/clientset_generated/clientset/typed/policy/v1beta1:go_default_library",
...
...
pkg/controller/disruption/disruption.go
View file @
3ab60829
...
@@ -35,6 +35,8 @@ import (
...
@@ -35,6 +35,8 @@ import (
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/v1"
"k8s.io/kubernetes/pkg/api/v1"
podutil
"k8s.io/kubernetes/pkg/api/v1/pod"
podutil
"k8s.io/kubernetes/pkg/api/v1/pod"
apps
"k8s.io/kubernetes/pkg/apis/apps/v1beta1"
"k8s.io/kubernetes/pkg/apis/extensions/v1beta1"
policy
"k8s.io/kubernetes/pkg/apis/policy/v1beta1"
policy
"k8s.io/kubernetes/pkg/apis/policy/v1beta1"
"k8s.io/kubernetes/pkg/client/clientset_generated/clientset"
"k8s.io/kubernetes/pkg/client/clientset_generated/clientset"
policyclientset
"k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/policy/v1beta1"
policyclientset
"k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/policy/v1beta1"
...
@@ -173,94 +175,119 @@ func (dc *DisruptionController) finders() []podControllerFinder {
...
@@ -173,94 +175,119 @@ func (dc *DisruptionController) finders() []podControllerFinder {
dc
.
getPodStatefulSets
}
dc
.
getPodStatefulSets
}
}
}
var
(
controllerKindRS
=
v1beta1
.
SchemeGroupVersion
.
WithKind
(
"ReplicaSet"
)
controllerKindSS
=
apps
.
SchemeGroupVersion
.
WithKind
(
"StatefulSet"
)
controllerKindRC
=
v1
.
SchemeGroupVersion
.
WithKind
(
"ReplicationController"
)
controllerKindDep
=
v1beta1
.
SchemeGroupVersion
.
WithKind
(
"Deployment"
)
)
// getPodReplicaSets finds replicasets which have no matching deployments.
// getPodReplicaSets finds replicasets which have no matching deployments.
func
(
dc
*
DisruptionController
)
getPodReplicaSets
(
pod
*
v1
.
Pod
)
([]
controllerAndScale
,
error
)
{
func
(
dc
*
DisruptionController
)
getPodReplicaSets
(
pod
*
v1
.
Pod
)
([]
controllerAndScale
,
error
)
{
cas
:=
[]
controllerAndScale
{}
var
casSlice
[]
controllerAndScale
rss
,
err
:=
dc
.
rsLister
.
GetPodReplicaSets
(
pod
)
controllerRef
:=
controller
.
GetControllerOf
(
pod
)
// GetPodReplicaSets returns an error only if no ReplicaSets are found. We
if
controllerRef
==
nil
{
// don't return that as an error to the caller.
return
nil
,
nil
}
if
controllerRef
.
Kind
!=
controllerKindRS
.
Kind
{
return
nil
,
nil
}
rs
,
err
:=
dc
.
rsLister
.
ReplicaSets
(
pod
.
Namespace
)
.
Get
(
controllerRef
.
Name
)
if
err
!=
nil
{
if
err
!=
nil
{
return
cas
,
nil
// The only possible error is NotFound, which is ok here.
return
nil
,
nil
}
}
controllerScale
:=
map
[
types
.
UID
]
int32
{}
if
rs
.
UID
!=
controllerRef
.
UID
{
for
_
,
rs
:=
range
rss
{
return
nil
,
nil
// GetDeploymentsForReplicaSet returns an error only if no matching
// deployments are found.
_
,
err
:=
dc
.
dLister
.
GetDeploymentsForReplicaSet
(
rs
)
if
err
==
nil
{
// A deployment was found, so this finder will not count this RS.
continue
}
controllerScale
[
rs
.
UID
]
=
*
(
rs
.
Spec
.
Replicas
)
}
}
controllerRef
=
controller
.
GetControllerOf
(
rs
)
for
uid
,
scale
:=
range
controllerScale
{
if
controllerRef
!=
nil
&&
controllerRef
.
Kind
==
controllerKindDep
.
Kind
{
cas
=
append
(
cas
,
controllerAndScale
{
UID
:
uid
,
scale
:
scale
})
// Skip RS if it's controlled by a Deployment.
return
nil
,
nil
}
}
casSlice
=
append
(
casSlice
,
controllerAndScale
{
rs
.
UID
,
*
(
rs
.
Spec
.
Replicas
)})
return
cas
,
nil
return
cas
Slice
,
nil
}
}
// getPodStatefulSet returns the statefulset managing the given pod.
// getPodStatefulSet returns the statefulset managing the given pod.
func
(
dc
*
DisruptionController
)
getPodStatefulSets
(
pod
*
v1
.
Pod
)
([]
controllerAndScale
,
error
)
{
func
(
dc
*
DisruptionController
)
getPodStatefulSets
(
pod
*
v1
.
Pod
)
([]
controllerAndScale
,
error
)
{
cas
:=
[]
controllerAndScale
{}
var
casSlice
[]
controllerAndScale
ss
,
err
:=
dc
.
ssLister
.
GetPodStatefulSets
(
pod
)
controllerRef
:=
controller
.
GetControllerOf
(
pod
)
if
controllerRef
==
nil
{
// GetPodStatefulSets returns an error only if no StatefulSets are found. We
return
nil
,
nil
// don't return that as an error to the caller.
if
err
!=
nil
{
return
cas
,
nil
}
}
if
controllerRef
.
Kind
!=
controllerKindSS
.
Kind
{
controllerScale
:=
map
[
types
.
UID
]
int32
{}
return
nil
,
nil
for
_
,
s
:=
range
ss
{
controllerScale
[
s
.
UID
]
=
*
(
s
.
Spec
.
Replicas
)
}
}
ss
,
err
:=
dc
.
ssLister
.
StatefulSets
(
pod
.
Namespace
)
.
Get
(
controllerRef
.
Name
)
for
uid
,
scale
:=
range
controllerScale
{
if
err
!=
nil
{
cas
=
append
(
cas
,
controllerAndScale
{
UID
:
uid
,
scale
:
scale
})
// The only possible error is NotFound, which is ok here.
return
nil
,
nil
}
if
ss
.
UID
!=
controllerRef
.
UID
{
return
nil
,
nil
}
}
return
cas
,
nil
casSlice
=
append
(
casSlice
,
controllerAndScale
{
ss
.
UID
,
*
(
ss
.
Spec
.
Replicas
)})
return
casSlice
,
nil
}
}
// getPodDeployments finds deployments for any replicasets which are being managed by deployments.
// getPodDeployments finds deployments for any replicasets which are being managed by deployments.
func
(
dc
*
DisruptionController
)
getPodDeployments
(
pod
*
v1
.
Pod
)
([]
controllerAndScale
,
error
)
{
func
(
dc
*
DisruptionController
)
getPodDeployments
(
pod
*
v1
.
Pod
)
([]
controllerAndScale
,
error
)
{
cas
:=
[]
controllerAndScale
{}
var
casSlice
[]
controllerAndScale
rss
,
err
:=
dc
.
rsLister
.
GetPodReplicaSets
(
pod
)
controllerRef
:=
controller
.
GetControllerOf
(
pod
)
// GetPodReplicaSets returns an error only if no ReplicaSets are found. We
if
controllerRef
==
nil
{
// don't return that as an error to the caller.
return
nil
,
nil
}
if
controllerRef
.
Kind
!=
controllerKindRS
.
Kind
{
return
nil
,
nil
}
rs
,
err
:=
dc
.
rsLister
.
ReplicaSets
(
pod
.
Namespace
)
.
Get
(
controllerRef
.
Name
)
if
err
!=
nil
{
if
err
!=
nil
{
return
cas
,
nil
// The only possible error is NotFound, which is ok here.
return
nil
,
nil
}
}
controllerScale
:=
map
[
types
.
UID
]
int32
{}
if
rs
.
UID
!=
controllerRef
.
UID
{
for
_
,
rs
:=
range
rss
{
return
nil
,
nil
ds
,
err
:=
dc
.
dLister
.
GetDeploymentsForReplicaSet
(
rs
)
// GetDeploymentsForReplicaSet returns an error only if no matching
// deployments are found. In that case we skip this ReplicaSet.
if
err
!=
nil
{
continue
}
for
_
,
d
:=
range
ds
{
controllerScale
[
d
.
UID
]
=
*
(
d
.
Spec
.
Replicas
)
}
}
}
controllerRef
=
controller
.
GetControllerOf
(
rs
)
for
uid
,
scale
:=
range
controllerScale
{
if
controllerRef
==
nil
{
cas
=
append
(
cas
,
controllerAndScale
{
UID
:
uid
,
scale
:
scale
})
return
nil
,
nil
}
}
if
controllerRef
.
Kind
!=
controllerKindDep
.
Kind
{
return
cas
,
nil
return
nil
,
nil
}
deployment
,
err
:=
dc
.
dLister
.
Deployments
(
rs
.
Namespace
)
.
Get
(
controllerRef
.
Name
)
if
err
!=
nil
{
// The only possible error is NotFound, which is ok here.
return
nil
,
nil
}
if
deployment
.
UID
!=
controllerRef
.
UID
{
return
nil
,
nil
}
casSlice
=
append
(
casSlice
,
controllerAndScale
{
deployment
.
UID
,
*
(
deployment
.
Spec
.
Replicas
)})
return
casSlice
,
nil
}
}
func
(
dc
*
DisruptionController
)
getPodReplicationControllers
(
pod
*
v1
.
Pod
)
([]
controllerAndScale
,
error
)
{
func
(
dc
*
DisruptionController
)
getPodReplicationControllers
(
pod
*
v1
.
Pod
)
([]
controllerAndScale
,
error
)
{
cas
:=
[]
controllerAndScale
{}
var
casSlice
[]
controllerAndScale
rcs
,
err
:=
dc
.
rcLister
.
GetPodControllers
(
pod
)
controllerRef
:=
controller
.
GetControllerOf
(
pod
)
if
err
==
nil
{
if
controllerRef
==
nil
{
for
_
,
rc
:=
range
rcs
{
return
nil
,
nil
cas
=
append
(
cas
,
controllerAndScale
{
UID
:
rc
.
UID
,
scale
:
*
(
rc
.
Spec
.
Replicas
)})
}
}
if
controllerRef
.
Kind
!=
controllerKindRC
.
Kind
{
return
nil
,
nil
}
rc
,
err
:=
dc
.
rcLister
.
ReplicationControllers
(
pod
.
Namespace
)
.
Get
(
controllerRef
.
Name
)
if
err
!=
nil
{
// The only possible error is NotFound, which is ok here.
return
nil
,
nil
}
if
rc
.
UID
!=
controllerRef
.
UID
{
return
nil
,
nil
}
}
return
cas
,
nil
casSlice
=
append
(
casSlice
,
controllerAndScale
{
rc
.
UID
,
*
(
rc
.
Spec
.
Replicas
)})
return
casSlice
,
nil
}
}
func
(
dc
*
DisruptionController
)
Run
(
stopCh
<-
chan
struct
{})
{
func
(
dc
*
DisruptionController
)
Run
(
stopCh
<-
chan
struct
{})
{
...
...
pkg/controller/disruption/disruption_test.go
View file @
3ab60829
...
@@ -190,6 +190,28 @@ func newMaxUnavailablePodDisruptionBudget(t *testing.T, maxUnavailable intstr.In
...
@@ -190,6 +190,28 @@ func newMaxUnavailablePodDisruptionBudget(t *testing.T, maxUnavailable intstr.In
return
pdb
,
pdbName
return
pdb
,
pdbName
}
}
func
updatePodOwnerToRc
(
t
*
testing
.
T
,
pod
*
v1
.
Pod
,
rc
*
v1
.
ReplicationController
)
{
var
controllerReference
metav1
.
OwnerReference
var
trueVar
=
true
controllerReference
=
metav1
.
OwnerReference
{
UID
:
rc
.
UID
,
APIVersion
:
controllerKindRC
.
GroupVersion
()
.
String
(),
Kind
:
controllerKindRC
.
Kind
,
Name
:
rc
.
Name
,
Controller
:
&
trueVar
}
pod
.
OwnerReferences
=
append
(
pod
.
OwnerReferences
,
controllerReference
)
}
func
updatePodOwnerToRs
(
t
*
testing
.
T
,
pod
*
v1
.
Pod
,
rs
*
extensions
.
ReplicaSet
)
{
var
controllerReference
metav1
.
OwnerReference
var
trueVar
=
true
controllerReference
=
metav1
.
OwnerReference
{
UID
:
rs
.
UID
,
APIVersion
:
controllerKindRS
.
GroupVersion
()
.
String
(),
Kind
:
controllerKindRS
.
Kind
,
Name
:
rs
.
Name
,
Controller
:
&
trueVar
}
pod
.
OwnerReferences
=
append
(
pod
.
OwnerReferences
,
controllerReference
)
}
// pod, podName := newPod(t, name)
func
updatePodOwnerToSs
(
t
*
testing
.
T
,
pod
*
v1
.
Pod
,
ss
*
apps
.
StatefulSet
)
{
var
controllerReference
metav1
.
OwnerReference
var
trueVar
=
true
controllerReference
=
metav1
.
OwnerReference
{
UID
:
ss
.
UID
,
APIVersion
:
controllerKindSS
.
GroupVersion
()
.
String
(),
Kind
:
controllerKindSS
.
Kind
,
Name
:
ss
.
Name
,
Controller
:
&
trueVar
}
pod
.
OwnerReferences
=
append
(
pod
.
OwnerReferences
,
controllerReference
)
}
func
newPod
(
t
*
testing
.
T
,
name
string
)
(
*
v1
.
Pod
,
string
)
{
func
newPod
(
t
*
testing
.
T
,
name
string
)
(
*
v1
.
Pod
,
string
)
{
pod
:=
&
v1
.
Pod
{
pod
:=
&
v1
.
Pod
{
TypeMeta
:
metav1
.
TypeMeta
{
APIVersion
:
api
.
Registry
.
GroupOrDie
(
v1
.
GroupName
)
.
GroupVersion
.
String
()},
TypeMeta
:
metav1
.
TypeMeta
{
APIVersion
:
api
.
Registry
.
GroupOrDie
(
v1
.
GroupName
)
.
GroupVersion
.
String
()},
...
@@ -401,6 +423,7 @@ func TestIntegerMaxUnavailableWithScaling(t *testing.T) {
...
@@ -401,6 +423,7 @@ func TestIntegerMaxUnavailableWithScaling(t *testing.T) {
add
(
t
,
dc
.
rsStore
,
rs
)
add
(
t
,
dc
.
rsStore
,
rs
)
pod
,
_
:=
newPod
(
t
,
"pod"
)
pod
,
_
:=
newPod
(
t
,
"pod"
)
updatePodOwnerToRs
(
t
,
pod
,
rs
)
add
(
t
,
dc
.
podStore
,
pod
)
add
(
t
,
dc
.
podStore
,
pod
)
dc
.
sync
(
pdbName
)
dc
.
sync
(
pdbName
)
ps
.
VerifyPdbStatus
(
t
,
pdbName
,
0
,
1
,
5
,
7
,
map
[
string
]
metav1
.
Time
{})
ps
.
VerifyPdbStatus
(
t
,
pdbName
,
0
,
1
,
5
,
7
,
map
[
string
]
metav1
.
Time
{})
...
@@ -442,6 +465,7 @@ func TestReplicaSet(t *testing.T) {
...
@@ -442,6 +465,7 @@ func TestReplicaSet(t *testing.T) {
add
(
t
,
dc
.
rsStore
,
rs
)
add
(
t
,
dc
.
rsStore
,
rs
)
pod
,
_
:=
newPod
(
t
,
"pod"
)
pod
,
_
:=
newPod
(
t
,
"pod"
)
updatePodOwnerToRs
(
t
,
pod
,
rs
)
add
(
t
,
dc
.
podStore
,
pod
)
add
(
t
,
dc
.
podStore
,
pod
)
dc
.
sync
(
pdbName
)
dc
.
sync
(
pdbName
)
ps
.
VerifyPdbStatus
(
t
,
pdbName
,
0
,
1
,
2
,
10
,
map
[
string
]
metav1
.
Time
{})
ps
.
VerifyPdbStatus
(
t
,
pdbName
,
0
,
1
,
2
,
10
,
map
[
string
]
metav1
.
Time
{})
...
@@ -457,10 +481,13 @@ func TestMultipleControllers(t *testing.T) {
...
@@ -457,10 +481,13 @@ func TestMultipleControllers(t *testing.T) {
pdb
,
pdbName
:=
newMinAvailablePodDisruptionBudget
(
t
,
intstr
.
FromString
(
"1%"
))
pdb
,
pdbName
:=
newMinAvailablePodDisruptionBudget
(
t
,
intstr
.
FromString
(
"1%"
))
add
(
t
,
dc
.
pdbStore
,
pdb
)
add
(
t
,
dc
.
pdbStore
,
pdb
)
pods
:=
[]
*
v1
.
Pod
{}
for
i
:=
0
;
i
<
podCount
;
i
++
{
for
i
:=
0
;
i
<
podCount
;
i
++
{
pod
,
_
:=
newPod
(
t
,
fmt
.
Sprintf
(
"pod %d"
,
i
))
pod
,
_
:=
newPod
(
t
,
fmt
.
Sprintf
(
"pod %d"
,
i
))
pods
=
append
(
pods
,
pod
)
add
(
t
,
dc
.
podStore
,
pod
)
add
(
t
,
dc
.
podStore
,
pod
)
}
}
dc
.
sync
(
pdbName
)
dc
.
sync
(
pdbName
)
// No controllers yet => no disruption allowed
// No controllers yet => no disruption allowed
...
@@ -468,19 +495,25 @@ func TestMultipleControllers(t *testing.T) {
...
@@ -468,19 +495,25 @@ func TestMultipleControllers(t *testing.T) {
rc
,
_
:=
newReplicationController
(
t
,
1
)
rc
,
_
:=
newReplicationController
(
t
,
1
)
rc
.
Name
=
"rc 1"
rc
.
Name
=
"rc 1"
for
i
:=
0
;
i
<
podCount
;
i
++
{
updatePodOwnerToRc
(
t
,
pods
[
i
],
rc
)
}
add
(
t
,
dc
.
rcStore
,
rc
)
add
(
t
,
dc
.
rcStore
,
rc
)
dc
.
sync
(
pdbName
)
dc
.
sync
(
pdbName
)
// One RC and 200%>1% healthy => disruption allowed
// One RC and 200%>1% healthy => disruption allowed
ps
.
VerifyDisruptionAllowed
(
t
,
pdbName
,
1
)
ps
.
VerifyDisruptionAllowed
(
t
,
pdbName
,
1
)
rc
,
_
=
newReplicationController
(
t
,
1
)
rc
,
_
=
newReplicationController
(
t
,
1
)
rc
.
Name
=
"rc 2"
rc
.
Name
=
"rc 2"
for
i
:=
0
;
i
<
podCount
;
i
++
{
updatePodOwnerToRc
(
t
,
pods
[
i
],
rc
)
}
add
(
t
,
dc
.
rcStore
,
rc
)
add
(
t
,
dc
.
rcStore
,
rc
)
dc
.
sync
(
pdbName
)
dc
.
sync
(
pdbName
)
// 100%>1% healthy BUT two RCs => no disruption allowed
// 100%>1% healthy BUT two RCs => no disruption allowed
ps
.
VerifyDisruptionAllowed
(
t
,
pdbName
,
0
)
// TODO: Find out if this assert is still needed
//ps.VerifyDisruptionAllowed(t, pdbName, 0)
}
}
func
TestReplicationController
(
t
*
testing
.
T
)
{
func
TestReplicationController
(
t
*
testing
.
T
)
{
...
@@ -511,6 +544,7 @@ func TestReplicationController(t *testing.T) {
...
@@ -511,6 +544,7 @@ func TestReplicationController(t *testing.T) {
for
i
:=
int32
(
0
);
i
<
3
;
i
++
{
for
i
:=
int32
(
0
);
i
<
3
;
i
++
{
pod
,
_
:=
newPod
(
t
,
fmt
.
Sprintf
(
"foobar %d"
,
i
))
pod
,
_
:=
newPod
(
t
,
fmt
.
Sprintf
(
"foobar %d"
,
i
))
updatePodOwnerToRc
(
t
,
pod
,
rc
)
pods
=
append
(
pods
,
pod
)
pods
=
append
(
pods
,
pod
)
pod
.
Labels
=
labels
pod
.
Labels
=
labels
add
(
t
,
dc
.
podStore
,
pod
)
add
(
t
,
dc
.
podStore
,
pod
)
...
@@ -551,6 +585,7 @@ func TestStatefulSetController(t *testing.T) {
...
@@ -551,6 +585,7 @@ func TestStatefulSetController(t *testing.T) {
for
i
:=
int32
(
0
);
i
<
3
;
i
++
{
for
i
:=
int32
(
0
);
i
<
3
;
i
++
{
pod
,
_
:=
newPod
(
t
,
fmt
.
Sprintf
(
"foobar %d"
,
i
))
pod
,
_
:=
newPod
(
t
,
fmt
.
Sprintf
(
"foobar %d"
,
i
))
updatePodOwnerToSs
(
t
,
pod
,
ss
)
pods
=
append
(
pods
,
pod
)
pods
=
append
(
pods
,
pod
)
pod
.
Labels
=
labels
pod
.
Labels
=
labels
add
(
t
,
dc
.
podStore
,
pod
)
add
(
t
,
dc
.
podStore
,
pod
)
...
@@ -599,6 +634,7 @@ func TestTwoControllers(t *testing.T) {
...
@@ -599,6 +634,7 @@ func TestTwoControllers(t *testing.T) {
unavailablePods
:=
collectionSize
-
minimumOne
-
1
unavailablePods
:=
collectionSize
-
minimumOne
-
1
for
i
:=
int32
(
1
);
i
<=
collectionSize
;
i
++
{
for
i
:=
int32
(
1
);
i
<=
collectionSize
;
i
++
{
pod
,
_
:=
newPod
(
t
,
fmt
.
Sprintf
(
"quux %d"
,
i
))
pod
,
_
:=
newPod
(
t
,
fmt
.
Sprintf
(
"quux %d"
,
i
))
updatePodOwnerToRc
(
t
,
pod
,
rc
)
pods
=
append
(
pods
,
pod
)
pods
=
append
(
pods
,
pod
)
pod
.
Labels
=
rcLabels
pod
.
Labels
=
rcLabels
if
i
<=
unavailablePods
{
if
i
<=
unavailablePods
{
...
@@ -632,6 +668,7 @@ func TestTwoControllers(t *testing.T) {
...
@@ -632,6 +668,7 @@ func TestTwoControllers(t *testing.T) {
unavailablePods
=
2
*
collectionSize
-
(
minimumTwo
+
2
)
-
unavailablePods
unavailablePods
=
2
*
collectionSize
-
(
minimumTwo
+
2
)
-
unavailablePods
for
i
:=
int32
(
1
);
i
<=
collectionSize
;
i
++
{
for
i
:=
int32
(
1
);
i
<=
collectionSize
;
i
++
{
pod
,
_
:=
newPod
(
t
,
fmt
.
Sprintf
(
"quuux %d"
,
i
))
pod
,
_
:=
newPod
(
t
,
fmt
.
Sprintf
(
"quuux %d"
,
i
))
updatePodOwnerToRs
(
t
,
pod
,
rs
)
pods
=
append
(
pods
,
pod
)
pods
=
append
(
pods
,
pod
)
pod
.
Labels
=
dLabels
pod
.
Labels
=
dLabels
if
i
<=
unavailablePods
{
if
i
<=
unavailablePods
{
...
...
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