helm-charts/charts/other/app-template/tests/route/metadata_test.yaml
Bᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs 8106004a7c
fix: Don't render disabled services
2022-11-19 15:30:44 +01:00

93 lines
2.5 KiB
YAML

suite: route metadata
templates:
- common.yaml
tests:
- it: default metadata should pass
set:
route.main:
enabled: true
parentRefs:
- name: test
namespace: test
asserts:
- documentIndex: &routeDocument 2
isKind:
of: HTTPRoute
- documentIndex: *routeDocument
isNull:
path: metadata.annotations
- documentIndex: *routeDocument
equal:
path: metadata.labels
value:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: RELEASE-NAME
helm.sh/chart: app-template-1.1.3
- it: custom metadata should pass
set:
route.main:
enabled: true
annotations:
test_annotation: test
labels:
test_label: test
parentRefs:
- name: test
namespace: test
asserts:
- documentIndex: &routeDocument 2
isKind:
of: HTTPRoute
- documentIndex: *routeDocument
equal:
path: metadata.annotations
value:
test_annotation: test
- documentIndex: *routeDocument
equal:
path: metadata.labels
value:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: RELEASE-NAME
helm.sh/chart: app-template-1.1.3
test_label: test
- it: custom metadata with global metadata should pass
set:
global:
labels:
global_label: test
annotations:
global_annotation: test
route.main:
enabled: true
annotations:
test_annotation: test
labels:
test_label: test
parentRefs:
- name: test
namespace: test
asserts:
- documentIndex: &routeDocument 2
isKind:
of: HTTPRoute
- documentIndex: *routeDocument
equal:
path: metadata.annotations
value:
global_annotation: test
test_annotation: test
- documentIndex: *routeDocument
equal:
path: metadata.labels
value:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: RELEASE-NAME
global_label: test
helm.sh/chart: app-template-1.1.3
test_label: test