Add flag --build to wwctl container copy, default false

Signed-off-by: xu yang <xyang@ciq.com>
This commit is contained in:
xu yang
2024-09-19 23:26:18 +00:00
committed by Jonathon Anderson
parent 6796a69c3f
commit 1f492dfed5
9 changed files with 383 additions and 324 deletions

View File

@@ -41,6 +41,13 @@ func ContainerCopy(cbp *wwapiv1.ContainerCopyParameter) (err error) {
return fmt.Errorf("could not duplicate image: %s", err.Error())
}
if cbp.Build {
err = container.Build(cbp.ContainerDestination, true)
if err != nil {
return err
}
}
return fmt.Errorf("Container %s has been succesfully duplicated as %s", cbp.ContainerSource, cbp.ContainerDestination)
}