Skip to content

Commit

Permalink
Merge pull request #5602 from mikesplain/fix_api_lb_additiona_sec_groups
Browse files Browse the repository at this point in the history
Fix additional security groups changes on api lb
  • Loading branch information
k8s-ci-robot authored Aug 14, 2018
2 parents fdc02d0 + 613d163 commit f19fc37
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions upup/pkg/fi/cloudup/awstasks/load_balancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,19 @@ func (_ *LoadBalancer) RenderAWS(t *awsup.AWSAPITarget, a, e, changes *LoadBalan
}
}

if changes.SecurityGroups != nil {
request := &elb.ApplySecurityGroupsToLoadBalancerInput{}
request.LoadBalancerName = aws.String(loadBalancerName)
for _, sg := range e.SecurityGroups {
request.SecurityGroups = append(request.SecurityGroups, sg.ID)
}

glog.V(2).Infof("Updating Load Balancer Security Groups")
if _, err := t.Cloud.ELB().ApplySecurityGroupsToLoadBalancer(request); err != nil {
return fmt.Errorf("Error updating security groups on Load Balancer: %v", err)
}
}

if changes.Listeners != nil {

elbDescription, err := findLoadBalancerByLoadBalancerName(t.Cloud, loadBalancerName)
Expand Down

0 comments on commit f19fc37

Please sign in to comment.