Skip to content

Commit b0782e4

Browse files
Add sanity check to verify ISO is correct
Issue: ZENKO-5188
1 parent d3af3fd commit b0782e4

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

solution/build.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,28 @@ function dedupe()
267267
${HARDLINK} -c ${IMAGES_ROOT}
268268
}
269269

270+
function validate_registry()
271+
{
272+
echo "Validating ISO registry completeness against zenkoversion.yaml..."
273+
local missing=0
274+
275+
while IFS= read -r image_ref ; do
276+
local image="${image_ref%:*}"
277+
local tag="${image_ref##*:}"
278+
local manifest="${IMAGES_ROOT}/${image}/${tag}/manifest.json"
279+
if [ ! -f "${manifest}" ] ; then
280+
echo "::error::Missing image in ISO registry: ${image}:${tag}"
281+
missing=$((missing + 1))
282+
fi
283+
done < <(yq eval '.. | select(has("image") and has("tag")) | .image + ":" + .tag' ${ISO_ROOT}/zenkoversion.yaml | sort -u)
284+
285+
if [ ${missing} -gt 0 ] ; then
286+
echo "::error::${missing} image(s) referenced in zenkoversion.yaml are missing from the ISO registry. Aborting."
287+
exit 1
288+
fi
289+
echo "Registry validation passed: all images are present."
290+
}
291+
270292
function build_registry_config()
271293
{
272294
docker run \
@@ -354,6 +376,7 @@ done
354376
get_dashboards
355377
copy_iam_policies
356378
copy_config
379+
validate_registry
357380
dedupe
358381
build_registry_config
359382
build_iso

0 commit comments

Comments
 (0)