Merge pull request #8666 from appvia/bugfix/aws-lt-delete-cluster

Fix SecurityGroup check when there are no Network Interfaces associated with a LaunchTemplate
This commit is contained in:
Kubernetes Prow Robot 2020-03-03 09:31:38 -08:00 committed by GitHub
commit cb983ff63f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -1205,7 +1205,9 @@ func FindAutoScalingLaunchTemplateConfigurations(cloud fi.Cloud, securityGroups
for _, j := range req.LaunchTemplateVersions {
// @check if the security group references the security group above
var s []*string
s = append(s, j.LaunchTemplateData.NetworkInterfaces[0].Groups...)
if len(j.LaunchTemplateData.NetworkInterfaces) > 0 {
s = append(s, j.LaunchTemplateData.NetworkInterfaces[0].Groups...)
}
s = append(s, j.LaunchTemplateData.SecurityGroupIds...)
for _, y := range s {
if securityGroups.Has(fi.StringValue(y)) {