From 3a4eb6b6f373dd30deb0c01584cb4dc05df5051a Mon Sep 17 00:00:00 2001 From: "Alexander, Michael" Date: Tue, 19 Nov 2024 14:57:31 -0500 Subject: [PATCH 1/3] 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 From 97ebfaeb29fa7aebde7a37c77561551f1bfe09f3 Mon Sep 17 00:00:00 2001 From: Mike Date: Wed, 20 Nov 2024 11:04:47 -0800 Subject: [PATCH 2/3] Update error message when manifest.yaml or image.yaml are missing Co-authored-by: Dusty Mabe --- src/cmd-init | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd-init b/src/cmd-init index e48311bea5..f523b0e59d 100755 --- a/src/cmd-init +++ b/src/cmd-init @@ -195,7 +195,7 @@ if [[ -n "${VARIANT}" ]] && [[ "${VARIANT}" != "default" ]]; then 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." + fatal "If you aren't using a custom configuration, be sure there are manifest.yaml & image.yaml files." fi mkdir -p cache From bf6511684166de6bd4e502d2e9bb021535a2d8ad Mon Sep 17 00:00:00 2001 From: "Alexander, Michael" Date: Wed, 20 Nov 2024 14:38:50 -0500 Subject: [PATCH 3/3] More accurate error message. --- src/cmd-init | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd-init b/src/cmd-init index f523b0e59d..7e1fcb9a00 100755 --- a/src/cmd-init +++ b/src/cmd-init @@ -195,7 +195,7 @@ if [[ -n "${VARIANT}" ]] && [[ "${VARIANT}" != "default" ]]; then EOF elif [[ ! -f "${manifest}" ]] || [[ ! -f "${image}" ]]; then echo 1>&2 "Could not find default manifests (${manifest} & ${image})" - fatal "If you aren't using a custom configuration, be sure there are manifest.yaml & image.yaml files." + fatal "Missing required manifest.yaml or image.yaml files." fi mkdir -p cache