@@ -85,52 +85,52 @@ func TestDefaultingWebhook(t *testing.T) {
85
85
resourceName : "cluster1" ,
86
86
resourceNS : "default" ,
87
87
expectHash : false ,
88
- expectSpec : AWSManagedControlPlaneSpec {EKSClusterName : "default_cluster1" , IdentityRef : defaultIdentityRef , Bastion : defaultTestBastion , NetworkSpec : defaultNetworkSpec , TokenMethod : & EKSTokenMethodIAMAuthenticator },
88
+ expectSpec : AWSManagedControlPlaneSpec {EKSClusterName : "default_cluster1" , IdentityRef : defaultIdentityRef , Bastion : defaultTestBastion , NetworkSpec : defaultNetworkSpec , TokenMethod : & EKSTokenMethodIAMAuthenticator , BootstrapSelfManagedAddons : true },
89
89
},
90
90
{
91
91
name : "less than 100 chars, dot in name" ,
92
92
resourceName : "team1.cluster1" ,
93
93
resourceNS : "default" ,
94
94
expectHash : false ,
95
- expectSpec : AWSManagedControlPlaneSpec {EKSClusterName : "default_team1_cluster1" , IdentityRef : defaultIdentityRef , Bastion : defaultTestBastion , NetworkSpec : defaultNetworkSpec , TokenMethod : & EKSTokenMethodIAMAuthenticator },
95
+ expectSpec : AWSManagedControlPlaneSpec {EKSClusterName : "default_team1_cluster1" , IdentityRef : defaultIdentityRef , Bastion : defaultTestBastion , NetworkSpec : defaultNetworkSpec , TokenMethod : & EKSTokenMethodIAMAuthenticator , BootstrapSelfManagedAddons : true },
96
96
},
97
97
{
98
98
name : "more than 100 chars" ,
99
99
resourceName : "abcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcde" ,
100
100
resourceNS : "default" ,
101
101
expectHash : true ,
102
- expectSpec : AWSManagedControlPlaneSpec {EKSClusterName : "capi_" , IdentityRef : defaultIdentityRef , Bastion : defaultTestBastion , NetworkSpec : defaultNetworkSpec , TokenMethod : & EKSTokenMethodIAMAuthenticator },
102
+ expectSpec : AWSManagedControlPlaneSpec {EKSClusterName : "capi_" , IdentityRef : defaultIdentityRef , Bastion : defaultTestBastion , NetworkSpec : defaultNetworkSpec , TokenMethod : & EKSTokenMethodIAMAuthenticator , BootstrapSelfManagedAddons : true },
103
103
},
104
104
{
105
105
name : "with patch" ,
106
106
resourceName : "cluster1" ,
107
107
resourceNS : "default" ,
108
108
expectHash : false ,
109
109
spec : AWSManagedControlPlaneSpec {Version : & vV1_17_1 },
110
- expectSpec : AWSManagedControlPlaneSpec {EKSClusterName : "default_cluster1" , Version : & vV1_17_1 , IdentityRef : defaultIdentityRef , Bastion : defaultTestBastion , NetworkSpec : defaultNetworkSpec , TokenMethod : & EKSTokenMethodIAMAuthenticator },
110
+ expectSpec : AWSManagedControlPlaneSpec {EKSClusterName : "default_cluster1" , Version : & vV1_17_1 , IdentityRef : defaultIdentityRef , Bastion : defaultTestBastion , NetworkSpec : defaultNetworkSpec , TokenMethod : & EKSTokenMethodIAMAuthenticator , BootstrapSelfManagedAddons : true },
111
111
},
112
112
{
113
113
name : "with allowed ip on bastion" ,
114
114
resourceName : "cluster1" ,
115
115
resourceNS : "default" ,
116
116
expectHash : false ,
117
117
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 },
118
+ expectSpec : AWSManagedControlPlaneSpec {EKSClusterName : "default_cluster1" , IdentityRef : defaultIdentityRef , Bastion : infrav1.Bastion {AllowedCIDRBlocks : []string {"100.100.100.100/0" }}, NetworkSpec : defaultNetworkSpec , TokenMethod : & EKSTokenMethodIAMAuthenticator , BootstrapSelfManagedAddons : true },
119
119
},
120
120
{
121
121
name : "with CNI on network" ,
122
122
resourceName : "cluster1" ,
123
123
resourceNS : "default" ,
124
124
expectHash : false ,
125
125
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 },
126
+ expectSpec : AWSManagedControlPlaneSpec {EKSClusterName : "default_cluster1" , IdentityRef : defaultIdentityRef , Bastion : defaultTestBastion , NetworkSpec : infrav1.NetworkSpec {CNI : & infrav1.CNISpec {}, VPC : defaultVPCSpec }, TokenMethod : & EKSTokenMethodIAMAuthenticator , BootstrapSelfManagedAddons : true },
127
127
},
128
128
{
129
129
name : "secondary CIDR" ,
130
130
resourceName : "cluster1" ,
131
131
resourceNS : "default" ,
132
132
expectHash : false ,
133
- expectSpec : AWSManagedControlPlaneSpec {EKSClusterName : "default_cluster1" , IdentityRef : defaultIdentityRef , Bastion : defaultTestBastion , NetworkSpec : defaultNetworkSpec , SecondaryCidrBlock : nil , TokenMethod : & EKSTokenMethodIAMAuthenticator },
133
+ expectSpec : AWSManagedControlPlaneSpec {EKSClusterName : "default_cluster1" , IdentityRef : defaultIdentityRef , Bastion : defaultTestBastion , NetworkSpec : defaultNetworkSpec , SecondaryCidrBlock : nil , TokenMethod : & EKSTokenMethodIAMAuthenticator , BootstrapSelfManagedAddons : true },
134
134
},
135
135
}
136
136
0 commit comments