Skip to content

Commit

Permalink
Merge pull request #2109 from crossplane-contrib/backport-2107-to-rel…
Browse files Browse the repository at this point in the history
…ease-0.50
  • Loading branch information
MisterMX authored Oct 18, 2024
2 parents ee259fe + eb7d037 commit 89313d7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pkg/clients/eks/eks.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,13 +220,12 @@ func GenerateUpdateClusterConfigInputForVPC(name string, p *v1beta1.ClusterParam
Name: pointer.ToOrNilIfZeroValue(name),
}

// NOTE(muvaf): SecurityGroupIds and SubnetIds cannot be updated. They are
// included in VpcConfigRequest probably because it is used in Create call
// as well.
u.ResourcesVpcConfig = &ekstypes.VpcConfigRequest{
EndpointPrivateAccess: p.ResourcesVpcConfig.EndpointPrivateAccess,
EndpointPublicAccess: p.ResourcesVpcConfig.EndpointPublicAccess,
PublicAccessCidrs: p.ResourcesVpcConfig.PublicAccessCidrs,
SubnetIds: p.ResourcesVpcConfig.SubnetIDs,
SecurityGroupIds: p.ResourcesVpcConfig.SecurityGroupIDs,
}
return u
}
Expand Down Expand Up @@ -424,7 +423,7 @@ func IsUpToDate(p *v1beta1.ClusterParameters, cluster *ekstypes.Cluster) (bool,
res := cmp.Equal(&v1beta1.ClusterParameters{}, patch, cmpopts.EquateEmpty(),
cmpopts.IgnoreTypes(&xpv1.Reference{}, &xpv1.Selector{}, []xpv1.Reference{}),
cmpopts.IgnoreFields(v1beta1.ClusterParameters{}, "Region"),
cmpopts.IgnoreFields(v1beta1.VpcConfigRequest{}, "PublicAccessCidrs", "SubnetIDs", "SecurityGroupIDs"))
cmpopts.IgnoreFields(v1beta1.VpcConfigRequest{}, "PublicAccessCidrs"))
return res, nil
}

Expand Down
4 changes: 4 additions & 0 deletions pkg/clients/eks/eks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,8 @@ func TestGenerateUpdateClusterConfigInputForVPC(t *testing.T) {
EndpointPrivateAccess: &trueVal,
EndpointPublicAccess: &trueVal,
PublicAccessCidrs: []string{"0.0.0.0/0"},
SubnetIDs: []string{"subnet-1234567890abcdefg"},
SecurityGroupIDs: []string{"sg-1234567890abcdefg"},
},
RoleArn: roleArn,
Tags: map[string]string{"key": "val"},
Expand All @@ -365,6 +367,8 @@ func TestGenerateUpdateClusterConfigInputForVPC(t *testing.T) {
EndpointPrivateAccess: &trueVal,
EndpointPublicAccess: &trueVal,
PublicAccessCidrs: []string{"0.0.0.0/0"},
SubnetIds: []string{"subnet-1234567890abcdefg"},
SecurityGroupIds: []string{"sg-1234567890abcdefg"},
},
},
},
Expand Down

0 comments on commit 89313d7

Please sign in to comment.