Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
skonto committed Apr 11, 2024
1 parent 8cfe652 commit 7835476
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/e2e/image_pull_error_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down Expand Up @@ -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")
}

0 comments on commit 7835476

Please sign in to comment.