Skip to content

Commit

Permalink
Merge pull request #5863 from justinsb/follow_on_5744_part2
Browse files Browse the repository at this point in the history
Don't override name of ELB API SecurityGroup
  • Loading branch information
k8s-ci-robot authored Oct 4, 2018
2 parents a6cdcc5 + e5d8b37 commit c55b032
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions pkg/model/awsmodel/api_loadbalancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,17 +110,8 @@ func (b *APILoadBalancerBuilder) Build(c *fi.ModelBuilderContext) error {
listeners["443"] = &awstasks.LoadBalancerListener{InstancePort: 443, SSLCertificateID: lbSpec.SSLCertificate}
}

var sgLink *awstasks.SecurityGroup
if lbSpec.SecurityGroupOverride != nil {
glog.V(1).Infof("WARNING: You are overwriting the Load Balancers, Security Group. When this is done you are responsible for ensure the correct rules!")

sgLink = &awstasks.SecurityGroup{
Name: lbSpec.SecurityGroupOverride,
ID: lbSpec.SecurityGroupOverride,
Shared: fi.Bool(true),
}
} else {
sgLink = b.LinkToELBSecurityGroup("api")
}

elb = &awstasks.LoadBalancer{
Expand All @@ -129,7 +120,7 @@ func (b *APILoadBalancerBuilder) Build(c *fi.ModelBuilderContext) error {

LoadBalancerName: s(loadBalancerName),
SecurityGroups: []*awstasks.SecurityGroup{
sgLink,
b.LinkToELBSecurityGroup("api"),
},
Subnets: elbSubnets,
Listeners: listeners,
Expand Down Expand Up @@ -174,7 +165,6 @@ func (b *APILoadBalancerBuilder) Build(c *fi.ModelBuilderContext) error {
lbSG.Tags = b.CloudTags(*lbSG.Name, false)

if lbSpec.SecurityGroupOverride != nil {
lbSG.Name = fi.String(*lbSpec.SecurityGroupOverride)
lbSG.ID = fi.String(*lbSpec.SecurityGroupOverride)
lbSG.Shared = fi.Bool(true)
}
Expand Down

0 comments on commit c55b032

Please sign in to comment.