[#1012] cli: Fix messages for list commands

Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
This commit is contained in:
Airat Arifullin 2024-02-29 14:22:10 +03:00 committed by Evgenii Stratonikov
parent 93bf9acbc2
commit 6f25c790aa
2 changed files with 4 additions and 3 deletions

View file

@ -69,9 +69,10 @@ func parseTarget(cmd *cobra.Command) *control.ChainTarget {
func listRules(cmd *cobra.Command, _ []string) {
pk := key.Get(cmd)
target := parseTarget(cmd)
req := &control.ListChainLocalOverridesRequest{
Body: &control.ListChainLocalOverridesRequest_Body{
Target: parseTarget(cmd),
Target: target,
},
}
@ -91,7 +92,7 @@ func listRules(cmd *cobra.Command, _ []string) {
chains := resp.GetBody().GetChains()
if len(chains) == 0 {
cmd.Println("Local overrides are not defined for the container.")
cmd.Printf("Local overrides are not defined for the %s.\n", strings.ToLower(target.GetType().String()))
return
}

View file

@ -58,7 +58,7 @@ func listTargets(cmd *cobra.Command, _ []string) {
targets := resp.GetBody().GetTargets()
if len(targets) == 0 {
cmd.Println("Local overrides are not defined for the container.")
cmd.Println("Local overrides are not defined for any target.")
return
}