@@ -38,7 +38,9 @@ func getFeatureGatesWithDualStack() featuregates.FeatureGate {
3838 apifeatures .FeatureGateDNSNameResolver ,
3939 apifeatures .FeatureGateOVNObservability ,
4040 apifeatures .FeatureGateAWSDualStackInstall ,
41- apifeatures .FeatureGateAzureDualStackInstall },
41+ apifeatures .FeatureGateAzureDualStackInstall ,
42+ apifeatures .FeatureGateGCPDualStackInstall ,
43+ },
4244 []configv1.FeatureGateName {},
4345 )
4446}
@@ -122,6 +124,7 @@ func getFeatureGatesWithIncompleteDualStack() featuregates.FeatureGate {
122124 },
123125 []configv1.FeatureGateName {
124126 apifeatures .FeatureGateAzureDualStackInstall ,
127+ apifeatures .FeatureGateGCPDualStackInstall ,
125128 },
126129 )
127130}
@@ -195,10 +198,10 @@ func TestValidateClusterConfigDualStack(t *testing.T) {
195198 err = ValidateClusterConfig (& configv1.Network {Spec : cc }, client , featureGates )
196199 g .Expect (err ).NotTo (HaveOccurred ())
197200
198- // You can't use dual-stack if enabled on an unsupported platform
199- infrastructure .Status .PlatformStatus .Type = configv1 .GCPPlatformType
200- infrastructure .Status .PlatformStatus .GCP = & configv1.GCPPlatformStatus {
201- Region : "us-west1 " ,
201+ // DualStack supported only with featuregates
202+ infrastructure .Status .PlatformStatus .Type = configv1 .AWSPlatformType
203+ infrastructure .Status .PlatformStatus .AWS = & configv1.AWSPlatformStatus {
204+ Region : "us-east-1 " ,
202205 }
203206 client = fake .NewFakeClient (infrastructure )
204207 err = createProxy (client )
@@ -209,14 +212,13 @@ func TestValidateClusterConfigDualStack(t *testing.T) {
209212 CIDR : "fd01::/48" ,
210213 HostPrefix : 64 ,
211214 })
212- haveError ( cc , fmt . Sprintf ( "%s is not one of the supported platforms for dual stack" ,
213- infrastructure . Status . PlatformStatus . Type ))
215+ err = ValidateClusterConfig ( & configv1. Network { Spec : cc }, client , featureGates )
216+ g . Expect ( err ). NotTo ( HaveOccurred ( ))
214217
215- // DualStack supported only with featuregates
216- infrastructure .Status .PlatformStatus .Type = configv1 .AWSPlatformType
217- infrastructure .Status .PlatformStatus .AWS = & configv1.AWSPlatformStatus {
218- Region : "us-east-1" ,
219- }
218+ // DualStack with supported platform but missing featuregate
219+ featureGates = getFeatureGatesWithIncompleteDualStack ()
220+ infrastructure .Status .PlatformStatus .Type = configv1 .AzurePlatformType
221+ infrastructure .Status .PlatformStatus .Azure = & configv1.AzurePlatformStatus {}
220222 client = fake .NewFakeClient (infrastructure )
221223 err = createProxy (client )
222224 g .Expect (err ).NotTo (HaveOccurred ())
@@ -227,12 +229,13 @@ func TestValidateClusterConfigDualStack(t *testing.T) {
227229 HostPrefix : 64 ,
228230 })
229231 err = ValidateClusterConfig (& configv1.Network {Spec : cc }, client , featureGates )
230- g .Expect (err ).NotTo (HaveOccurred ())
232+ haveError (cc , fmt .Sprintf ("%s is not one of the supported platforms for dual stack" ,
233+ infrastructure .Status .PlatformStatus .Type ))
231234
232235 // DualStack with supported platform but missing featuregate
233236 featureGates = getFeatureGatesWithIncompleteDualStack ()
234- infrastructure .Status .PlatformStatus .Type = configv1 .AzurePlatformType
235- infrastructure .Status .PlatformStatus .Azure = & configv1.AzurePlatformStatus {}
237+ infrastructure .Status .PlatformStatus .Type = configv1 .GCPPlatformType
238+ infrastructure .Status .PlatformStatus .GCP = & configv1.GCPPlatformStatus {}
236239 client = fake .NewFakeClient (infrastructure )
237240 err = createProxy (client )
238241 g .Expect (err ).NotTo (HaveOccurred ())
0 commit comments