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

fix(snapshot): fix snapshot unset bash var bug #295

Merged
merged 2 commits into from
Apr 23, 2024
Merged
Changes from all commits
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
9 changes: 3 additions & 6 deletions hack/release/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -euo pipefail

RELEASE_ACR=${RELEASE_ACR:-ksnap.azurecr.io} # will always be overridden
RELEASE_REPO_ACR=${RELEASE_REPO_ACR:-${RELEASE_ACR}/public/aks/karpenter}
RELEASE_REPO_MAR=mcr.microsoft.com/aks/karpenter
RELEASE_IMAGE_REPO_MAR=mcr.microsoft.com/aks/karpenter/controller
SNAPSHOT_ACR=${SNAPSHOT_ACR:-ksnap.azurecr.io}
SNAPSHOT_REPO_ACR=${SNAPSHOT_REPO_ACR:-${SNAPSHOT_ACR}/karpenter/snapshot}

Expand Down Expand Up @@ -39,7 +39,7 @@ Helm Chart Version ${helm_chart_version}"

authenticate "${RELEASE_ACR}"
buildAndPublish "${RELEASE_REPO_ACR}" "${version}" "${helm_chart_version}" "${commit_sha}" \
"${RELEASE_REPO_MAR}" # repo override for Helm chart
"${RELEASE_IMAGE_REPO_MAR}" # image repo override for Helm chart
}

authenticate() {
Expand Down Expand Up @@ -84,10 +84,7 @@ buildAndPublish() {
cosignOciArtifact "${version}" "${commit_sha}" "${build_date}" "${img}"
cosignOciArtifact "${version}" "${commit_sha}" "${build_date}" "${img_nap}"

final_img_repo="$img_repo"
if [[ -n "$5" ]]; then # override the repo if provided (used for MCR)
final_img_repo="${5}/controller"
fi
final_img_repo=${5:-$img_repo} # override the image repo if provided (used for MCR)

yq e -i ".controller.image.repository = \"${final_img_repo}\"" charts/karpenter/values.yaml
yq e -i ".controller.image.tag = \"${img_tag}\"" charts/karpenter/values.yaml
Expand Down