Add flag --build to wwctl container copy, default false
Signed-off-by: xu yang <xyang@ciq.com>
This commit is contained in:
committed by
Jonathon Anderson
parent
6796a69c3f
commit
1f492dfed5
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user