Skip to content

Commit

Permalink
Merge pull request #454 from flatcar/tormath1/aws
Browse files Browse the repository at this point in the history
api/aws: support `--aws-ami=lts` for test/spawning
  • Loading branch information
tormath1 authored Sep 25, 2023
2 parents 1c50b2c + 2921f96 commit a9d3596
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions platform/api/aws/ami.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ var amiCache struct {

stableOnce sync.Once
stableAMIs *releaseAMIs

ltsOnce sync.Once
ltsAMIs *releaseAMIs
}

// resolveAMI is used to minimize network requests while allowing resolution of
Expand Down Expand Up @@ -77,6 +80,11 @@ func resolveAMI(ami string, region string) string {
amiCache.stableAMIs = resolveChannel(ami)
})
channelAmis = amiCache.stableAMIs
case "lts":
amiCache.ltsOnce.Do(func() {
amiCache.ltsAMIs = resolveChannel(ami)
})
channelAmis = amiCache.ltsAMIs
default:
return ami
}
Expand Down

0 comments on commit a9d3596

Please sign in to comment.