Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions conformance/conformance.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this hardcoded to hostname type?

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,
Expand All @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions conformance/utils/flags/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down