Skip to content
This repository has been archived by the owner on Oct 10, 2023. It is now read-only.

Commit

Permalink
Correcting AMI ID being sent from the UI
Browse files Browse the repository at this point in the history
Signed-off-by: Sudarshan <asudarshan@vmware.com>
  • Loading branch information
saji-pivotal committed Sep 2, 2021
1 parent c26663a commit c5748ce
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions pkg/v1/tkg/tkgconfigproviders/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,17 @@ func (c *client) NewAWSConfig(params *models.AWSRegionalClusterParams, encodedCr

amiID := ""

if val, ok := bomConfiguration.AMI[params.AwsAccountParams.Region]; ok {
amiID = val[0].ID
if amis, ok := bomConfiguration.AMI[params.AwsAccountParams.Region]; ok {
if params.Os != nil && params.Os.OsInfo != nil {
for _, ami := range amis {
if ami.OSInfo.Name == params.Os.OsInfo.Name {
amiID = ami.ID
break
}
}
} else {
amiID = amis[0].ID
}
}

if amiID == "" {
Expand Down

0 comments on commit c5748ce

Please # to comment.