Skip to content

fix: support sp auth for requirements #282

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

Merged
merged 5 commits into from
Jan 23, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix validation and colour warning
  • Loading branch information
jaredfholgate committed Jan 23, 2025
commit a954c7c789de864a9da04c6d227495f1377f0d6c
15 changes: 10 additions & 5 deletions src/ALZ/Private/Tools/Test-Tooling.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,17 @@ function Test-Tooling {
$envVarValue = [System.Environment]::GetEnvironmentVariable($envVar)
if($envVarValue -eq $null -or $envVarValue -eq "" ) {
$envVarsSet = $false
break
continue
}
$envVarAtLeastOneSet = $true
$envVarsWithValue += $envVar
if($envVarValue -notmatch("^(\{){0,1}[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}(\}){0,1}$")) {
$envVarValid = $false
break
continue
}
if($checkedEnvVars -contains $envVarValue) {
$envVarUnique = $false
break
continue
}
$checkedEnvVars += $envVarValue
}
Expand All @@ -85,7 +85,7 @@ function Test-Tooling {

if(-not $envVarValid) {
$checkResults += @{
message = "Azure environment variables are set, but are not valid GUIDs."
message = "Azure environment variables are set, but are not all valid GUIDs."
result = "Failure"
}
}
Expand All @@ -104,8 +104,13 @@ function Test-Tooling {
$hasFailure = $true
} else {
if($envVarAtLeastOneSet) {
$envVarValidationOutput = ""
foreach($envVar in $envVarsWithValue) {
$envVarValue = [System.Environment]::GetEnvironmentVariable($envVar)
$envVarValidationOutput += " $envVar ($envVarValue)"
}
$checkResults += @{
message = "At least one environment variables is set, but the other expected environment variables are not set. This could cause Terraform to fail in unexpected ways. Set environment variables: $($envVarsWithValue -join " ")."
message = "At least one environment variable is set, but the other expected environment variables are not set. This could cause Terraform to fail in unexpected ways. Set environment variables:$envVarValidationOutput."
result = "Warning"
}
}
Expand Down
Loading