diff --git a/conformance/conformance.go b/conformance/conformance.go index 642a6eb280..73d2a2c620 100644 --- a/conformance/conformance.go +++ b/conformance/conformance.go @@ -21,6 +21,7 @@ import ( "os" "testing" + "k8s.io/utils/ptr" v1 "sigs.k8s.io/gateway-api/apis/v1" "sigs.k8s.io/gateway-api/apis/v1alpha2" "sigs.k8s.io/gateway-api/apis/v1alpha3" @@ -80,6 +81,19 @@ func DefaultOptions(t *testing.T) suite.ConformanceOptions { *flags.ImplementationVersion, *flags.ImplementationContact, ) + var usable, unusable []v1beta1.GatewaySpecAddress + if v := *flags.UsableAddress; v != "" { + usable = append(usable, v1beta1.GatewaySpecAddress{ + Type: ptr.To(v1beta1.HostnameAddressType), + Value: v, + }) + } + if v := *flags.UnusableAddress; v != "" { + unusable = append(unusable, v1beta1.GatewaySpecAddress{ + Type: ptr.To(v1beta1.HostnameAddressType), + Value: v, + }) + } return suite.ConformanceOptions{ AllowCRDsMismatch: *flags.AllowCRDsMismatch, @@ -93,6 +107,8 @@ func DefaultOptions(t *testing.T) suite.ConformanceOptions { ExemptFeatures: exemptFeatures, ManifestFS: []fs.FS{&Manifests}, GatewayClassName: *flags.GatewayClassName, + UsableNetworkAddresses: usable, + UnusableNetworkAddresses: unusable, MeshName: *flags.MeshName, Implementation: implementation, Mode: *flags.Mode, diff --git a/conformance/utils/flags/flags.go b/conformance/utils/flags/flags.go index 1465df68b9..4317d3875e 100644 --- a/conformance/utils/flags/flags.go +++ b/conformance/utils/flags/flags.go @@ -30,6 +30,8 @@ const ( var ( GatewayClassName = flag.String("gateway-class", "gateway-conformance", "Name of GatewayClass to use for tests") + UsableAddress = flag.String("usable-address", "", "Usable address for GatewayStaticAddresses test") + UnusableAddress = flag.String("unusable-address", "", "Unusable address for GatewayStaticAddresses test") MeshName = flag.String("mesh-name", "", "Name of Mesh to use for tests") ShowDebug = flag.Bool("debug", false, "Whether to print debug logs") CleanupBaseResources = flag.Bool("cleanup-base-resources", true, "Whether to cleanup base test resources after the run")