Skip to content

Commit

Permalink
Fixing missing retention settings when upgrading hubs from 0.3 ot 0.4 (
Browse files Browse the repository at this point in the history
…microsoft#824)

Co-authored-by: Helder Pinto <[email protected]>
  • Loading branch information
helderpinto and Helder Pinto authored Jul 16, 2024
1 parent 42479cf commit 15e07fd
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/aoe-cd-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
push:
branches:
- dev
paths:
- 'src/optimization-engine/**'
permissions:
id-token: write
contents: read
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/aoe-cd-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
push:
branches:
- main
paths:
- 'src/optimization-engine/**'
permissions:
id-token: write
contents: read
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/aoe-cd-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
push:
branches:
- features/aoe
paths:
- 'src/optimization-engine/**'
permissions:
id-token: write
contents: read
Expand Down
15 changes: 15 additions & 0 deletions src/templates/finops-hub/modules/scripts/Copy-FileToAzureBlob.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,21 @@ if (!$json)

# Set values from inputs
$json.scopes = $env:scopes.Split('|') | ForEach-Object { @{ 'scope' = $_ } }
if (!($json.retention))
{
# In case the retention object is not present in the settings.json file (versions before 0.4), add it with default values
$retention = @"
{
"msexports": {
"days": 0
},
"ingestion": {
"months": 13
}
}
"@
$json | Add-Member -Name retention -Value (ConvertFrom-Json $retention) -MemberType NoteProperty
}
$json.retention.msexports.days = [Int32]::Parse($env:msexportRetentionInDays)
$json.retention.ingestion.months = [Int32]::Parse($env:ingestionRetentionInMonths)

Expand Down

0 comments on commit 15e07fd

Please sign in to comment.