[#XX] cli: Fix bug with name option for container list command
All checks were successful
ci/woodpecker/pr/pre-commit Pipeline was successful

Signed-off-by: Airat Arifullin a.arifullin@yadro.com
This commit is contained in:
Airat Arifullin 2023-06-26 17:19:33 +03:00
parent 344d6b2ae1
commit ea5002d20b

View file

@ -70,7 +70,7 @@ var listContainersCmd = &cobra.Command{
} }
cnr := res.Container() cnr := res.Container()
if cnrName := containerSDK.Name(cnr); flagVarListName != "" && cnrName != flagVarListName { if cnrName := containerSDK.Name(cnr); flagVarListName != "" && !strings.Contains(cnrName, flagVarListName) {
continue continue
} }
cmd.Println(cnrID.String()) cmd.Println(cnrID.String())
@ -93,7 +93,7 @@ func initContainerListContainersCmd() {
flags := listContainersCmd.Flags() flags := listContainersCmd.Flags()
flags.StringVar(&flagVarListName, flagListName, "", flags.StringVar(&flagVarListName, flagListName, "",
"List containers by the attribute name", "List containers by the attribute name or by its part",
) )
flags.StringVar(&flagVarListContainerOwner, flagListContainerOwner, "", flags.StringVar(&flagVarListContainerOwner, flagListContainerOwner, "",
"Owner of containers (omit to use owner from private key)", "Owner of containers (omit to use owner from private key)",