Skip to content

Commit

Permalink
Restrict VPC.SecurityGroup egress rules validations to self-managed n…
Browse files Browse the repository at this point in the history
…odes
  • Loading branch information
TiberiuGC committed Jul 12, 2024
1 parent 4b2a630 commit 260a615
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pkg/actions/nodegroup/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,11 @@ func (m *Manager) Create(ctx context.Context, options CreateOpts, nodegroupFilte
return errors.Wrapf(err, "loading VPC spec for cluster %q", meta.Name)
}
isOwnedCluster = false
skipEgressRules, err = validateSecurityGroup(ctx, ctl.AWSProvider.EC2(), cfg.VPC.SecurityGroup)
if err != nil {
return err
if len(cfg.NodeGroups) > 0 {
skipEgressRules, err = validateSecurityGroup(ctx, ctl.AWSProvider.EC2(), cfg.VPC.SecurityGroup)
if err != nil {
return err
}
}

default:
Expand Down
5 changes: 5 additions & 0 deletions pkg/actions/nodegroup/create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1135,4 +1135,9 @@ func makeUnownedClusterConfig(clusterConfig *api.ClusterConfig) {
},
},
}
clusterConfig.NodeGroups = append(clusterConfig.NodeGroups, &api.NodeGroup{
NodeGroupBase: &api.NodeGroupBase{
Name: "ng",
},
})
}

0 comments on commit 260a615

Please sign in to comment.