@@ -22,7 +22,6 @@ import (
2222 "testing"
2323
2424 "github.com/stretchr/testify/require"
25- apierrs "k8s.io/apimachinery/pkg/api/errors"
2625 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2726 "k8s.io/apimachinery/pkg/types"
2827 "k8s.io/apimachinery/pkg/util/sets"
@@ -38,7 +37,6 @@ func init() {
3837 ConformanceTests = append (ConformanceTests , GatewayPrivateRoutability )
3938 ConformanceTests = append (ConformanceTests , GatewayClusterRoutability )
4039 ConformanceTests = append (ConformanceTests , GatewayUnsupportedRoutability )
41- ConformanceTests = append (ConformanceTests , GatewayUnsupportedRoutabilityMutation )
4240}
4341
4442var GatewayClassRoutability = suite.ConformanceTest {
@@ -115,59 +113,6 @@ var GatewayUnsupportedRoutability = suite.ConformanceTest{
115113 },
116114}
117115
118- var GatewayUnsupportedRoutabilityMutation = suite.ConformanceTest {
119- ShortName : "GatewayUnsupportedRoutabilityMutation" ,
120- Features : []suite.SupportedFeature {
121- suite .SupportGateway ,
122- suite .SupportGatewayClassRoutability ,
123- },
124- Manifests : []string {
125- "tests/gateway-routability-bad-mutation.yaml" ,
126- },
127- Description : "Mutating a Gateway to an unsupported routability should set Accepted to False" ,
128- Test : func (t * testing.T , s * suite.ConformanceTestSuite ) {
129- gwn := types.NamespacedName {Name : "gateway-bad-routability-mutation" , Namespace : "gateway-conformance-infra" }
130- //nolint:errcheck // the helper throws an error if it fails
131- kubernetes .WaitForGatewayAddress (t , s .Client , s .TimeoutConfig , gwn )
132-
133- ctx , cancel := context .WithTimeout (context .Background (), s .TimeoutConfig .GetTimeout )
134- defer cancel ()
135-
136- gw := & v1beta1.Gateway {}
137- err := s .Client .Get (ctx , gwn , gw )
138- require .NoErrorf (t , err , "error getting Gateway: %v" , err )
139-
140- routability := v1beta1 .GatewayRoutability ("a.bad.vendor.prefix/bad!!" )
141- if gw .Spec .Infrastructure == nil {
142- gw .Spec .Infrastructure = & v1beta1.GatewayInfrastructure {}
143- }
144- gw .Spec .Infrastructure .Routability = & routability
145-
146- err = s .Client .Update (ctx , gw )
147-
148- // If an admission webhook rejects a bad routability that's allowed
149- if apierrs .IsBadRequest (err ) {
150- return
151- }
152- require .NoErrorf (t , err , "error updating Gateway: %v" , err )
153-
154- kubernetes .GatewayMustHaveLatestConditions (t , s .Client , s .TimeoutConfig , gwn )
155-
156- err = s .Client .Get (ctx , gwn , gw )
157- require .NoErrorf (t , err , "error getting Gateway: %v" , err )
158-
159- for _ , cond := range gw .Status .Conditions {
160- if cond .Type == string (v1beta1 .GatewayConditionAccepted ) {
161- if cond .Status != metav1 .ConditionFalse {
162- t .Errorf ("expected Accepted condition to be 'False': was %q" , cond .Status )
163- } else if cond .Reason != string (v1beta1 .GatewayUnsupportedRoutability ) {
164- t .Errorf ("expected Accepted condition reason to be %q: was %q" , v1beta1 .GatewayUnsupportedRoutability , cond .Status )
165- }
166- }
167- }
168- },
169- }
170-
171116var GatewayPublicRoutability = suite.ConformanceTest {
172117 ShortName : "GatewayPublicRoutability" ,
173118 Features : []suite.SupportedFeature {
0 commit comments