From 930cd155ad03ec8000046744e433e0d799076c80 Mon Sep 17 00:00:00 2001 From: Klaus Ma Date: Wed, 19 Oct 2016 20:40:11 +0800 Subject: [PATCH] Did not print 'No resources found.' if error. --- pkg/kubectl/cmd/get.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/kubectl/cmd/get.go b/pkg/kubectl/cmd/get.go index bca0f8ecb34..5b66d9a37de 100644 --- a/pkg/kubectl/cmd/get.go +++ b/pkg/kubectl/cmd/get.go @@ -323,7 +323,7 @@ func RunGet(f cmdutil.Factory, out, errOut io.Writer, cmd *cobra.Command, args [ } errs = append(errs, err) } - if len(infos) == 0 { + if len(infos) == 0 && len(errs) == 0 { outputEmptyListWarning(errOut) } @@ -375,7 +375,7 @@ func RunGet(f cmdutil.Factory, out, errOut io.Writer, cmd *cobra.Command, args [ if err != nil { allErrs = append(allErrs, err) } - if len(infos) == 0 { + if len(infos) == 0 && len(allErrs) == 0 { outputEmptyListWarning(errOut) }