Change playground deletion lifespan to 10 days (#7970)
* Change playground deletion lifespan to 10 days * user debug
This commit is contained in:
Родитель
7413b06c38
Коммит
c8a76c18ee
|
@ -44,7 +44,7 @@ If you need the group for a little more time, add/update a tag named `DeleteAfte
|
|||
*To create long-lived resources:*
|
||||
|
||||
NOTE: Resource groups in the playground subscription, if compliant and marked with valid aliases (see below), **will still
|
||||
be marked for deletion after 30 days.** See the below examples for how to extend this deletion deadline if necessary.
|
||||
be marked for deletion after 10 days.** See the below examples for how to extend this deletion deadline if necessary.
|
||||
|
||||
Create a resource group to contain all testing resources. The resource group name should start with your Microsoft alias.
|
||||
Valid group name examples: `myalias`, `myalias-feature-101-testing`. Your Microsoft account must be
|
||||
|
|
|
@ -31,7 +31,7 @@ parameters:
|
|||
- DisplayName: AzureCloud Playground - Resource Cleanup
|
||||
SubscriptionConfigurations:
|
||||
- $(sub-config-azure-cloud-playground)
|
||||
AdditionalParameters: "-DeleteNonCompliantGroups -DeleteArmDeployments -MaxLifespanDeleteAfterHours 720"
|
||||
AdditionalParameters: "-DeleteNonCompliantGroups -DeleteArmDeployments -MaxLifespanDeleteAfterHours 240"
|
||||
# TODO: Disabled this clean-up as the dogfood enviroment is busted and the tests are no longer running
|
||||
# see https://github.com/Azure/azure-sdk-for-python/pull/33483 were the tests were disabled.
|
||||
# - DisplayName: Dogfood Translation - Resource Cleanup
|
||||
|
|
|
@ -173,14 +173,15 @@ function AddGithubUsersToAliasCache() {
|
|||
Write-Error "Failed to retrieve github -> microsoft alias mappings from opensource api."
|
||||
exit 1
|
||||
}
|
||||
Write-Host "Found $($users.Count) users"
|
||||
foreach ($user in $users) {
|
||||
if ($user.aad.alias) {
|
||||
if ($user -and $user.aad.alias) {
|
||||
$OwnerAliasCache[$user.aad.alias] = $true
|
||||
}
|
||||
if ($user.aad.userPrincipalName) {
|
||||
if ($user -and $user.aad.userPrincipalName) {
|
||||
$OwnerAliasCache[$user.aad.userPrincipalName] = $true
|
||||
}
|
||||
if ($user.github.login) {
|
||||
if ($user -and $user.github.login) {
|
||||
$OwnerAliasCache[$user.github.login] = $true
|
||||
}
|
||||
}
|
||||
|
@ -334,11 +335,14 @@ function HasDeleteLock([object]$ResourceGroup) {
|
|||
}
|
||||
|
||||
function DeleteArmDeployments([object]$ResourceGroup) {
|
||||
if (!$DeleteArmDeployments) {
|
||||
if (!$DeleteArmDeployments -or !$ResourceGroup) {
|
||||
return
|
||||
}
|
||||
$toDelete = @(Get-AzResourceGroupDeployment -ResourceGroupName $ResourceGroup.ResourceGroupName `
|
||||
| Where-Object { $_ -and ($_.Outputs?.Count -or $_.Parameters?.ContainsKey('testApplicationSecret')) })
|
||||
$toDelete = @()
|
||||
try {
|
||||
$toDelete = @(Get-AzResourceGroupDeployment -ResourceGroupName $ResourceGroup.ResourceGroupName `
|
||||
| Where-Object { $_ -and ($_.Outputs?.Count -or $_.Parameters?.ContainsKey('testApplicationSecret')) })
|
||||
} catch {}
|
||||
if (!$toDelete -or !$toDelete.Count) {
|
||||
return
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче