return non-zero exit code on container sub-commands

Signed-off-by: xu yang <xyang@ciq.com>
This commit is contained in:
xu yang
2024-09-25 08:50:50 +00:00
parent f73832c337
commit 94e203dd2e
8 changed files with 23 additions and 56 deletions

View File

@@ -30,8 +30,7 @@ func CobraRunE(cmd *cobra.Command, args []string) (err error) {
}
if !container.ValidName(crp.TargetName) {
wwlog.Error("Container name contains illegal characters : %s", crp.TargetName)
return
return fmt.Errorf("container name contains illegal characters : %s", crp.TargetName)
}
err = api.ContainerRename(crp)