mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-06 16:06:51 +00:00
Add "PrintErrorWithCauses" cmdutil helper
This patch adds a new helper function to cmd/util/helpers.go that handles errors containing collections of causes and prints each cause in a separate newline.
This commit is contained in:
@@ -23,6 +23,7 @@ import (
|
||||
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/errors"
|
||||
kcmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util"
|
||||
"k8s.io/kubernetes/pkg/kubectl/resource"
|
||||
"k8s.io/kubernetes/pkg/runtime"
|
||||
"k8s.io/kubernetes/pkg/util/strategicpatch"
|
||||
@@ -59,6 +60,10 @@ func handlePodUpdateError(out io.Writer, err error, resource string) {
|
||||
if all && match {
|
||||
return
|
||||
}
|
||||
} else {
|
||||
if ok := kcmdutil.PrintErrorWithCauses(err, out); ok {
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user