From 41846ed68b78608638c863ac0fdc5153b544115a Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Wed, 19 Jan 2022 10:51:38 -0800 Subject: [PATCH 1/3] excluding duplicated env:USER in image tag --- .../scripts/stress-testing/stress-test-deployment-lib.ps1 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/eng/common/scripts/stress-testing/stress-test-deployment-lib.ps1 b/eng/common/scripts/stress-testing/stress-test-deployment-lib.ps1 index da3bb3fd5d5c..303eaa166aae 100644 --- a/eng/common/scripts/stress-testing/stress-test-deployment-lib.ps1 +++ b/eng/common/scripts/stress-testing/stress-test-deployment-lib.ps1 @@ -149,13 +149,14 @@ function DeployStressPackage( Run az bicep build -f "$($pkg.Directory)/stress-test-resources.bicep" if ($LASTEXITCODE) { return } } - $imageTag = "${registryName}.azurecr.io" if ($repositoryBase) { $imageTag += "/$repositoryBase" } - $imageTag += "/$($pkg.Namespace)/$($pkg.ReleaseName):${deployId}" - + if ($pkg.Namespace -ne $repositoryBase) { + $imageTag += "/$($pkg.Namespace)" + } + $imageTag += "/$($pkg.ReleaseName):${deployId}" $dockerFilePath = "$($pkg.Directory)/Dockerfile" if ($pushImages -and (Test-Path $dockerFilePath)) { Write-Host "Building and pushing stress test docker image '$imageTag'" From 78bef829b9e8040a8d681717e6aa535ea18a06a7 Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Wed, 19 Jan 2022 10:54:53 -0800 Subject: [PATCH 2/3] NIT --- .../scripts/stress-testing/stress-test-deployment-lib.ps1 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/eng/common/scripts/stress-testing/stress-test-deployment-lib.ps1 b/eng/common/scripts/stress-testing/stress-test-deployment-lib.ps1 index 303eaa166aae..38b7e3754c04 100644 --- a/eng/common/scripts/stress-testing/stress-test-deployment-lib.ps1 +++ b/eng/common/scripts/stress-testing/stress-test-deployment-lib.ps1 @@ -149,6 +149,7 @@ function DeployStressPackage( Run az bicep build -f "$($pkg.Directory)/stress-test-resources.bicep" if ($LASTEXITCODE) { return } } + $imageTag = "${registryName}.azurecr.io" if ($repositoryBase) { $imageTag += "/$repositoryBase" @@ -157,6 +158,7 @@ function DeployStressPackage( $imageTag += "/$($pkg.Namespace)" } $imageTag += "/$($pkg.ReleaseName):${deployId}" + $dockerFilePath = "$($pkg.Directory)/Dockerfile" if ($pushImages -and (Test-Path $dockerFilePath)) { Write-Host "Building and pushing stress test docker image '$imageTag'" From cd3f234fac8b8b71f13aa55215d1bcd4e186ddc8 Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Fri, 21 Jan 2022 13:17:27 -0800 Subject: [PATCH 3/3] removing default repo name --- .../stress-testing/stress-test-deployment-lib.ps1 | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/eng/common/scripts/stress-testing/stress-test-deployment-lib.ps1 b/eng/common/scripts/stress-testing/stress-test-deployment-lib.ps1 index 38b7e3754c04..2e1bf5747790 100644 --- a/eng/common/scripts/stress-testing/stress-test-deployment-lib.ps1 +++ b/eng/common/scripts/stress-testing/stress-test-deployment-lib.ps1 @@ -86,12 +86,6 @@ function DeployStressTests( $subscription = 'Azure SDK Test Resources' } - if (!$repository) { - $repository = if ($env:USER) { $env:USER } else { "${env:USERNAME}" } - # Remove spaces, etc. that may be in $namespace - $repository -replace '\W' - } - if ($login) { if (!$clusterGroup -or !$subscription) { throw "clusterGroup and subscription parameters must be specified when logging into an environment that is not test or prod." @@ -154,10 +148,7 @@ function DeployStressPackage( if ($repositoryBase) { $imageTag += "/$repositoryBase" } - if ($pkg.Namespace -ne $repositoryBase) { - $imageTag += "/$($pkg.Namespace)" - } - $imageTag += "/$($pkg.ReleaseName):${deployId}" + $imageTag += "/$($pkg.Namespace)/$($pkg.ReleaseName):${deployId}" $dockerFilePath = "$($pkg.Directory)/Dockerfile" if ($pushImages -and (Test-Path $dockerFilePath)) {