@@ -85,52 +85,52 @@ func TestDefaultingWebhook(t *testing.T) {
8585 resourceName : "cluster1" ,
8686 resourceNS : "default" ,
8787 expectHash : false ,
88- expectSpec : AWSManagedControlPlaneSpec {EKSClusterName : "default_cluster1" , IdentityRef : defaultIdentityRef , Bastion : defaultTestBastion , NetworkSpec : defaultNetworkSpec , TokenMethod : & EKSTokenMethodIAMAuthenticator , BootstrapSelfManagedAddons : true },
88+ expectSpec : AWSManagedControlPlaneSpec {EKSClusterName : "default_cluster1" , IdentityRef : defaultIdentityRef , Bastion : defaultTestBastion , NetworkSpec : defaultNetworkSpec , TokenMethod : & EKSTokenMethodIAMAuthenticator , BootstrapSelfManagedAddons : aws . Bool ( true ), AutoMode : aws . Bool ( true ) },
8989 },
9090 {
9191 name : "less than 100 chars, dot in name" ,
9292 resourceName : "team1.cluster1" ,
9393 resourceNS : "default" ,
9494 expectHash : false ,
95- expectSpec : AWSManagedControlPlaneSpec {EKSClusterName : "default_team1_cluster1" , IdentityRef : defaultIdentityRef , Bastion : defaultTestBastion , NetworkSpec : defaultNetworkSpec , TokenMethod : & EKSTokenMethodIAMAuthenticator , BootstrapSelfManagedAddons : true },
95+ expectSpec : AWSManagedControlPlaneSpec {EKSClusterName : "default_team1_cluster1" , IdentityRef : defaultIdentityRef , Bastion : defaultTestBastion , NetworkSpec : defaultNetworkSpec , TokenMethod : & EKSTokenMethodIAMAuthenticator , BootstrapSelfManagedAddons : aws . Bool ( true ), AutoMode : aws . Bool ( true ) },
9696 },
9797 {
9898 name : "more than 100 chars" ,
9999 resourceName : "abcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcde" ,
100100 resourceNS : "default" ,
101101 expectHash : true ,
102- expectSpec : AWSManagedControlPlaneSpec {EKSClusterName : "capi_" , IdentityRef : defaultIdentityRef , Bastion : defaultTestBastion , NetworkSpec : defaultNetworkSpec , TokenMethod : & EKSTokenMethodIAMAuthenticator , BootstrapSelfManagedAddons : true },
102+ expectSpec : AWSManagedControlPlaneSpec {EKSClusterName : "capi_" , IdentityRef : defaultIdentityRef , Bastion : defaultTestBastion , NetworkSpec : defaultNetworkSpec , TokenMethod : & EKSTokenMethodIAMAuthenticator , BootstrapSelfManagedAddons : aws . Bool ( true ), AutoMode : aws . Bool ( true ) },
103103 },
104104 {
105105 name : "with patch" ,
106106 resourceName : "cluster1" ,
107107 resourceNS : "default" ,
108108 expectHash : false ,
109109 spec : AWSManagedControlPlaneSpec {Version : & vV1_17_1 },
110- expectSpec : AWSManagedControlPlaneSpec {EKSClusterName : "default_cluster1" , Version : & vV1_17_1 , IdentityRef : defaultIdentityRef , Bastion : defaultTestBastion , NetworkSpec : defaultNetworkSpec , TokenMethod : & EKSTokenMethodIAMAuthenticator , BootstrapSelfManagedAddons : true },
110+ expectSpec : AWSManagedControlPlaneSpec {EKSClusterName : "default_cluster1" , Version : & vV1_17_1 , IdentityRef : defaultIdentityRef , Bastion : defaultTestBastion , NetworkSpec : defaultNetworkSpec , TokenMethod : & EKSTokenMethodIAMAuthenticator , BootstrapSelfManagedAddons : aws . Bool ( true ), AutoMode : aws . Bool ( true ) },
111111 },
112112 {
113113 name : "with allowed ip on bastion" ,
114114 resourceName : "cluster1" ,
115115 resourceNS : "default" ,
116116 expectHash : false ,
117117 spec : AWSManagedControlPlaneSpec {Bastion : infrav1.Bastion {AllowedCIDRBlocks : []string {"100.100.100.100/0" }}},
118- expectSpec : AWSManagedControlPlaneSpec {EKSClusterName : "default_cluster1" , IdentityRef : defaultIdentityRef , Bastion : infrav1.Bastion {AllowedCIDRBlocks : []string {"100.100.100.100/0" }}, NetworkSpec : defaultNetworkSpec , TokenMethod : & EKSTokenMethodIAMAuthenticator , BootstrapSelfManagedAddons : true },
118+ expectSpec : AWSManagedControlPlaneSpec {EKSClusterName : "default_cluster1" , IdentityRef : defaultIdentityRef , Bastion : infrav1.Bastion {AllowedCIDRBlocks : []string {"100.100.100.100/0" }}, NetworkSpec : defaultNetworkSpec , TokenMethod : & EKSTokenMethodIAMAuthenticator , BootstrapSelfManagedAddons : aws . Bool ( true ), AutoMode : aws . Bool ( true ) },
119119 },
120120 {
121121 name : "with CNI on network" ,
122122 resourceName : "cluster1" ,
123123 resourceNS : "default" ,
124124 expectHash : false ,
125125 spec : AWSManagedControlPlaneSpec {NetworkSpec : infrav1.NetworkSpec {CNI : & infrav1.CNISpec {}}},
126- expectSpec : AWSManagedControlPlaneSpec {EKSClusterName : "default_cluster1" , IdentityRef : defaultIdentityRef , Bastion : defaultTestBastion , NetworkSpec : infrav1.NetworkSpec {CNI : & infrav1.CNISpec {}, VPC : defaultVPCSpec }, TokenMethod : & EKSTokenMethodIAMAuthenticator , BootstrapSelfManagedAddons : true },
126+ expectSpec : AWSManagedControlPlaneSpec {EKSClusterName : "default_cluster1" , IdentityRef : defaultIdentityRef , Bastion : defaultTestBastion , NetworkSpec : infrav1.NetworkSpec {CNI : & infrav1.CNISpec {}, VPC : defaultVPCSpec }, TokenMethod : & EKSTokenMethodIAMAuthenticator , BootstrapSelfManagedAddons : aws . Bool ( true ), AutoMode : aws . Bool ( true ) },
127127 },
128128 {
129129 name : "secondary CIDR" ,
130130 resourceName : "cluster1" ,
131131 resourceNS : "default" ,
132132 expectHash : false ,
133- expectSpec : AWSManagedControlPlaneSpec {EKSClusterName : "default_cluster1" , IdentityRef : defaultIdentityRef , Bastion : defaultTestBastion , NetworkSpec : defaultNetworkSpec , SecondaryCidrBlock : nil , TokenMethod : & EKSTokenMethodIAMAuthenticator , BootstrapSelfManagedAddons : true },
133+ expectSpec : AWSManagedControlPlaneSpec {EKSClusterName : "default_cluster1" , IdentityRef : defaultIdentityRef , Bastion : defaultTestBastion , NetworkSpec : defaultNetworkSpec , SecondaryCidrBlock : nil , TokenMethod : & EKSTokenMethodIAMAuthenticator , BootstrapSelfManagedAddons : aws . Bool ( true ), AutoMode : aws . Bool ( true ) },
134134 },
135135 }
136136
0 commit comments