Remove built images when renaming a container
Renaming a container causes its images to be abandoned in the previous name. This causes those images to be removed after a successful rename. New images can be rebuilt during the rename using the `--build` argument. Signed-off-by: Jonathon Anderson <janderson@ciq.com>
This commit is contained in:
@@ -413,6 +413,11 @@ func ContainerRename(crp *wwapiv1.ContainerRenameParameter) (err error) {
|
||||
return err
|
||||
}
|
||||
|
||||
err = container.DeleteImage(crp.ContainerName)
|
||||
if err != nil {
|
||||
wwlog.Warn("Could not remove image files for %s: %w", crp.ContainerName, err)
|
||||
}
|
||||
|
||||
if crp.Build {
|
||||
err = container.Build(crp.TargetName, true)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user