From 6bed91fe6e3a73392f278a16b323c71cf9a0cd57 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 da3bb3fd5d5..303eaa166aa 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 363f0e8c41517e6015edbb70a29d7d6442257a1e 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 303eaa166aa..38b7e3754c0 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 1d77a9408913b1254511286b9f35d9e5f10103aa 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 38b7e3754c0..2e1bf574779 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)) {