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

cherry-pick: fix vhd name env variable #5288

Merged
merged 12 commits into from
Jan 14, 2025
Merged
1 change: 1 addition & 0 deletions .pipelines/templates/.builder-release-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ steps:
SYSTEM_COLLECTIONURI: $(System.CollectionUri)
SYSTEM_TEAMPROJECT: $(System.TeamProject)
BUILD_RUN_NUMBER: $(Build.BuildNumber)
VHD_ARTIFACT_NAME: ${{ parameters.artifactName }}

- task: PublishPipelineArtifact@0
condition: always()
Expand Down
1 change: 1 addition & 0 deletions vhdbuilder/packer/test-scan-and-cleanup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ required_env_vars=(
"AZURE_MSI_RESOURCE_STRING"
"UMSI_CLIENT_ID"
"BUILD_RUN_NUMBER"
"VHD_ARTIFACT_NAME"
)

for v in "${required_env_vars[@]}"; do
Expand Down
6 changes: 3 additions & 3 deletions vhdbuilder/packer/trivy-scan.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ ARCHITECTURE=${4}
SIG_CONTAINER_NAME=${5}
STORAGE_ACCOUNT_NAME=${6}
ENABLE_TRUSTED_LAUNCH=${7}
VHD_NAME=${8}
VHD_ARTIFACT_NAME=${8}
SKU_NAME=${9}
KUSTO_ENDPOINT=${10}
KUSTO_DATABASE=${11}
Expand Down Expand Up @@ -144,7 +144,7 @@ retrycmd_if_failure 10 30 600 ./trivy --scanners vuln rootfs -f json --db-reposi
if [[ -f ${TRIVY_REPORT_ROOTFS_JSON_PATH} ]]; then
./vuln-to-kusto-vhd scan-report \
--vhd-buildrunnumber=${BUILD_RUN_NUMBER} \
--vhd-vhdname="${VHD_NAME}" \
--vhd-vhdname="${VHD_ARTIFACT_NAME}" \
--vhd-ossku="${OS_SKU}" \
--vhd-osversion="${OS_VERSION}" \
--vhd-skuname="${SKU_NAME}" \
Expand Down Expand Up @@ -172,7 +172,7 @@ for CONTAINER_IMAGE in $IMAGE_LIST; do
if [[ -f ${TRIVY_REPORT_IMAGE_JSON_PATH} ]]; then
./vuln-to-kusto-vhd scan-report \
--vhd-buildrunnumber=${BUILD_RUN_NUMBER} \
--vhd-vhdname="${VHD_NAME}" \
--vhd-vhdname="${VHD_ARTIFACT_NAME}" \
--vhd-ossku="${OS_SKU}" \
--vhd-osversion="${OS_VERSION}" \
--vhd-skuname="${SKU_NAME}" \
Expand Down
2 changes: 1 addition & 1 deletion vhdbuilder/packer/vhd-scanning.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ az vm run-command invoke \
"SIG_CONTAINER_NAME"=${SIG_CONTAINER_NAME} \
"STORAGE_ACCOUNT_NAME"=${STORAGE_ACCOUNT_NAME} \
"ENABLE_TRUSTED_LAUNCH"=${ENABLE_TRUSTED_LAUNCH} \
"VHD_NAME"=${VHD_NAME} \
"VHD_ARTIFACT_NAME"=${VHD_ARTIFACT_NAME} \
"SKU_NAME"=${SKU_NAME} \
"KUSTO_ENDPOINT"=${KUSTO_ENDPOINT} \
"KUSTO_DATABASE"=${KUSTO_DATABASE} \
Expand Down
Loading