|
| 1 | +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. |
| 2 | +# SPDX-License-Identifier: Apache-2.0 |
| 3 | + |
| 4 | +suite: Gateway API resources |
| 5 | +templates: |
| 6 | + - templates/gateway.yaml |
| 7 | + - templates/grpcroute.yaml |
| 8 | +release: |
| 9 | + name: openshell |
| 10 | + namespace: openshell |
| 11 | + |
| 12 | +tests: |
| 13 | + - it: gives a chart-created Gateway a non-conflicting default name |
| 14 | + template: templates/gateway.yaml |
| 15 | + set: |
| 16 | + grpcRoute.enabled: true |
| 17 | + grpcRoute.gateway.create: true |
| 18 | + asserts: |
| 19 | + - equal: |
| 20 | + path: metadata.name |
| 21 | + value: openshell-ingress |
| 22 | + - equal: |
| 23 | + path: spec.gatewayClassName |
| 24 | + value: eg |
| 25 | + |
| 26 | + - it: references the same default Gateway from the GRPCRoute |
| 27 | + template: templates/grpcroute.yaml |
| 28 | + set: |
| 29 | + grpcRoute.enabled: true |
| 30 | + grpcRoute.gateway.create: true |
| 31 | + asserts: |
| 32 | + - equal: |
| 33 | + path: spec.parentRefs[0].name |
| 34 | + value: openshell-ingress |
| 35 | + - equal: |
| 36 | + path: spec.parentRefs[0].namespace |
| 37 | + value: openshell |
| 38 | + - notExists: |
| 39 | + path: spec.parentRefs[0].sectionName |
| 40 | + |
| 41 | + - it: keeps a chart-created Gateway parent in the release namespace |
| 42 | + template: templates/grpcroute.yaml |
| 43 | + set: |
| 44 | + grpcRoute.enabled: true |
| 45 | + grpcRoute.gateway.create: true |
| 46 | + grpcRoute.gateway.namespace: another-namespace |
| 47 | + asserts: |
| 48 | + - equal: |
| 49 | + path: spec.parentRefs[0].namespace |
| 50 | + value: openshell |
| 51 | + |
| 52 | + - it: renders an arbitrary GatewayClass and explicit Gateway name |
| 53 | + template: templates/gateway.yaml |
| 54 | + set: |
| 55 | + grpcRoute.enabled: true |
| 56 | + grpcRoute.gateway.create: true |
| 57 | + grpcRoute.gateway.className: custom-class |
| 58 | + grpcRoute.gateway.name: custom-ingress |
| 59 | + asserts: |
| 60 | + - equal: |
| 61 | + path: metadata.name |
| 62 | + value: custom-ingress |
| 63 | + - equal: |
| 64 | + path: spec.gatewayClassName |
| 65 | + value: custom-class |
| 66 | + |
| 67 | + - it: preserves the ingress suffix for a long chart fullname |
| 68 | + template: templates/gateway.yaml |
| 69 | + set: |
| 70 | + fullnameOverride: abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijk |
| 71 | + grpcRoute.enabled: true |
| 72 | + grpcRoute.gateway.create: true |
| 73 | + asserts: |
| 74 | + - equal: |
| 75 | + path: metadata.name |
| 76 | + value: abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabc-ingress |
| 77 | + |
| 78 | + - it: attaches to a listener on an existing Gateway |
| 79 | + template: templates/grpcroute.yaml |
| 80 | + set: |
| 81 | + grpcRoute.enabled: true |
| 82 | + grpcRoute.gateway.create: false |
| 83 | + grpcRoute.gateway.name: platform-gateway |
| 84 | + grpcRoute.gateway.namespace: gateway-system |
| 85 | + grpcRoute.gateway.sectionName: grpc |
| 86 | + asserts: |
| 87 | + - equal: |
| 88 | + path: spec.parentRefs[0].name |
| 89 | + value: platform-gateway |
| 90 | + - equal: |
| 91 | + path: spec.parentRefs[0].namespace |
| 92 | + value: gateway-system |
| 93 | + - equal: |
| 94 | + path: spec.parentRefs[0].sectionName |
| 95 | + value: grpc |
| 96 | + |
| 97 | + - it: does not create a Gateway when attaching to an existing Gateway |
| 98 | + template: templates/gateway.yaml |
| 99 | + set: |
| 100 | + grpcRoute.enabled: true |
| 101 | + grpcRoute.gateway.create: false |
| 102 | + grpcRoute.gateway.name: platform-gateway |
| 103 | + asserts: |
| 104 | + - hasDocuments: |
| 105 | + count: 0 |
0 commit comments