@@ -102,19 +102,14 @@ func verifyExpectedRcsExistAndGetExpectedPods(c *client.Client) ([]string, error
102
102
for _ , rcLabel := range rcLabels {
103
103
selector := labels.Set {"k8s-app" : rcLabel }.AsSelector ()
104
104
options := api.ListOptions {LabelSelector : selector }
105
- deploymentList , err := c .Deployments (api .NamespaceSystem ).List (options )
106
- if err != nil {
107
- return nil , err
108
- }
109
105
rcList , err := c .ReplicationControllers (api .NamespaceSystem ).List (options )
110
106
if err != nil {
111
107
return nil , err
112
108
}
113
- if ( len (rcList .Items ) + len ( deploymentList . Items ) ) != 1 {
114
- return nil , fmt .Errorf ("expected to find one replica for RC or deployment with label %s but got %d" ,
109
+ if len (rcList .Items ) != 1 {
110
+ return nil , fmt .Errorf ("expected to find one replica for RC with label %s but got %d" ,
115
111
rcLabel , len (rcList .Items ))
116
112
}
117
- // Check all the replication controllers.
118
113
for _ , rc := range rcList .Items {
119
114
selector := labels .Set (rc .Spec .Selector ).AsSelector ()
120
115
options := api.ListOptions {LabelSelector : selector }
@@ -129,21 +124,6 @@ func verifyExpectedRcsExistAndGetExpectedPods(c *client.Client) ([]string, error
129
124
expectedPods = append (expectedPods , string (pod .UID ))
130
125
}
131
126
}
132
- // Do the same for all deployments.
133
- for _ , rc := range deploymentList .Items {
134
- selector := labels .Set (rc .Spec .Selector .MatchLabels ).AsSelector ()
135
- options := api.ListOptions {LabelSelector : selector }
136
- podList , err := c .Pods (api .NamespaceSystem ).List (options )
137
- if err != nil {
138
- return nil , err
139
- }
140
- for _ , pod := range podList .Items {
141
- if pod .DeletionTimestamp != nil {
142
- continue
143
- }
144
- expectedPods = append (expectedPods , string (pod .UID ))
145
- }
146
- }
147
127
}
148
128
return expectedPods , nil
149
129
}
0 commit comments