e2e: Add container statuses while waiting for OAuth server
@@ -12,6 +12,7 @@ import (
"time"
"github.com/RangelReale/osincli"
+ "github.com/davecgh/go-spew/spew"
corev1 "k8s.io/api/core/v1"
rbacv1 "k8s.io/api/rbac/v1"
@@ -203,13 +204,14 @@ func waitForOAuthServerReady(oc *exutil.CLI) error {
}
func waitForOAuthServerPodReady(oc *exutil.CLI) error {
- return wait.PollImmediate(1*time.Second, time.Minute, func() (bool, error) {
e2e.Logf("Waiting for the OAuth server pod to be ready")
+ return wait.PollImmediate(1*time.Second, time.Minute, func() (bool, error) {
pod, err := oc.AdminKubeClient().CoreV1().Pods(oc.Namespace()).Get("test-oauth-server", metav1.GetOptions{})
if err != nil {
return false, err
}
if !exutil.CheckPodIsReady(*pod) {
+ e2e.Logf("OAuth server pod is not ready: %s\nContainer statuses: %s", pod.Status.Message, spew.Sdump(pod.Status.ContainerStatuses))
return false, nil
}
return true, nil
