Don't create an ironic-agent image just to delete it
The ironic-agent element doesn't care about the final qcow2/raw/ whatever image the disk-image-create command normally creates, so previously it was deleting it at the end of the process. This is a pretty significant waste of time when building those images, and instead we can just skip creating the image when building ironic-agent. Change-Id: If48f575e795a823c777891f193ebf8bd943aa296
This commit is contained in:
parent
4e5dcdd9cf
commit
88bf264fbb
@ -450,8 +450,10 @@ for X in ${!IMAGE_TYPES[@]} ; do
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# Prep filesystem by discarding all unused space
|
if [[ ! $IMAGE_ELEMENT =~ ironic-agent ]]; then
|
||||||
fstrim_image
|
# Prep filesystem by discarding all unused space
|
||||||
|
fstrim_image
|
||||||
|
fi
|
||||||
|
|
||||||
# Unmount and cleanup the /mnt and /build subdirectories, to save
|
# Unmount and cleanup the /mnt and /build subdirectories, to save
|
||||||
# space before converting the image to some other format.
|
# space before converting the image to some other format.
|
||||||
@ -459,7 +461,7 @@ unmount_image
|
|||||||
cleanup_build_dir
|
cleanup_build_dir
|
||||||
|
|
||||||
has_raw_type=
|
has_raw_type=
|
||||||
if [ "$IS_RAMDISK" == "0" ]; then
|
if [[ ! $IMAGE_ELEMENT =~ ironic-agent && "$IS_RAMDISK" == "0" ]]; then
|
||||||
for IMAGE_TYPE in ${IMAGE_TYPES[@]} ; do
|
for IMAGE_TYPE in ${IMAGE_TYPES[@]} ; do
|
||||||
# We have to do raw last because it is destructive
|
# We have to do raw last because it is destructive
|
||||||
if [ "$IMAGE_TYPE" = "raw" ]; then
|
if [ "$IMAGE_TYPE" = "raw" ]; then
|
||||||
@ -477,11 +479,5 @@ fi
|
|||||||
# Remove the leftovers, i.e. the temporary image directory.
|
# Remove the leftovers, i.e. the temporary image directory.
|
||||||
cleanup_image_dir
|
cleanup_image_dir
|
||||||
|
|
||||||
case "$IMAGE_ELEMENT" in
|
|
||||||
*ironic-agent*)
|
|
||||||
rm $IMAGE_NAME.$IMAGE_TYPE
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# All done!
|
# All done!
|
||||||
trap EXIT
|
trap EXIT
|
||||||
|
Loading…
Reference in New Issue
Block a user