Skip to content

Commit

Permalink
api/aws: support --aws-ami=lts for test/spawning
Browse files Browse the repository at this point in the history
it allows to use the 'lts' channel when testing quickly with kola using

Signed-off-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
  • Loading branch information
tormath1 committed Sep 25, 2023
1 parent 7d8aac2 commit ce6ef91
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 ce6ef91

Please sign in to comment.