Skip to content

Commit

Permalink
fix: update examples for spec change
Browse files Browse the repository at this point in the history
  • Loading branch information
shaneutt committed Jan 12, 2022
1 parent 9f92464 commit 22c4509
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 24 deletions.
14 changes: 6 additions & 8 deletions apis/v1alpha2/gateway_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ type GatewayAddress struct {
//
// +optional
// +kubebuilder:default=IPAddress
Type *GatewayAddressType `json:"type,omitempty"`
Type *AddressType `json:"type,omitempty"`

// Value of the address. The validity of the values will depend
// on the type and support by the controller.
Expand All @@ -462,16 +462,14 @@ type GatewayAddress struct {
Value string `json:"value"`
}

// GatewayAddressType defines how a network address is represented as a text
// string, specifically in the context of listener addresses for Gateways and
// includes options over the base AddressType type such as Hostname.
// AddressType defines how a network address is represented as a text string.
//
// If the requested address is unsupported, the controller
// should raise the "Detached" listener status condition on
// the Gateway with the "UnsupportedAddress" reason.
//
// +kubebuilder:validation:Enum=IPAddress;Hostname;NamedAddress
type GatewayAddressType string
type AddressType string

const (
// A textual representation of a numeric IP address. IPv4
Expand All @@ -484,22 +482,22 @@ const (
// IPAddress).
//
// Support: Extended
IPAddressType GatewayAddressType = "IPAddress"
IPAddressType AddressType = "IPAddress"

// A Hostname represents a DNS based ingress point. This is similar to the
// corresponding hostname field in Kubernetes load balancer status. For
// example, this concept may be used for cloud load balancers where a DNS
// name is used to expose a load balancer.
//
// Support: Extended
HostnameAddressType GatewayAddressType = "Hostname"
HostnameAddressType AddressType = "Hostname"

// A NamedAddress provides a way to reference a specific IP address by name.
// For example, this may be a name or other unique identifier that refers
// to a resource on a cloud provider such as a static IP.
//
// Support: Implementation-Specific
NamedAddressType GatewayAddressType = "NamedAddress"
NamedAddressType AddressType = "NamedAddress"
)

// GatewayStatus defines the observed state of Gateway.
Expand Down
8 changes: 1 addition & 7 deletions apis/v1alpha2/shared_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ type NetworkAddress struct {
// Support: Custom (NamedAddress)
//
// +optional
Type *NetworkAddressType `json:"type,omitempty"`
Type *AddressType `json:"type,omitempty"`

// Value of the address. The validity of the values will depend
// on the type and support by the controller.
Expand All @@ -455,9 +455,3 @@ type NetworkAddress struct {
// +kubebuilder:validation:MaxLength=253
Value string `json:"value"`
}

// NetworkAddressType defines how a network address is represented as a text string.
//
// +kubebuilder:validation:Enum=IPAddress;NamedAddress
// +kubebuilder:default=IPAddress
type NetworkAddressType string
4 changes: 2 additions & 2 deletions apis/v1alpha2/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion config/crd/stable/gateway.networking.k8s.io_tcproutes.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion config/crd/stable/gateway.networking.k8s.io_udproutes.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions examples/v1alpha2/traffic-matching-tcp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@ spec:
rules:
- matches:
- sourceAddresses:
- value: "192.168.1.1"
- value: "FE80::0202:B3FF:FE1E:8329"
value: "192.168.1.1"
destinationAddresses:
- value: "10.96.0.1"
value: "10.96.0.1"
- sourceAddresses:
value: "FE80::0202:B3FF:FE1E:8329"
destinationAddresses:
value: "10.96.0.1"
backendRefs:
- name: my-service
port: 8080

0 comments on commit 22c4509

Please sign in to comment.