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

Bump sigs.k8s.io/gateway-api from 0.6.2 to 0.7.0 #643

Merged
merged 3 commits into from
May 17, 2023
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ The following table lists the software versions NGINX Kubernetes Gateway support

| NGINX Kubernetes Gateway | Gateway API | Kubernetes | NGINX OSS |
|-|-|-|-|
| Edge | 0.6.2 | 1.21+ | 1.21.x *|
| Edge | 0.7.0 | 1.21+ | 1.21.x *|
| 0.3.0 | 0.6.2 | 1.21+ | 1.21.x *|
| 0.2.0 | 0.5.1 | 1.21+ | 1.21.x *|
| 0.1.0 | 0.5.0 | 1.19+ | 1.21.3 |
Expand Down
2 changes: 1 addition & 1 deletion cmd/gateway/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
const (
errTmpl = "failed validation - flag: '--%s' reason: '%s'\n"
// nolint:lll
// Regex from: https://github.com/kubernetes-sigs/gateway-api/blob/v0.6.2/apis/v1beta1/shared_types.go#L495
// Regex from: https://github.com/kubernetes-sigs/gateway-api/blob/v0.7.0/apis/v1beta1/shared_types.go#L495
controllerNameRegex = `^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*\/[A-Za-z0-9\/\-._~%!$&'()*+,;=:]+$` //nolint:lll
)

Expand Down
2 changes: 1 addition & 1 deletion docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ This guide walks you through how to install NGINX Kubernetes Gateway on a generi
1. Install the Gateway API resources from the standard channel (the CRDs and the validating webhook):

```
kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v0.6.2/standard-install.yaml
kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v0.7.0/standard-install.yaml
```

1. Create the nginx-gateway Namespace:
Expand Down
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ require (
k8s.io/apimachinery v0.26.3
k8s.io/client-go v0.26.3
sigs.k8s.io/controller-runtime v0.14.6
sigs.k8s.io/gateway-api v0.6.2
sigs.k8s.io/gateway-api v0.7.0
)

require (
Expand Down Expand Up @@ -66,9 +66,9 @@ require (
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiextensions-apiserver v0.26.1 // indirect
k8s.io/component-base v0.26.1 // indirect
k8s.io/klog/v2 v2.80.1 // indirect
k8s.io/apiextensions-apiserver v0.26.3 // indirect
k8s.io/component-base v0.26.3 // indirect
k8s.io/klog/v2 v2.100.1 // indirect
k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 // indirect
k8s.io/utils v0.0.0-20221128185143-99ec85e7a448 // indirect
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 // indirect
Expand Down
18 changes: 9 additions & 9 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
Expand Down Expand Up @@ -605,16 +605,16 @@ honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9
honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
k8s.io/api v0.26.3 h1:emf74GIQMTik01Aum9dPP0gAypL8JTLl/lHa4V9RFSU=
k8s.io/api v0.26.3/go.mod h1:PXsqwPMXBSBcL1lJ9CYDKy7kIReUydukS5JiRlxC3qE=
k8s.io/apiextensions-apiserver v0.26.1 h1:cB8h1SRk6e/+i3NOrQgSFij1B2S0Y0wDoNl66bn8RMI=
k8s.io/apiextensions-apiserver v0.26.1/go.mod h1:AptjOSXDGuE0JICx/Em15PaoO7buLwTs0dGleIHixSM=
k8s.io/apiextensions-apiserver v0.26.3 h1:5PGMm3oEzdB1W/FTMgGIDmm100vn7IaUP5er36dB+YE=
k8s.io/apiextensions-apiserver v0.26.3/go.mod h1:jdA5MdjNWGP+njw1EKMZc64xAT5fIhN6VJrElV3sfpQ=
k8s.io/apimachinery v0.26.3 h1:dQx6PNETJ7nODU3XPtrwkfuubs6w7sX0M8n61zHIV/k=
k8s.io/apimachinery v0.26.3/go.mod h1:ats7nN1LExKHvJ9TmwootT00Yz05MuYqPXEXaVeOy5I=
k8s.io/client-go v0.26.3 h1:k1UY+KXfkxV2ScEL3gilKcF7761xkYsSD6BC9szIu8s=
k8s.io/client-go v0.26.3/go.mod h1:ZPNu9lm8/dbRIPAgteN30RSXea6vrCpFvq+MateTUuQ=
k8s.io/component-base v0.26.1 h1:4ahudpeQXHZL5kko+iDHqLj/FSGAEUnSVO0EBbgDd+4=
k8s.io/component-base v0.26.1/go.mod h1:VHrLR0b58oC035w6YQiBSbtsf0ThuSwXP+p5dD/kAWU=
k8s.io/klog/v2 v2.80.1 h1:atnLQ121W371wYYFawwYx1aEY2eUfs4l3J72wtgAwV4=
k8s.io/klog/v2 v2.80.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0=
k8s.io/component-base v0.26.3 h1:oC0WMK/ggcbGDTkdcqefI4wIZRYdK3JySx9/HADpV0g=
k8s.io/component-base v0.26.3/go.mod h1:5kj1kZYwSC6ZstHJN7oHBqcJC6yyn41eR+Sqa/mQc8E=
k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg=
k8s.io/klog/v2 v2.100.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0=
k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280 h1:+70TFaan3hfJzs+7VK2o+OGxg8HsuBr/5f6tVAjDu6E=
k8s.io/kube-openapi v0.0.0-20221012153701-172d655c2280/go.mod h1:+Axhij7bCpeqhklhUTe3xmOn6bWxolyZEeyaFpjGtl4=
k8s.io/utils v0.0.0-20221128185143-99ec85e7a448 h1:KTgPnR10d5zhztWptI952TNtt/4u5h3IzDXkdIMuo2Y=
Expand All @@ -624,8 +624,8 @@ rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
sigs.k8s.io/controller-runtime v0.14.6 h1:oxstGVvXGNnMvY7TAESYk+lzr6S3V5VFxQ6d92KcwQA=
sigs.k8s.io/controller-runtime v0.14.6/go.mod h1:WqIdsAY6JBsjfc/CqO0CORmNtoCtE4S6qbPc9s68h+0=
sigs.k8s.io/gateway-api v0.6.2 h1:583XHiX2M2bKEA0SAdkoxL1nY73W1+/M+IAm8LJvbEA=
sigs.k8s.io/gateway-api v0.6.2/go.mod h1:EYJT+jlPWTeNskjV0JTki/03WX1cyAnBhwBJfYHpV/0=
sigs.k8s.io/gateway-api v0.7.0 h1:/mG8yyJNBifqvuVLW5gwlI4CQs0NR/5q4BKUlf1bVdY=
sigs.k8s.io/gateway-api v0.7.0/go.mod h1:Xv0+ZMxX0lu1nSSDIIPEfbVztgNZ+3cfiYrJsa2Ooso=
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2 h1:iXTIw73aPyC+oRdyqqvVJuloN1p0AC/kzH07hu3NE+k=
sigs.k8s.io/json v0.0.0-20220713155537-f223a00ba0e2/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE=
Expand Down
2 changes: 1 addition & 1 deletion internal/nginx/config/servers.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ func createHTTPMatch(match v1beta1.HTTPRouteMatch, redirectPath string) httpMatc
// The name and values are delimited by "=". A name and value can always be recovered using strings.SplitN(arg,"=", 2).
// Query Parameters are case-sensitive so case is preserved.
func createQueryParamKeyValString(p v1beta1.HTTPQueryParamMatch) string {
return p.Name + "=" + p.Value
return string(p.Name) + "=" + p.Value
}

// The name and values are delimited by ":". A name and value can always be recovered using strings.Split(arg, ":").
Expand Down
4 changes: 2 additions & 2 deletions internal/state/change_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,10 @@ func NewChangeProcessorImpl(cfg ChangeProcessorConfig) *ChangeProcessorImpl {

var err error
switch o := obj.(type) {
// We don't validate GatewayClass, because as of 0.6.2, the webhook doesn't validate it (it only
// We don't validate GatewayClass, because as of 0.7.0, the webhook doesn't validate it (it only
// validates an update that requires the previous version of the resource,
// which NKG cannot reliably provide - for example, after NKG restarts).
// https://github.com/kubernetes-sigs/gateway-api/blob/v0.6.2/apis/v1beta1/validation/gatewayclass.go#L28
// https://github.com/kubernetes-sigs/gateway-api/blob/v0.7.0/apis/v1beta1/validation/gatewayclass.go#L28
case *v1beta1.Gateway:
err = gwapivalidation.ValidateGateway(o).ToAggregate()
case *v1beta1.HTTPRoute:
Expand Down
10 changes: 0 additions & 10 deletions internal/state/conditions/conditions.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,16 +220,6 @@ func NewListenerConflictedHostname(msg string) []Condition {
}
}

// NewListenerUnsupportedAddress returns a Condition that indicates that the address of a Listener is unsupported.
func NewListenerUnsupportedAddress(msg string) Condition {
return Condition{
Type: string(v1beta1.ListenerConditionAccepted),
Status: metav1.ConditionFalse,
Reason: string(v1beta1.ListenerReasonUnsupportedAddress),
Message: msg,
}
}

// NewListenerUnsupportedProtocol returns a Condition that indicates that the protocol of a Listener is unsupported.
func NewListenerUnsupportedProtocol(msg string) Condition {
return Condition{
Expand Down
2 changes: 1 addition & 1 deletion internal/state/graph/gateway_listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ func createAddressesValidator(gw *v1beta1.Gateway) listenerValidator {
if len(gw.Spec.Addresses) > 0 {
path := field.NewPath("spec", "addresses")
valErr := field.Forbidden(path, "addresses are not supported")
return []conditions.Condition{conditions.NewListenerUnsupportedAddress(valErr.Error())}
return []conditions.Condition{conditions.NewListenerUnsupportedValue(valErr.Error())}
pleshakov marked this conversation as resolved.
Show resolved Hide resolved
}
return nil
}
Expand Down
12 changes: 8 additions & 4 deletions internal/state/graph/gateway_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,9 @@ func TestBuildGateway(t *testing.T) {
Source: listener805,
Valid: false,
Conditions: []conditions.Condition{
conditions.NewListenerPortUnavailable(`port: Unsupported value: 81: supported values: "80"`),
conditions.NewListenerPortUnavailable(
`port: Unsupported value: 81: supported values: "80"`,
),
},
},
},
Expand All @@ -370,7 +372,9 @@ func TestBuildGateway(t *testing.T) {
Source: listener4436,
Valid: false,
Conditions: []conditions.Condition{
conditions.NewListenerPortUnavailable(`port: Unsupported value: 444: supported values: "443"`),
conditions.NewListenerPortUnavailable(
`port: Unsupported value: 444: supported values: "443"`,
),
},
},
},
Expand Down Expand Up @@ -515,7 +519,7 @@ func TestBuildGateway(t *testing.T) {
Source: listener801,
Valid: false,
Conditions: []conditions.Condition{
conditions.NewListenerUnsupportedAddress(
conditions.NewListenerUnsupportedValue(
"spec.addresses: Forbidden: addresses are not supported",
),
},
Expand All @@ -525,7 +529,7 @@ func TestBuildGateway(t *testing.T) {
Valid: false,
SecretPath: "",
Conditions: []conditions.Condition{
conditions.NewListenerUnsupportedAddress(
conditions.NewListenerUnsupportedValue(
"spec.addresses: Forbidden: addresses are not supported",
),
},
Expand Down
2 changes: 1 addition & 1 deletion internal/state/graph/httproute.go
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ func validateQueryParamMatch(
allErrs = append(allErrs, valErr)
}

if err := validator.ValidateQueryParamNameInMatch(q.Name); err != nil {
if err := validator.ValidateQueryParamNameInMatch(string(q.Name)); err != nil {
valErr := field.Invalid(queryParamPath.Child("name"), q.Name, err.Error())
allErrs = append(allErrs, valErr)
}
Expand Down