From 397013637766773644eb0154d2685b931920126a Mon Sep 17 00:00:00 2001 From: jichenjc Date: Wed, 8 Jun 2022 08:08:49 +0000 Subject: [PATCH] show not exist when disable not-found addon Signed-off-by: jichenjc --- pkg/cmd/addon/disable/exec.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/cmd/addon/disable/exec.go b/pkg/cmd/addon/disable/exec.go index c4a84639a..22aa2ee9c 100644 --- a/pkg/cmd/addon/disable/exec.go +++ b/pkg/cmd/addon/disable/exec.go @@ -108,9 +108,12 @@ func (o *Options) runWithClient(clusterClient clusterclientset.Interface, if err != nil { if !errors.IsNotFound(err) { return err + } else { + fmt.Fprintf(o.Streams.Out, "%s add-on not found in cluster: %s.\n", addon, clusterName) } + } else { + fmt.Fprintf(o.Streams.Out, "Undeploying %s add-on in managed cluster: %s.\n", addon, clusterName) } - fmt.Fprintf(o.Streams.Out, "Undeploying %s add-on in managed cluster: %s.\n", addon, clusterName) } }