File tree Expand file tree Collapse file tree 4 files changed +4
-5
lines changed
Expand file tree Collapse file tree 4 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -110,7 +110,6 @@ func runList(opts *Options) (err error) {
110110 req = req .Topic (opts .topic )
111111 }
112112 consumerGroupData , httpRes , err := req .Execute ()
113-
114113 if err != nil {
115114 if httpRes == nil {
116115 return err
@@ -147,7 +146,7 @@ func runList(opts *Options) (err error) {
147146 }
148147 }
149148
150- if consumerGroupData .GetCount () == 0 {
149+ if consumerGroupData .GetCount () == 0 && opts . output == "" {
151150 logger .Info (localizer .MustLocalize (& localizer.Config {
152151 MessageID : "kafka.consumerGroup.list.log.info.noConsumerGroups" ,
153152 TemplateData : map [string ]interface {}{
Original file line number Diff line number Diff line change @@ -121,7 +121,7 @@ func runList(opts *options) error {
121121 return err
122122 }
123123
124- if response .Size == 0 {
124+ if response .Size == 0 && opts . outputFormat == "" {
125125 logger .Info (localizer .MustLocalizeFromID ("kafka.common.log.info.noKafkaInstances" ))
126126 return nil
127127 }
Original file line number Diff line number Diff line change @@ -140,7 +140,7 @@ func runCmd(opts *Options) error {
140140 }
141141 }
142142
143- if topicData .GetCount () == 0 {
143+ if topicData .GetCount () == 0 && opts . output == "" {
144144 logger .Info (localizer .MustLocalize (& localizer.Config {
145145 MessageID : "kafka.topic.list.log.info.noTopics" ,
146146 TemplateData : map [string ]interface {}{
Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ func runList(opts *Options) (err error) {
105105 }
106106
107107 serviceaccounts := res .GetItems ()
108- if len (serviceaccounts ) == 0 {
108+ if len (serviceaccounts ) == 0 && opts . output == "" {
109109 logger .Info (localizer .MustLocalizeFromID ("serviceAccount.list.log.info.noneFound" ))
110110 return nil
111111 }
You can’t perform that action at this time.
0 commit comments