@@ -30,7 +30,6 @@ import (
30
30
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
31
31
"k8s.io/apimachinery/pkg/labels"
32
32
"k8s.io/apimachinery/pkg/types"
33
- "k8s.io/apimachinery/pkg/util/sets"
34
33
"k8s.io/apimachinery/pkg/util/wait"
35
34
clientset "k8s.io/client-go/kubernetes"
36
35
podutil "k8s.io/kubernetes/pkg/api/v1/pod"
@@ -147,33 +146,6 @@ func (r ProxyResponseChecker) CheckAllResponses() (done bool, err error) {
147
146
return true , nil
148
147
}
149
148
150
- // CountRemainingPods queries the server to count number of remaining pods, and number of pods that had a missing deletion timestamp.
151
- func CountRemainingPods (c clientset.Interface , namespace string ) (int , int , error ) {
152
- // check for remaining pods
153
- pods , err := c .CoreV1 ().Pods (namespace ).List (metav1.ListOptions {})
154
- if err != nil {
155
- return 0 , 0 , err
156
- }
157
-
158
- // nothing remains!
159
- if len (pods .Items ) == 0 {
160
- return 0 , 0 , nil
161
- }
162
-
163
- // stuff remains, log about it
164
- LogPodStates (pods .Items )
165
-
166
- // check if there were any pods with missing deletion timestamp
167
- numPods := len (pods .Items )
168
- missingTimestamp := 0
169
- for _ , pod := range pods .Items {
170
- if pod .DeletionTimestamp == nil {
171
- missingTimestamp ++
172
- }
173
- }
174
- return numPods , missingTimestamp , nil
175
- }
176
-
177
149
func podRunning (c clientset.Interface , podName , namespace string ) wait.ConditionFunc {
178
150
return func () (bool , error ) {
179
151
pod , err := c .CoreV1 ().Pods (namespace ).Get (podName , metav1.GetOptions {})
@@ -321,15 +293,6 @@ func podsRunning(c clientset.Interface, pods *v1.PodList) []error {
321
293
return e
322
294
}
323
295
324
- // DumpAllPodInfo logs basic info for all pods.
325
- func DumpAllPodInfo (c clientset.Interface ) {
326
- pods , err := c .CoreV1 ().Pods ("" ).List (metav1.ListOptions {})
327
- if err != nil {
328
- e2elog .Logf ("unable to fetch pod debug info: %v" , err )
329
- }
330
- LogPodStates (pods .Items )
331
- }
332
-
333
296
// LogPodStates logs basic info of provided pods for debugging.
334
297
func LogPodStates (pods []v1.Pod ) {
335
298
// Find maximum widths for pod, node, and phase strings for column printing.
@@ -578,40 +541,3 @@ func GetPodsInNamespace(c clientset.Interface, ns string, ignoreLabels map[strin
578
541
}
579
542
return filtered , nil
580
543
}
581
-
582
- // GetPodsScheduled returns a number of currently scheduled and not scheduled Pods.
583
- func GetPodsScheduled (masterNodes sets.String , pods * v1.PodList ) (scheduledPods , notScheduledPods []v1.Pod ) {
584
- for _ , pod := range pods .Items {
585
- if ! masterNodes .Has (pod .Spec .NodeName ) {
586
- if pod .Spec .NodeName != "" {
587
- _ , scheduledCondition := podutil .GetPodCondition (& pod .Status , v1 .PodScheduled )
588
- gomega .Expect (scheduledCondition != nil ).To (gomega .Equal (true ))
589
- gomega .Expect (scheduledCondition .Status ).To (gomega .Equal (v1 .ConditionTrue ))
590
- scheduledPods = append (scheduledPods , pod )
591
- } else {
592
- _ , scheduledCondition := podutil .GetPodCondition (& pod .Status , v1 .PodScheduled )
593
- gomega .Expect (scheduledCondition != nil ).To (gomega .Equal (true ))
594
- gomega .Expect (scheduledCondition .Status ).To (gomega .Equal (v1 .ConditionFalse ))
595
- if scheduledCondition .Reason == "Unschedulable" {
596
-
597
- notScheduledPods = append (notScheduledPods , pod )
598
- }
599
- }
600
- }
601
- }
602
- return
603
- }
604
-
605
- // PatchContainerImages replaces the specified Container Registry with a custom
606
- // one provided via the KUBE_TEST_REPO_LIST env variable
607
- func PatchContainerImages (containers []v1.Container ) error {
608
- var err error
609
- for _ , c := range containers {
610
- c .Image , err = imageutils .ReplaceRegistryInImageURL (c .Image )
611
- if err != nil {
612
- return err
613
- }
614
- }
615
-
616
- return nil
617
- }
0 commit comments