From ca4ba8afda8c246221dfc0495e9e697b0f992d46 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Wed, 26 May 2021 15:42:32 -0700 Subject: [PATCH] pkg/payload/task: Handle MultipleErrors in SummaryForReason The MultipleErrors reason landed in c2ac20fa17 (status: Report the operators that have not yet deployed, 2019-04-09, #158), but for some reason was left out of SummaryForReason. I'm adding it in this commit to get something more useful than: $ oc adm upgrade info: An upgrade is in progress. Unable to apply 4.8.0-0.ci-2021-05-26-172803: an unknown error has occurred: MultipleErrors when the Failing=True message is: Multiple errors are preventing progress: * Cluster operator machine-api is updating versions * Cluster operator openshift-apiserver is updating versions I'm not entirely clear on why these didn't fallback to the "unknown error" strings at the bottom of SummaryForReason, but they don't seem to have done so. --- pkg/payload/task.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/payload/task.go b/pkg/payload/task.go index 91bc3110a..4a811218c 100644 --- a/pkg/payload/task.go +++ b/pkg/payload/task.go @@ -264,6 +264,11 @@ func SummaryForReason(reason, name string) string { return fmt.Sprintf("the workload %s cannot roll out", name) } return "a workload cannot roll out" + case "MultipleErrors": + if len(name) > 0 { + return fmt.Sprintf("the workload %s cannot roll out", name) + } + return "multiple errors reconciling the payload" } if strings.HasPrefix(reason, "UpdatePayload") {