Merge pull request #29500 from lixiaobing10051267/masterFound

Automatic merge from submit-queue

Check all places to break the loop when object found

Check all places to break the loop when object found.
This commit is contained in:
Kubernetes Submit Queue 2016-08-03 20:05:15 -07:00 committed by GitHub
commit c2614aee9a
5 changed files with 5 additions and 0 deletions

View File

@ -389,6 +389,7 @@ func rulesMatch(expectedRules, actualRules []rbac.PolicyRule) bool {
for _, actualRule := range actualRules {
if reflect.DeepEqual(expectedRule, actualRule) {
found = true
break
}
}

View File

@ -350,6 +350,7 @@ func (t *tracker) Delete(gvk unversioned.GroupVersionKind, ns, name string) erro
if objMeta.GetNamespace() == ns && objMeta.GetName() == name {
t.objects[gvk] = append(t.objects[gvk][:i], t.objects[gvk][i+1:]...)
found = true
break
}
}

View File

@ -219,6 +219,7 @@ func TestPetSetControllerBlocksScaling(t *testing.T) {
for _, p := range fc.getPodList() {
if p.Name == deletedPod.Name {
found = true
break
}
}
if !found {

View File

@ -445,6 +445,7 @@ func TestDirectoryBuilder(t *testing.T) {
for _, info := range test.Infos {
if info.Name == "redis-master" && info.Namespace == "test" && info.Object != nil {
found = true
break
}
}
if !found {

View File

@ -624,6 +624,7 @@ func TestSyncPodCreateNetAndContainer(t *testing.T) {
for _, c := range fakeDocker.RunningContainerList {
if c.Image == "pod_infra_image" && strings.HasPrefix(c.Names[0], "/k8s_POD") {
found = true
break
}
}
if !found {