Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update Gateway API to v0.4.1 #4268

Merged
merged 3 commits into from
Jan 13, 2022
Merged
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
1 change: 1 addition & 0 deletions changelogs/unreleased/4268-skriss-small.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update Gateway API to v0.4.1
7 changes: 4 additions & 3 deletions examples/gateway/00-crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ spec:
scope: Cluster
versions:
- additionalPrinterColumns:
- jsonPath: .spec.controller
- jsonPath: .spec.controllerName
name: Controller
type: string
- jsonPath: .metadata.creationTimestamp
Expand Down Expand Up @@ -1391,7 +1391,7 @@ spec:
of the request is used. \n Support: Core"
maxLength: 253
minLength: 1
pattern: ^(\*\.)?[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
type: string
port:
description: "Port is the port to be used in
Expand Down Expand Up @@ -1764,7 +1764,7 @@ spec:
\n Support: Core"
maxLength: 253
minLength: 1
pattern: ^(\*\.)?[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
type: string
port:
description: "Port is the port to be used in the value
Expand Down Expand Up @@ -2310,6 +2310,7 @@ spec:
required:
- group
- kind
- namespace
type: object
maxItems: 16
minItems: 1
Expand Down
7 changes: 4 additions & 3 deletions examples/render/contour-gateway.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5318,7 +5318,7 @@ spec:
scope: Cluster
versions:
- additionalPrinterColumns:
- jsonPath: .spec.controller
- jsonPath: .spec.controllerName
name: Controller
type: string
- jsonPath: .metadata.creationTimestamp
Expand Down Expand Up @@ -6690,7 +6690,7 @@ spec:
of the request is used. \n Support: Core"
maxLength: 253
minLength: 1
pattern: ^(\*\.)?[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
type: string
port:
description: "Port is the port to be used in
Expand Down Expand Up @@ -7063,7 +7063,7 @@ spec:
\n Support: Core"
maxLength: 253
minLength: 1
pattern: ^(\*\.)?[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$
type: string
port:
description: "Port is the port to be used in the value
Expand Down Expand Up @@ -7609,6 +7609,7 @@ spec:
required:
- group
- kind
- namespace
type: object
maxItems: 16
minItems: 1
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ require (
k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b
sigs.k8s.io/controller-runtime v0.11.0
sigs.k8s.io/controller-tools v0.6.2
sigs.k8s.io/gateway-api v0.4.0
sigs.k8s.io/gateway-api v0.4.1
sigs.k8s.io/kustomize/kyaml v0.10.17
)
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1746,6 +1746,8 @@ sigs.k8s.io/controller-tools v0.6.2/go.mod h1:oaeGpjXn6+ZSEIQkUe/+3I40PNiDYp9aea
sigs.k8s.io/gateway-api v0.3.0/go.mod h1:Wb8bx7QhGVZxOSEU3i9vw/JqTB5Nlai9MLMYVZeDmRQ=
sigs.k8s.io/gateway-api v0.4.0 h1:07IJkTt21NetZTHtPKJk2I4XIgDN4BAlTIq1wK7V11o=
sigs.k8s.io/gateway-api v0.4.0/go.mod h1:r3eiNP+0el+NTLwaTfOrCNXy8TukC+dIM3ggc+fbNWk=
sigs.k8s.io/gateway-api v0.4.1 h1:Tof9/PNSZXyfDuTTe1XFvaTlvBRE6bKq1kmV6jj6rQE=
sigs.k8s.io/gateway-api v0.4.1/go.mod h1:r3eiNP+0el+NTLwaTfOrCNXy8TukC+dIM3ggc+fbNWk=
sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6 h1:fD1pz4yfdADVNfFmcP2aBEtudwUQ1AlLnRBALr33v3s=
sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6/go.mod h1:p4QtZmO4uMYipTQNzagwnNoseA6OxSUutVw05NhYDRs=
sigs.k8s.io/kustomize/api v0.8.5/go.mod h1:M377apnKT5ZHJS++6H4rQoCHmWtt6qTpp3mbe7p6OLY=
Expand Down
4 changes: 2 additions & 2 deletions internal/dag/builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2938,7 +2938,7 @@ func TestDAGInsertGatewayAPI(t *testing.T) {
Type: gatewayapi_v1alpha2.HTTPRouteFilterRequestRedirect,
RequestRedirect: &gatewayapi_v1alpha2.HTTPRequestRedirectFilter{
Scheme: pointer.String("https"),
Hostname: gatewayapi.ListenerHostname("envoyproxy.io"),
Hostname: gatewayapi.PreciseHostname("envoyproxy.io"),
Port: gatewayapi.PortNumPtr(443),
StatusCode: pointer.Int(301),
},
Expand Down Expand Up @@ -2991,7 +2991,7 @@ func TestDAGInsertGatewayAPI(t *testing.T) {
Type: gatewayapi_v1alpha2.HTTPRouteFilterRequestRedirect,
RequestRedirect: &gatewayapi_v1alpha2.HTTPRequestRedirectFilter{
Scheme: pointer.String("https"),
Hostname: gatewayapi.ListenerHostname("envoyproxy.io"),
Hostname: gatewayapi.PreciseHostname("envoyproxy.io"),
Port: gatewayapi.PortNumPtr(443),
StatusCode: pointer.Int(301),
},
Expand Down
5 changes: 5 additions & 0 deletions internal/gatewayapi/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ func ListenerHostname(host string) *gatewayapi_v1alpha2.Hostname {
return &h
}

func PreciseHostname(host string) *gatewayapi_v1alpha2.PreciseHostname {
h := gatewayapi_v1alpha2.PreciseHostname(host)
return &h
}

func CertificateRef(name, namespace string) *gatewayapi_v1alpha2.SecretObjectReference {
ref := &gatewayapi_v1alpha2.SecretObjectReference{
Group: GroupPtr(""),
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/gateway/request_redirect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func testRequestRedirectRule(namespace string) {
{
Type: gatewayapi_v1alpha2.HTTPRouteFilterRequestRedirect,
RequestRedirect: &gatewayapi_v1alpha2.HTTPRequestRedirectFilter{
Hostname: gatewayapi.ListenerHostname("projectcontour.io"),
Hostname: gatewayapi.PreciseHostname("projectcontour.io"),
},
},
},
Expand All @@ -66,7 +66,7 @@ func testRequestRedirectRule(namespace string) {
{
Type: gatewayapi_v1alpha2.HTTPRouteFilterRequestRedirect,
RequestRedirect: &gatewayapi_v1alpha2.HTTPRequestRedirectFilter{
Hostname: gatewayapi.ListenerHostname("envoyproxy.io"),
Hostname: gatewayapi.PreciseHostname("envoyproxy.io"),
StatusCode: pointer.Int(301),
Scheme: pointer.String("https"),
Port: gatewayapi.PortNumPtr(8080),
Expand Down