Skip to content

Commit

Permalink
prevent webhook test from using stale pod from previous test
Browse files Browse the repository at this point in the history
  • Loading branch information
ayj committed Oct 18, 2019
1 parent 3bd42fe commit 22386dc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/integration/galley/webhook/webhook_test.go
Expand Up @@ -32,6 +32,7 @@ import (
"istio.io/istio/pkg/test/framework/components/environment/kube"
"istio.io/istio/pkg/test/framework/components/istio"
"istio.io/istio/pkg/test/framework/label"
tkube "istio.io/istio/pkg/test/kube"
"istio.io/istio/pkg/test/util/retry"
"istio.io/pkg/log"
)
Expand Down Expand Up @@ -147,15 +148,15 @@ func startGalleyPortForwarderOrFail(t *testing.T, env *kube.Environment, ns stri
fetchFunc := env.Accessor.NewSinglePodFetch(ns, "app=galley")
var galleyPod *v1.Pod
retry.UntilSuccessOrFail(t, func() error {
pods, err := env.Accessor.WaitUntilPodsAreReady(fetchFunc)
pods, err := fetchFunc()
if err != nil {
return err
}
if len(pods) != 1 {
return fmt.Errorf("%v pods found, waiting for only one", len(pods))
}
galleyPod = &pods[0]
return nil
return tkube.CheckPodReady(galleyPod)
}, retry.Timeout(5*time.Minute))

forwarder, err := env.Accessor.NewPortForwarder(*galleyPod, 0, 9443)
Expand Down

0 comments on commit 22386dc

Please sign in to comment.