From 7835476aaf99aa1337c8a616a78227980223d609 Mon Sep 17 00:00:00 2001 From: Stavros Kontopoulos Date: Thu, 1 Feb 2024 16:43:29 +0200 Subject: [PATCH] fix test --- test/e2e/image_pull_error_test.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/e2e/image_pull_error_test.go b/test/e2e/image_pull_error_test.go index 021300308735..1c00e9bb3f08 100644 --- a/test/e2e/image_pull_error_test.go +++ b/test/e2e/image_pull_error_test.go @@ -53,7 +53,7 @@ func TestImagePullError(t *testing.T) { cond := r.Status.GetCondition(v1.ConfigurationConditionReady) if cond != nil && !cond.IsUnknown() { if cond.IsFalse() { - if cond.Reason == wantCfgReason && (strings.Contains(cond.Message, "Back-off pulling image") || strings.Contains(cond.Message, "manifest unknown")) { + if cond.Reason == wantCfgReason && hasPullErrorMsg(cond.Message) { return true, nil } } @@ -90,3 +90,8 @@ func createLatestConfig(t *testing.T, clients *test.Clients, names test.Resource c.Spec = *v1test.ConfigurationSpec(names.Image) }) } + +func hasPullErrorMsg(msg string) bool { + return strings.Contains(msg, "Back-off pulling image") || + strings.Contains(msg, "manifest unknown") || strings.Contains(msg, "failed to pull and unpack image") +}