Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

URL overrides for bundles and EKS-D manifest for air gapped Image builder #2549

Merged
merged 2 commits into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions build/lib/eksa_releases.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ function build::eksa_releases::load_bundle_manifest() {
eksa_release_version="$eksa_release_version+build.*"
fi
local -r bundle_manifest_url=$(echo "$release_manifest" | yq e ".spec.releases[] | select(.version == \"$eksa_release_version\") .bundleManifestUrl" -)
# EKSA_BUNDLE_MANIFEST_URL is set only when image-builder CLI is running in airgapped mode.
# This will be set to a filepath that has the downloaded or pre-baked bundles file
if [ -n "$EKSA_BUNDLE_MANIFEST_URL" ]; then
vignesh-goutham marked this conversation as resolved.
Show resolved Hide resolved
bundle_manifest_url="$EKSA_BUNDLE_MANIFEST_URL"
fi
BUNDLE_MANIFEST[$bundle_manifest_key]=$(curl -s --retry 5 "$bundle_manifest_url" | yq)
fi
if $echo; then
Expand Down
20 changes: 13 additions & 7 deletions build/lib/eksd_releases.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,20 @@ function build::eksd_releases::load_release_yaml() {

function build::eksd_releases::get_release_yaml_url() {
local -r release_branch=$1
local -r release_number=$(yq e ".releases[] | select(.branch==\"${release_branch}\").number" ${REPO_ROOT}/EKSD_LATEST_RELEASES)
local -r dev=$(yq e ".releases[] | select(.branch==\"${release_branch}\").dev" ${REPO_ROOT}/EKSD_LATEST_RELEASES)
local -r yaml_path="kubernetes-${release_branch}/kubernetes-${release_branch}-eks-${release_number}.yaml"
local yaml_url="https://$PROD_DOMAIN/$yaml_path"
if [[ $dev == "true" ]]; then
yaml_url="https://$DEV_DOMAIN/$yaml_path"
# EKSD_MANIFEST_URL is set only when image-builder CLI is running in airgapped mode.
# This will be set to a filepath that has the downloaded or pre-baked eks-d manifest file
if [ -n "$EKSD_MANIFEST_URL" ]; then
echo "${EKSD_MANIFEST_URL}"
else
local -r release_number=$(yq e ".releases[] | select(.branch==\"${release_branch}\").number" ${REPO_ROOT}/EKSD_LATEST_RELEASES)
local -r dev=$(yq e ".releases[] | select(.branch==\"${release_branch}\").dev" ${REPO_ROOT}/EKSD_LATEST_RELEASES)
local -r yaml_path="kubernetes-${release_branch}/kubernetes-${release_branch}-eks-${release_number}.yaml"
local yaml_url="https://$PROD_DOMAIN/$yaml_path"
if [[ $dev == "true" ]]; then
yaml_url="https://$DEV_DOMAIN/$yaml_path"
fi
echo "$yaml_url"
fi
echo "$yaml_url"
}

function build::eksd_releases::get_release_branch() {
Expand Down