From 3a4eb6b6f373dd30deb0c01584cb4dc05df5051a Mon Sep 17 00:00:00 2001 From: "Alexander, Michael" Date: Tue, 19 Nov 2024 14:57:31 -0500 Subject: [PATCH] Delay check on default manifest and image files until we know they're being used. The default manifest.yaml and image.yaml were checked to confirm they exist before it was even known whether they were the right files to use or not. Move the check to occur after we know we're not using a VARIANT that points to different files. --- src/cmd-init | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/cmd-init b/src/cmd-init index 38a6804920..e48311bea5 100755 --- a/src/cmd-init +++ b/src/cmd-init @@ -179,10 +179,6 @@ mkdir -p src # Default paths for manifest.yaml & image.yaml manifest="src/config/manifest.yaml" image="src/config/image.yaml" -if [[ ! -f "${manifest}" ]] || [[ ! -f "${image}" ]]; then - echo 1>&2 "Could not find default manifests (${manifest} & ${image})" - fatal "If you are using a custom configuration, be sure it has a manifest.yaml & image.yaml." -fi # Select the variant if requested if [[ -n "${VARIANT}" ]] && [[ "${VARIANT}" != "default" ]]; then @@ -197,6 +193,9 @@ if [[ -n "${VARIANT}" ]] && [[ "${VARIANT}" != "default" ]]; then "coreos-assembler.config-variant": "${VARIANT}" } EOF +elif [[ ! -f "${manifest}" ]] || [[ ! -f "${image}" ]]; then + echo 1>&2 "Could not find default manifests (${manifest} & ${image})" + fatal "If you are using a custom configuration, be sure it has a manifest.yaml & image.yaml." fi mkdir -p cache