Skip to content

Commit

Permalink
[test resources] Fix regression - base name overrides in CI (#5924)
Browse files Browse the repository at this point in the history
This PR fixes an issue introduced in #5242 which stopped respecting BaseName parameter overrides in CI mode. This caused issues in stress deployments where we intentionally override BaseName to get a short name hash and need the value to match up with other places where inject it.

CC @richardpark-msft @lmolkova
  • Loading branch information
benbp authored Apr 5, 2023
1 parent f106f2c commit e8abc39
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions eng/common/TestResources/SubConfig-Helpers.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ function GetBaseAndResourceGroupNames(
[string]$serviceDirectoryName,
[bool]$CI
) {
if ($baseNameDefault) {
$base = $baseNameDefault.ToLowerInvariant()
$group = $resourceGroupNameDefault ? $resourceGroupNameDefault : ("rg-$baseNameDefault".ToLowerInvariant())
return $base, $group
}

if ($CI) {
$base = 't' + (New-Guid).ToString('n').Substring(0, 16)
# Format the resource group name based on resource group naming recommendations and limitations.
Expand All @@ -37,12 +43,6 @@ function GetBaseAndResourceGroupNames(
return $base, $group
}

if ($baseNameDefault) {
$base = $baseNameDefault.ToLowerInvariant()
$group = $resourceGroupNameDefault ? $resourceGroupNameDefault : ("rg-$baseNameDefault".ToLowerInvariant())
return $base, $group
}

# Handle service directories in nested directories, e.g. `data/aztables`
$serviceDirectorySafeName = $serviceDirectoryName -replace '[\./\\]', ''
# Seed off resource group name if set to avoid name conflicts with deployments where it is not set
Expand Down

0 comments on commit e8abc39

Please sign in to comment.