-
Notifications
You must be signed in to change notification settings - Fork 637
✨ Add ability to control "EKS Auto Mode" for EKS clusters #5642
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -179,6 +179,7 @@ func TestWebhookCreate(t *testing.T) { | |
| secondaryCidr *string | ||
| secondaryCidrBlocks []infrav1.VpcCidrBlock | ||
| kubeProxy KubeProxy | ||
| AutoMode *AutoMode | ||
| accessConfig *AccessConfig | ||
| }{ | ||
| { | ||
|
|
@@ -364,6 +365,30 @@ func TestWebhookCreate(t *testing.T) { | |
| BootstrapClusterCreatorAdminPermissions: ptr.To(false), | ||
| }, | ||
| }, | ||
| { | ||
| name: "autoMode compute not allowed with authenticationMode CONFIG_MAP", | ||
| eksClusterName: "default_cluster1", | ||
| eksVersion: "v1.19", | ||
| expectError: true, | ||
| vpcCNI: VpcCni{Disable: false}, | ||
| AutoMode: &AutoMode{Enabled: true}, | ||
| }, | ||
| { | ||
| name: "autoMode compute nodeRoleArn should be defined with nodePools", | ||
| eksClusterName: "default_cluster1", | ||
| eksVersion: "v1.19", | ||
| expectError: true, | ||
| vpcCNI: VpcCni{Disable: false}, | ||
| AutoMode: &AutoMode{Enabled: true, Compute: Compute{NodePools: []string{"system", "general-purpose"}}}, | ||
| }, | ||
| { | ||
| name: "autoMode compute nodeRoleArn defined with nodePools", | ||
| eksClusterName: "default_cluster1", | ||
| eksVersion: "v1.19", | ||
| expectError: false, | ||
| vpcCNI: VpcCni{Disable: false}, | ||
| AutoMode: &AutoMode{Enabled: true, Compute: Compute{NodePools: []string{"system", "general-purpose"}, NodeRoleArn: aws.String("foo")}}, | ||
| }, | ||
| } | ||
|
|
||
| for _, tc := range tests { | ||
|
|
@@ -411,6 +436,10 @@ func TestWebhookCreate(t *testing.T) { | |
| mcp.Spec.AccessConfig = tc.accessConfig | ||
| } | ||
|
|
||
| if tc.AutoMode != nil { | ||
| mcp.Spec.AutoMode = tc.AutoMode | ||
| } | ||
|
|
||
| err := testEnv.Create(ctx, mcp) | ||
|
|
||
| if tc.expectError { | ||
|
|
@@ -877,6 +906,37 @@ func TestWebhookUpdate(t *testing.T) { | |
| }, | ||
| expectError: true, | ||
| }, | ||
| { | ||
| name: "changing noderolearn is not allowed after it has been set", | ||
| oldClusterSpec: AWSManagedControlPlaneSpec{ | ||
| EKSClusterName: "default_cluster1", | ||
| NetworkSpec: infrav1.NetworkSpec{ | ||
| VPC: infrav1.VPCSpec{}, | ||
| }, | ||
| Version: ptr.To[string]("1.22"), | ||
| AutoMode: &AutoMode{ | ||
| Compute: Compute{ | ||
| NodeRoleArn: aws.String("fooarn"), | ||
| NodePools: []string{"pool1", "pool2"}, | ||
| }, | ||
| }, | ||
| }, | ||
| newClusterSpec: AWSManagedControlPlaneSpec{ | ||
| EKSClusterName: "default_cluster1", | ||
| NetworkSpec: infrav1.NetworkSpec{ | ||
| VPC: infrav1.VPCSpec{ | ||
| IPv6: &infrav1.IPv6{}, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test should be testing one thing. It appears to also be testing whether or not you can switch to ipv6 after having it undeclared. |
||
| }, | ||
| }, | ||
| AutoMode: &AutoMode{ | ||
| Compute: Compute{ | ||
| NodeRoleArn: aws.String("bararn"), | ||
| NodePools: []string{"pool1", "pool2"}, | ||
| }, | ||
| }, | ||
| }, | ||
| expectError: true, | ||
| }, | ||
| } | ||
|
|
||
| for _, tc := range tests { | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needs a comment describing the field.