@@ -169,7 +169,7 @@ func cleanupTestContextExtendedTime(cxt *context, seconds time.Duration) {
169
169
// Wait for namespace deleted.
170
170
// err = wait.Poll(100*time.Millisecond, seconds, namespaceNotExist(cxt))
171
171
// if err != nil {
172
- // fmt.Fprintf(os.Stdout , "[cleanupTestContextExtendedTime] Failure check for namespace: %s.\n", cxt.namespace)
172
+ // fmt.Fprintf(GinkgoWriter , "[cleanupTestContextExtendedTime] Failure check for namespace: %s.\n", cxt.namespace)
173
173
// }
174
174
//Expect(err).NotTo(HaveOccurred())
175
175
}
@@ -407,12 +407,12 @@ func anyPodsExist(ctx *context, awNamespace string, awName string) wait.Conditio
407
407
408
408
// First find a pod from the list that is part of the AW
409
409
if awn , found := podFromPodList .Labels ["appwrapper.mcad.ibm.com" ]; ! found || awn != awName {
410
- //DEBUG fmt.Fprintf(os.Stdout , "[anyPodsExist] Pod %s in phase: %s not part of AppWrapper: %s, labels: %#v\n",
410
+ //DEBUG fmt.Fprintf(GinkgoWriter , "[anyPodsExist] Pod %s in phase: %s not part of AppWrapper: %s, labels: %#v\n",
411
411
//DEBUG podFromPodList.Name, podFromPodList.Status.Phase, awName, podFromPodList.Labels)
412
412
continue
413
413
}
414
414
podExistsNum ++
415
- fmt .Fprintf (os . Stdout , "[anyPodsExist] Found Pod %s in phase: %s as part of AppWrapper: %s, labels: %#v\n " ,
415
+ fmt .Fprintf (GinkgoWriter , "[anyPodsExist] Found Pod %s in phase: %s as part of AppWrapper: %s, labels: %#v\n " ,
416
416
podFromPodList .Name , podFromPodList .Status .Phase , awName , podFromPodList .Labels )
417
417
}
418
418
@@ -426,7 +426,7 @@ func podPhase(ctx *context, awNamespace string, awName string, pods []*v1.Pod, p
426
426
Expect (err ).NotTo (HaveOccurred ())
427
427
428
428
if podList == nil || podList .Size () < 1 {
429
- fmt .Fprintf (os . Stdout , "[podPhase] Listing podList found for Namespace: %s/%s resulting in no podList found that could match AppWrapper with pod count: %d\n " ,
429
+ fmt .Fprintf (GinkgoWriter , "[podPhase] Listing podList found for Namespace: %s/%s resulting in no podList found that could match AppWrapper with pod count: %d\n " ,
430
430
awNamespace , awName , len (pods ))
431
431
}
432
432
@@ -436,7 +436,7 @@ func podPhase(ctx *context, awNamespace string, awName string, pods []*v1.Pod, p
436
436
437
437
// First find a pod from the list that is part of the AW
438
438
if awn , found := podFromPodList .Labels ["appwrapper.mcad.ibm.com" ]; ! found || awn != awName {
439
- fmt .Fprintf (os . Stdout , "[podPhase] Pod %s in phase: %s not part of AppWrapper: %s, labels: %#v\n " ,
439
+ fmt .Fprintf (GinkgoWriter , "[podPhase] Pod %s in phase: %s not part of AppWrapper: %s, labels: %#v\n " ,
440
440
podFromPodList .Name , podFromPodList .Status .Phase , awName , podFromPodList .Labels )
441
441
continue
442
442
}
@@ -458,8 +458,8 @@ func podPhase(ctx *context, awNamespace string, awName string, pods []*v1.Pod, p
458
458
}
459
459
460
460
}
461
- if matchToPodsFromInput == false {
462
- fmt .Fprintf (os . Stdout , "[podPhase] Pod %s in phase: %s does not match any input pods: %#v \n " ,
461
+ if ! matchToPodsFromInput {
462
+ fmt .Fprintf (GinkgoWriter , "[podPhase] Pod %s in phase: %s does not match any input pods: %#v \n " ,
463
463
podFromPodList .Name , podFromPodList .Status .Phase , inputPodIDs )
464
464
}
465
465
break
@@ -478,7 +478,7 @@ func awStatePhase(ctx *context, aw *arbv1.AppWrapper, phase []arbv1.AppWrapperSt
478
478
479
479
phaseCount := 0
480
480
if ! quite {
481
- fmt .Fprintf (os . Stdout , "[awStatePhase] AW %s found with state: %s.\n " , aw .Name , aw .Status .State )
481
+ fmt .Fprintf (GinkgoWriter , "[awStatePhase] AW %s found with state: %s.\n " , aw .Name , aw .Status .State )
482
482
}
483
483
484
484
for _ , p := range phase {
@@ -497,7 +497,7 @@ func cleanupTestObjectsPtr(context *context, appwrappersPtr *[]*arbv1.AppWrapper
497
497
498
498
func cleanupTestObjectsPtrVerbose (context * context , appwrappersPtr * []* arbv1.AppWrapper , verbose bool ) {
499
499
if appwrappersPtr == nil {
500
- fmt .Fprintf (os . Stdout , "[cleanupTestObjectsPtr] No AppWrappers to cleanup.\n " )
500
+ fmt .Fprintf (GinkgoWriter , "[cleanupTestObjectsPtr] No AppWrappers to cleanup.\n " )
501
501
} else {
502
502
cleanupTestObjects (context , * appwrappersPtr )
503
503
}
@@ -509,7 +509,7 @@ func cleanupTestObjects(context *context, appwrappers []*arbv1.AppWrapper) {
509
509
510
510
func cleanupTestObjectsVerbose (context * context , appwrappers []* arbv1.AppWrapper , verbose bool ) {
511
511
if appwrappers == nil {
512
- fmt .Fprintf (os . Stdout , "[cleanupTestObjects] No AppWrappers to cleanup.\n " )
512
+ fmt .Fprintf (GinkgoWriter , "[cleanupTestObjects] No AppWrappers to cleanup.\n " )
513
513
return
514
514
}
515
515
@@ -519,13 +519,13 @@ func cleanupTestObjectsVerbose(context *context, appwrappers []*arbv1.AppWrapper
519
519
pods := getPodsOfAppWrapper (context , aw )
520
520
awNamespace := aw .Namespace
521
521
awName := aw .Name
522
- fmt .Fprintf (os . Stdout , "[cleanupTestObjects] Deleting AW %s.\n " , aw .Name )
522
+ fmt .Fprintf (GinkgoWriter , "[cleanupTestObjects] Deleting AW %s.\n " , aw .Name )
523
523
err := deleteAppWrapper (context , aw .Name )
524
524
Expect (err ).NotTo (HaveOccurred ())
525
525
526
526
// Wait for the pods of the deleted the appwrapper to be destroyed
527
527
for _ , pod := range pods {
528
- fmt .Fprintf (os . Stdout , "[cleanupTestObjects] Awaiting pod %s/%s to be deleted for AW %s.\n " ,
528
+ fmt .Fprintf (GinkgoWriter , "[cleanupTestObjects] Awaiting pod %s/%s to be deleted for AW %s.\n " ,
529
529
pod .Namespace , pod .Name , aw .Name )
530
530
}
531
531
err = waitAWPodsDeleted (context , awNamespace , awName , pods )
@@ -536,7 +536,7 @@ func cleanupTestObjectsVerbose(context *context, appwrappers []*arbv1.AppWrapper
536
536
for _ , pod := range pods {
537
537
podExist , _ := context .kubeclient .CoreV1 ().Pods (pod .Namespace ).Get (gcontext .Background (), pod .Name , metav1.GetOptions {})
538
538
if podExist != nil {
539
- fmt .Fprintf (os . Stdout , "[cleanupTestObjects] Found pod %s/%s %s, not completedly deleted for AW %s.\n " , podExist .Namespace , podExist .Name , podExist .Status .Phase , aw .Name )
539
+ fmt .Fprintf (GinkgoWriter , "[cleanupTestObjects] Found pod %s/%s %s, not completedly deleted for AW %s.\n " , podExist .Namespace , podExist .Name , podExist .Status .Phase , aw .Name )
540
540
podsStillExisting = append (podsStillExisting , podExist )
541
541
}
542
542
}
@@ -560,31 +560,31 @@ func awPodPhase(ctx *context, aw *arbv1.AppWrapper, phase []v1.PodPhase, taskNum
560
560
Expect (err ).NotTo (HaveOccurred ())
561
561
562
562
if podList == nil || podList .Size () < 1 {
563
- fmt .Fprintf (os . Stdout , "[awPodPhase] Listing podList found for Namespace: %s resulting in no podList found that could match AppWrapper: %s \n " ,
563
+ fmt .Fprintf (GinkgoWriter , "[awPodPhase] Listing podList found for Namespace: %s resulting in no podList found that could match AppWrapper: %s \n " ,
564
564
aw .Namespace , aw .Name )
565
565
}
566
566
567
567
readyTaskNum := 0
568
568
for _ , pod := range podList .Items {
569
569
if awn , found := pod .Labels ["appwrapper.mcad.ibm.com" ]; ! found || awn != aw .Name {
570
570
if ! quite {
571
- fmt .Fprintf (os . Stdout , "[awPodPhase] Pod %s not part of AppWrapper: %s, labels: %s\n " , pod .Name , aw .Name , pod .Labels )
571
+ fmt .Fprintf (GinkgoWriter , "[awPodPhase] Pod %s not part of AppWrapper: %s, labels: %s\n " , pod .Name , aw .Name , pod .Labels )
572
572
}
573
573
continue
574
574
}
575
575
576
576
for _ , p := range phase {
577
577
if pod .Status .Phase == p {
578
578
//DEBUGif quite {
579
- //DEBUG fmt.Fprintf(os.Stdout , "[awPodPhase] Found pod %s of AppWrapper: %s, phase: %v\n", pod.Name, aw.Name, p)
579
+ //DEBUG fmt.Fprintf(GinkgoWriter , "[awPodPhase] Found pod %s of AppWrapper: %s, phase: %v\n", pod.Name, aw.Name, p)
580
580
//DEBUG}
581
581
readyTaskNum ++
582
582
break
583
583
} else {
584
584
pMsg := pod .Status .Message
585
585
if len (pMsg ) > 0 {
586
586
pReason := pod .Status .Reason
587
- fmt .Fprintf (os . Stdout , "[awPodPhase] pod: %s, phase: %s, reason: %s, message: %s\n " , pod .Name , p , pReason , pMsg )
587
+ fmt .Fprintf (GinkgoWriter , "[awPodPhase] pod: %s, phase: %s, reason: %s, message: %s\n " , pod .Name , p , pReason , pMsg )
588
588
}
589
589
containerStatuses := pod .Status .ContainerStatuses
590
590
for _ , containerStatus := range containerStatuses {
@@ -594,7 +594,7 @@ func awPodPhase(ctx *context, aw *arbv1.AppWrapper, phase []v1.PodPhase, taskNum
594
594
if len (wMsg ) > 0 {
595
595
wReason := waitingState .Reason
596
596
containerName := containerStatus .Name
597
- fmt .Fprintf (os . Stdout , "[awPodPhase] condition for pod: %s, phase: %s, container name: %s, " +
597
+ fmt .Fprintf (GinkgoWriter , "[awPodPhase] condition for pod: %s, phase: %s, container name: %s, " +
598
598
"reason: %s, message: %s\n " , pod .Name , p , containerName , wReason , wMsg )
599
599
}
600
600
}
@@ -604,7 +604,7 @@ func awPodPhase(ctx *context, aw *arbv1.AppWrapper, phase []v1.PodPhase, taskNum
604
604
}
605
605
606
606
//DEBUGif taskNum <= readyTaskNum && quite {
607
- //DEBUG fmt.Fprintf(os.Stdout , "[awPodPhase] Successfully found %v podList of AppWrapper: %s, state: %s\n", readyTaskNum, aw.Name, aw.Status.State)
607
+ //DEBUG fmt.Fprintf(GinkgoWriter , "[awPodPhase] Successfully found %v podList of AppWrapper: %s, state: %s\n", readyTaskNum, aw.Name, aw.Status.State)
608
608
//DEBUG}
609
609
610
610
return taskNum <= readyTaskNum , nil
0 commit comments