Skip to content

Commit

Permalink
[Hybrid Nodes] Make remoteNetworkConfig.IAM.Provider field case ins…
Browse files Browse the repository at this point in the history
…ensitive (#8169)

make RemoteNetworkConfig.IAM.Provider case insensitive
  • Loading branch information
TiberiuGC authored Jan 29, 2025
1 parent 74c2b1f commit 90ff203
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 15 deletions.
18 changes: 5 additions & 13 deletions examples/43-hybrid-nodes.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,15 @@
# An example of cluster config with remote networking configured.
apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig

metadata:
name: hybrid-nodes
name: hybrid-2
region: us-west-2

accessConfig:
authenticationMode: API_AND_CONFIG_MAP

vpc:
cidr: 10.226.98.0/23
version: "1.31"

remoteNetworkConfig:
vpcGatewayID: tgw-028fbe2348e6eed74
iam:
provider: IRA # default is ssm
caBundleCert: xxxx
provider: SSM
# caBundleCert: ceva
# vpcGatewayID: tgw-028fbe2348e6eed74
remoteNodeNetworks:
# eksctl will create, behind the scenes, SG rules, routes, and a VPC gateway attachment,
# to facilitate communication between remote network(s) and EKS control plane, via the attached gateway
- cidrs: ["10.80.146.0/24"]
2 changes: 1 addition & 1 deletion pkg/cfn/builder/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ func (c *ClusterResourceSet) addResourcesForControlPlane(subnetDetails *SubnetDe

func (c *ClusterResourceSet) addAccessEntryForRemoteNodes() {
getRemoteNodesRoleName := func() string {
switch *c.spec.RemoteNetworkConfig.IAM.Provider {
switch strings.ToLower(*c.spec.RemoteNetworkConfig.IAM.Provider) {
case api.SSMProvider:
return SSMRole
case api.IRAProvider:
Expand Down
3 changes: 2 additions & 1 deletion pkg/cfn/builder/iam.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package builder
import (
"context"
"fmt"
"strings"

"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/service/cloudformation/types"
Expand Down Expand Up @@ -221,7 +222,7 @@ func (c *ClusterResourceSet) addSSM() {

func (c *ClusterResourceSet) addResourcesForRemoteNodesRole() {
c.rs.withIAM = true
switch *c.spec.RemoteNetworkConfig.IAM.Provider {
switch strings.ToLower(*c.spec.RemoteNetworkConfig.IAM.Provider) {
case api.SSMProvider:
c.addSSM()
case api.IRAProvider:
Expand Down

0 comments on commit 90ff203

Please sign in to comment.