test/integration/apiserver/cel: update createAndWaitReady to retry on error including 'not yet synced to use for admission'

Signed-off-by: Andrew Sy Kim <andrewsy@google.com>
This commit is contained in:
Andrew Sy Kim 2022-11-14 22:27:16 -05:00
parent 7127f565f6
commit 34a2d265d7

View File

@ -1933,6 +1933,9 @@ func createAndWaitReady(t *testing.T, client *clientset.Clientset, binding *admi
_, err := client.CoreV1().Endpoints("default").Patch(context.TODO(), marker.Name, types.JSONPatchType, []byte("[]"), metav1.PatchOptions{})
if err != nil && strings.Contains(err.Error(), "marker denied; policy is ready") {
return true, nil
} else if err != nil && strings.Contains(err.Error(), "not yet synced to use for admission") {
t.Logf("waiting for policy to be ready. Marker: %v. Admission not synced yet: %v", marker, err)
return false, nil
} else {
t.Logf("waiting for policy to be ready. Marker: %v, Last marker patch response: %v", marker, err)
return false, err