mirror of https://github.com/knative/pkg.git
WaitForServiceEndpoints doesn't take into account not found endpoint (#2576)
`Endpoints` are created asynchronously so it might not exists as soon as a sertvice is created. Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com> Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
This commit is contained in:
parent
766f70d9cb
commit
2e08ca63a9
|
|
@ -34,6 +34,7 @@ import (
|
|||
"k8s.io/apimachinery/pkg/util/wait"
|
||||
"k8s.io/client-go/kubernetes"
|
||||
k8styped "k8s.io/client-go/kubernetes/typed/core/v1"
|
||||
|
||||
"knative.dev/pkg/test/logging"
|
||||
)
|
||||
|
||||
|
|
@ -141,6 +142,9 @@ func WaitForServiceEndpoints(ctx context.Context, client kubernetes.Interface, s
|
|||
waitErr := wait.PollImmediate(interval, podTimeout, func() (bool, error) {
|
||||
var err error
|
||||
endpoints, err = endpointsService.Get(ctx, svcName, metav1.GetOptions{})
|
||||
if apierrs.IsNotFound(err) {
|
||||
return false, nil
|
||||
}
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue