Skip to content

Commit c900dc4

Browse files
authored
Merge pull request #6175 from rdrgmnzs/sg_fix
Fix for when node and master use the same SG.
2 parents 6af9813 + a7903ad commit c900dc4

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

pkg/model/awsmodel/autoscalinggroup.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,9 @@ func (b *AutoscalingGroupModelBuilder) Build(c *fi.ModelBuilderContext) error {
8181
if ig.Spec.SecurityGroupOverride != nil {
8282
glog.V(1).Infof("WARNING: You are overwriting the Instance Groups, Security Group. When this is done you are responsible for ensure the correct rules!")
8383

84+
sgName := fmt.Sprintf("%v-%v", fi.StringValue(ig.Spec.SecurityGroupOverride), ig.Spec.Role)
8485
sgLink = &awstasks.SecurityGroup{
85-
Name: ig.Spec.SecurityGroupOverride,
86+
Name: &sgName,
8687
ID: ig.Spec.SecurityGroupOverride,
8788
Shared: fi.Bool(true),
8889
}

pkg/model/firewall.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -483,8 +483,9 @@ func (b *KopsModelContext) GetSecurityGroups(role kops.InstanceGroupRole) ([]Sec
483483
}
484484
done[name] = true
485485

486+
sgName := fmt.Sprintf("%v-%v", fi.StringValue(ig.Spec.SecurityGroupOverride), role)
486487
t := &awstasks.SecurityGroup{
487-
Name: ig.Spec.SecurityGroupOverride,
488+
Name: &sgName,
488489
ID: ig.Spec.SecurityGroupOverride,
489490
VPC: b.LinkToVPC(),
490491
Shared: fi.Bool(true),

0 commit comments

Comments
 (0)