mirror of
https://github.com/NVIDIA/OpenShell.git
synced 2026-11-03 08:17:44 +08:00
* fix(helm): improve GatewayClass overrides Give chart-created Gateways a distinct default name and allow GRPCRoutes to select a listener on an existing Gateway. Fixes: #2469 Signed-off-by: Daneyon Hansen <daneyon.hansen@solo.io> * fix(e2e): resolve rendered Gateway name Signed-off-by: Daneyon Hansen <daneyon.hansen@solo.io> * fix(helm): preserve Gateway name defaults Signed-off-by: Daneyon Hansen <daneyon.hansen@solo.io> --------- Signed-off-by: Daneyon Hansen <daneyon.hansen@solo.io>
117 lines
3.5 KiB
YAML
117 lines
3.5 KiB
YAML
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
suite: Gateway API resources
|
|
templates:
|
|
- templates/gateway.yaml
|
|
- templates/grpcroute.yaml
|
|
release:
|
|
name: openshell
|
|
namespace: openshell
|
|
|
|
tests:
|
|
- it: preserves the chart fullname as the default Gateway name
|
|
template: templates/gateway.yaml
|
|
set:
|
|
grpcRoute.enabled: true
|
|
grpcRoute.gateway.create: true
|
|
asserts:
|
|
- equal:
|
|
path: metadata.name
|
|
value: openshell
|
|
- equal:
|
|
path: spec.gatewayClassName
|
|
value: eg
|
|
|
|
- it: references the same default Gateway from the GRPCRoute
|
|
template: templates/grpcroute.yaml
|
|
set:
|
|
grpcRoute.enabled: true
|
|
grpcRoute.gateway.create: true
|
|
asserts:
|
|
- equal:
|
|
path: spec.parentRefs[0].name
|
|
value: openshell
|
|
- equal:
|
|
path: spec.parentRefs[0].namespace
|
|
value: openshell
|
|
- notExists:
|
|
path: spec.parentRefs[0].sectionName
|
|
|
|
- it: keeps a chart-created Gateway parent in the release namespace
|
|
template: templates/grpcroute.yaml
|
|
set:
|
|
grpcRoute.enabled: true
|
|
grpcRoute.gateway.create: true
|
|
grpcRoute.gateway.namespace: another-namespace
|
|
asserts:
|
|
- equal:
|
|
path: spec.parentRefs[0].namespace
|
|
value: openshell
|
|
|
|
- it: renders an arbitrary GatewayClass and explicit Gateway name
|
|
template: templates/gateway.yaml
|
|
set:
|
|
grpcRoute.enabled: true
|
|
grpcRoute.gateway.create: true
|
|
grpcRoute.gateway.className: custom-class
|
|
grpcRoute.gateway.name: custom-ingress
|
|
asserts:
|
|
- equal:
|
|
path: metadata.name
|
|
value: custom-ingress
|
|
- equal:
|
|
path: spec.gatewayClassName
|
|
value: custom-class
|
|
|
|
- it: preserves an explicit Gateway name longer than 63 characters
|
|
template: templates/gateway.yaml
|
|
set:
|
|
grpcRoute.enabled: true
|
|
grpcRoute.gateway.create: true
|
|
grpcRoute.gateway.name: abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqr
|
|
asserts:
|
|
- equal:
|
|
path: metadata.name
|
|
value: abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqr
|
|
|
|
- it: references an explicit Gateway name longer than 63 characters unchanged
|
|
template: templates/grpcroute.yaml
|
|
set:
|
|
grpcRoute.enabled: true
|
|
grpcRoute.gateway.create: true
|
|
grpcRoute.gateway.name: abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqr
|
|
asserts:
|
|
- equal:
|
|
path: spec.parentRefs[0].name
|
|
value: abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqr
|
|
|
|
- it: attaches to a listener on an existing Gateway
|
|
template: templates/grpcroute.yaml
|
|
set:
|
|
grpcRoute.enabled: true
|
|
grpcRoute.gateway.create: false
|
|
grpcRoute.gateway.name: platform-gateway
|
|
grpcRoute.gateway.namespace: gateway-system
|
|
grpcRoute.gateway.sectionName: grpc
|
|
asserts:
|
|
- equal:
|
|
path: spec.parentRefs[0].name
|
|
value: platform-gateway
|
|
- equal:
|
|
path: spec.parentRefs[0].namespace
|
|
value: gateway-system
|
|
- equal:
|
|
path: spec.parentRefs[0].sectionName
|
|
value: grpc
|
|
|
|
- it: does not create a Gateway when attaching to an existing Gateway
|
|
template: templates/gateway.yaml
|
|
set:
|
|
grpcRoute.enabled: true
|
|
grpcRoute.gateway.create: false
|
|
grpcRoute.gateway.name: platform-gateway
|
|
asserts:
|
|
- hasDocuments:
|
|
count: 0
|