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

Longw/signing payload drop #1246

Merged
merged 8 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 12 additions & 0 deletions .trivyignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,15 @@ CVE-2023-5678
CVE-2023-48795
CVE-2024-24786
CVE-2023-45288
CVE-2023-45283
CVE-2023-29406
CVE-2023-29409
CVE-2023-39318
CVE-2023-39319
CVE-2023-39326
CVE-2023-45284
CVE-2023-45289
CVE-2023-45290
CVE-2024-24783
CVE-2024-24784
CVE-2024-24785
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ if [ $? -ne 0 ]; then
fi

TAG_EXISTS_STATUS=0 #Default value for the condition when the echo fails below
AZ_ACR_IMPORT_FORCE=""

if [[ "$AGENT_IMAGE_FULL_PATH" == *"win-"* ]]; then
echo "checking windows tags"
Expand All @@ -35,7 +34,6 @@ echo "TAG_EXISTS_STATUS = $TAG_EXISTS_STATUS; OVERRIDE_TAG = $OVERRIDE_TAG"

if [[ "$OVERRIDE_TAG" == "true" ]]; then
echo "OverrideTag set to true. Will override ${AGENT_IMAGE_TAG_SUFFIX} image"
AZ_ACR_IMPORT_FORCE="--force"
wanlonghenry marked this conversation as resolved.
Show resolved Hide resolved
elif [ "$TAG_EXISTS_STATUS" -eq 0 ]; then
echo "-e error ${AGENT_IMAGE_TAG_SUFFIX} already exists in mcr. make sure the image tag is unique"
exit 1
Expand Down Expand Up @@ -66,17 +64,27 @@ fi
echo "Login cli using managed identity"
az login --identity
if [ $? -eq 0 ]; then
echo "Logged in successfully"
echo "az logged in successfully"
else
echo "-e error failed to login to az with managed identity credentials"
exit 1
fi
fi

echo "Pushing ${AGENT_IMAGE_FULL_PATH} to ${ACR_NAME} with force option set to ${AZ_ACR_IMPORT_FORCE}"
az acr import --name $ACR_NAME --source $SOURCE_IMAGE_FULL_PATH --image $AGENT_IMAGE_FULL_PATH $AZ_ACR_IMPORT_FORCE
az acr login -n containerinsights
wanlonghenry marked this conversation as resolved.
Show resolved Hide resolved
if [ $? -eq 0 ]; then
echo "Retagged and pushed image successfully"
echo "az acr logged in successfully"
else
echo "-e error failed to retag and push image to destination ACR"
echo "-e error failed to login to az acr with managed identity credentials for containerinsights"
exit 1
fi

if [ "$OVERRIDE_TAG" == "true" ] || [ "$TAG_EXISTS_STATUS" -ne 0 ]; then
echo "Copying ${SOURCE_IMAGE_FULL_PATH} to ${ACR_NAME}/${AGENT_IMAGE_FULL_PATH}"
oras copy -r $SOURCE_IMAGE_FULL_PATH $ACR_NAME/$AGENT_IMAGE_FULL_PATH
if [ $? -eq 0 ]; then
echo "Retagged and pushed image and artifact successfully"
else
echo "-e error failed to retag and push image to destination ACR"
exit 1
fi
fi
wanlonghenry marked this conversation as resolved.
Show resolved Hide resolved