Skip to content

Commit 741d9b3

Browse files
author
Kate Osborn
committed
Update to 0.7.0
1 parent d7e4ce4 commit 741d9b3

File tree

8 files changed

+15
-21
lines changed

8 files changed

+15
-21
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ The following table lists the software versions NGINX Kubernetes Gateway support
4343

4444
| NGINX Kubernetes Gateway | Gateway API | Kubernetes | NGINX OSS |
4545
|-|-|-|-|
46-
| Edge | 0.6.2 | 1.21+ | 1.21.x *|
46+
| Edge | 0.7.0 | 1.21+ | 1.21.x *|
4747
| 0.3.0 | 0.6.2 | 1.21+ | 1.21.x *|
4848
| 0.2.0 | 0.5.1 | 1.21+ | 1.21.x *|
4949
| 0.1.0 | 0.5.0 | 1.19+ | 1.21.3 |

cmd/gateway/setup.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717
const (
1818
errTmpl = "failed validation - flag: '--%s' reason: '%s'\n"
1919
// nolint:lll
20-
// Regex from: https://github.com/kubernetes-sigs/gateway-api/blob/v0.6.2/apis/v1beta1/shared_types.go#L495
20+
// Regex from: https://github.com/kubernetes-sigs/gateway-api/blob/v0.7.0/apis/v1beta1/shared_types.go#L495
2121
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
2222
)
2323

internal/nginx/config/servers.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ func createHTTPMatch(match v1beta1.HTTPRouteMatch, redirectPath string) httpMatc
277277
// The name and values are delimited by "=". A name and value can always be recovered using strings.SplitN(arg,"=", 2).
278278
// Query Parameters are case-sensitive so case is preserved.
279279
func createQueryParamKeyValString(p v1beta1.HTTPQueryParamMatch) string {
280-
return p.Name + "=" + p.Value
280+
return string(p.Name) + "=" + p.Value
281281
}
282282

283283
// The name and values are delimited by ":". A name and value can always be recovered using strings.Split(arg, ":").

internal/state/change_processor.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,10 @@ func NewChangeProcessorImpl(cfg ChangeProcessorConfig) *ChangeProcessorImpl {
146146

147147
var err error
148148
switch o := obj.(type) {
149-
// We don't validate GatewayClass, because as of 0.6.2, the webhook doesn't validate it (it only
149+
// We don't validate GatewayClass, because as of 0.7.0, the webhook doesn't validate it (it only
150150
// validates an update that requires the previous version of the resource,
151151
// which NKG cannot reliably provide - for example, after NKG restarts).
152-
// https://github.com/kubernetes-sigs/gateway-api/blob/v0.6.2/apis/v1beta1/validation/gatewayclass.go#L28
152+
// https://github.com/kubernetes-sigs/gateway-api/blob/v0.7.0/apis/v1beta1/validation/gatewayclass.go#L28
153153
case *v1beta1.Gateway:
154154
err = gwapivalidation.ValidateGateway(o).ToAggregate()
155155
case *v1beta1.HTTPRoute:

internal/state/conditions/conditions.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -220,16 +220,6 @@ func NewListenerConflictedHostname(msg string) []Condition {
220220
}
221221
}
222222

223-
// NewListenerUnsupportedAddress returns a Condition that indicates that the address of a Listener is unsupported.
224-
func NewListenerUnsupportedAddress(msg string) Condition {
225-
return Condition{
226-
Type: string(v1beta1.ListenerConditionAccepted),
227-
Status: metav1.ConditionFalse,
228-
Reason: string(v1beta1.ListenerReasonUnsupportedAddress),
229-
Message: msg,
230-
}
231-
}
232-
233223
// NewListenerUnsupportedProtocol returns a Condition that indicates that the protocol of a Listener is unsupported.
234224
func NewListenerUnsupportedProtocol(msg string) Condition {
235225
return Condition{

internal/state/graph/gateway_listener.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ func createAddressesValidator(gw *v1beta1.Gateway) listenerValidator {
197197
if len(gw.Spec.Addresses) > 0 {
198198
path := field.NewPath("spec", "addresses")
199199
valErr := field.Forbidden(path, "addresses are not supported")
200-
return []conditions.Condition{conditions.NewListenerUnsupportedAddress(valErr.Error())}
200+
return []conditions.Condition{conditions.NewListenerUnsupportedValue(valErr.Error())}
201201
}
202202
return nil
203203
}

internal/state/graph/gateway_test.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,9 @@ func TestBuildGateway(t *testing.T) {
353353
Source: listener805,
354354
Valid: false,
355355
Conditions: []conditions.Condition{
356-
conditions.NewListenerPortUnavailable(`port: Unsupported value: 81: supported values: "80"`),
356+
conditions.NewListenerPortUnavailable(
357+
`port: Unsupported value: 81: supported values: "80"`,
358+
),
357359
},
358360
},
359361
},
@@ -370,7 +372,9 @@ func TestBuildGateway(t *testing.T) {
370372
Source: listener4436,
371373
Valid: false,
372374
Conditions: []conditions.Condition{
373-
conditions.NewListenerPortUnavailable(`port: Unsupported value: 444: supported values: "443"`),
375+
conditions.NewListenerPortUnavailable(
376+
`port: Unsupported value: 444: supported values: "443"`,
377+
),
374378
},
375379
},
376380
},
@@ -515,7 +519,7 @@ func TestBuildGateway(t *testing.T) {
515519
Source: listener801,
516520
Valid: false,
517521
Conditions: []conditions.Condition{
518-
conditions.NewListenerUnsupportedAddress(
522+
conditions.NewListenerUnsupportedValue(
519523
"spec.addresses: Forbidden: addresses are not supported",
520524
),
521525
},
@@ -525,7 +529,7 @@ func TestBuildGateway(t *testing.T) {
525529
Valid: false,
526530
SecretPath: "",
527531
Conditions: []conditions.Condition{
528-
conditions.NewListenerUnsupportedAddress(
532+
conditions.NewListenerUnsupportedValue(
529533
"spec.addresses: Forbidden: addresses are not supported",
530534
),
531535
},

internal/state/graph/httproute.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ func validateQueryParamMatch(
439439
allErrs = append(allErrs, valErr)
440440
}
441441

442-
if err := validator.ValidateQueryParamNameInMatch(q.Name); err != nil {
442+
if err := validator.ValidateQueryParamNameInMatch(string(q.Name)); err != nil {
443443
valErr := field.Invalid(queryParamPath.Child("name"), q.Name, err.Error())
444444
allErrs = append(allErrs, valErr)
445445
}

0 commit comments

Comments
 (0)