mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-04 17:07:04 +02:00
More paving the way
This commit is contained in:
parent
33f207c563
commit
4863146ad9
62 changed files with 2761 additions and 13 deletions
|
@ -0,0 +1,83 @@
|
|||
suite: ingress metadata
|
||||
templates:
|
||||
- common.yaml
|
||||
tests:
|
||||
- it: default metadata should pass
|
||||
set:
|
||||
ingress.main.enabled: true
|
||||
asserts:
|
||||
- documentIndex: &IngressDocument 2
|
||||
isKind:
|
||||
of: Ingress
|
||||
- documentIndex: *IngressDocument
|
||||
isNull:
|
||||
path: metadata.annotations
|
||||
- documentIndex: *IngressDocument
|
||||
equal:
|
||||
path: metadata.labels
|
||||
value:
|
||||
app.kubernetes.io/instance: RELEASE-NAME
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/name: common-test
|
||||
helm.sh/chart: common-test-0.1.0
|
||||
|
||||
- it: custom metadata should pass
|
||||
set:
|
||||
ingress.main:
|
||||
enabled: true
|
||||
annotations:
|
||||
test_annotation: test
|
||||
labels:
|
||||
test_label: test
|
||||
asserts:
|
||||
- documentIndex: &IngressDocument 2
|
||||
isKind:
|
||||
of: Ingress
|
||||
- documentIndex: *IngressDocument
|
||||
equal:
|
||||
path: metadata.annotations
|
||||
value:
|
||||
test_annotation: test
|
||||
- documentIndex: *IngressDocument
|
||||
equal:
|
||||
path: metadata.labels
|
||||
value:
|
||||
app.kubernetes.io/instance: RELEASE-NAME
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/name: common-test
|
||||
helm.sh/chart: common-test-0.1.0
|
||||
test_label: test
|
||||
|
||||
- it: custom metadata with global metadata should pass
|
||||
set:
|
||||
global:
|
||||
labels:
|
||||
global_label: test
|
||||
annotations:
|
||||
global_annotation: test
|
||||
ingress.main:
|
||||
enabled: true
|
||||
annotations:
|
||||
test_annotation: test
|
||||
labels:
|
||||
test_label: test
|
||||
asserts:
|
||||
- documentIndex: &IngressDocument 2
|
||||
isKind:
|
||||
of: Ingress
|
||||
- documentIndex: *IngressDocument
|
||||
equal:
|
||||
path: metadata.annotations
|
||||
value:
|
||||
global_annotation: test
|
||||
test_annotation: test
|
||||
- documentIndex: *IngressDocument
|
||||
equal:
|
||||
path: metadata.labels
|
||||
value:
|
||||
app.kubernetes.io/instance: RELEASE-NAME
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/name: common-test
|
||||
global_label: test
|
||||
helm.sh/chart: common-test-0.1.0
|
||||
test_label: test
|
|
@ -0,0 +1,71 @@
|
|||
suite: ingress presence
|
||||
templates:
|
||||
- common.yaml
|
||||
tests:
|
||||
- it: default should pass
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 2
|
||||
- documentIndex: 0
|
||||
not: true
|
||||
isKind:
|
||||
of: Ingress
|
||||
- documentIndex: 1
|
||||
not: true
|
||||
isKind:
|
||||
of: Ingress
|
||||
|
||||
- it: explicitly disabled should pass
|
||||
set:
|
||||
ingress.main.enabled: false
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 2
|
||||
- documentIndex: 0
|
||||
not: true
|
||||
isKind:
|
||||
of: Ingress
|
||||
- documentIndex: 1
|
||||
not: true
|
||||
isKind:
|
||||
of: Ingress
|
||||
|
||||
- it: explicitly enabled should pass
|
||||
set:
|
||||
ingress.main.enabled: true
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 3
|
||||
- documentIndex: 0
|
||||
not: true
|
||||
isKind:
|
||||
of: Ingress
|
||||
- documentIndex: 1
|
||||
not: true
|
||||
isKind:
|
||||
of: Ingress
|
||||
- documentIndex: 2
|
||||
isKind:
|
||||
of: Ingress
|
||||
|
||||
- it: multiple enabled should pass
|
||||
set:
|
||||
ingress.main.enabled: true
|
||||
ingress.test.enabled: true
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 4
|
||||
- documentIndex: 0
|
||||
not: true
|
||||
isKind:
|
||||
of: Ingress
|
||||
- documentIndex: 1
|
||||
not: true
|
||||
isKind:
|
||||
of: Ingress
|
||||
- documentIndex: 2
|
||||
isKind:
|
||||
of: Ingress
|
||||
- documentIndex: 3
|
||||
isKind:
|
||||
of: Ingress
|
|
@ -0,0 +1,39 @@
|
|||
suite: ingress service reference
|
||||
templates:
|
||||
- common.yaml
|
||||
tests:
|
||||
- it: default should pass
|
||||
set:
|
||||
ingress.main.enabled: true
|
||||
asserts:
|
||||
- documentIndex: &IngressDocument 2
|
||||
isKind:
|
||||
of: Ingress
|
||||
- documentIndex: *IngressDocument
|
||||
equal:
|
||||
path: spec.rules[0].http.paths[0].backend
|
||||
value:
|
||||
serviceName: RELEASE-NAME-common-test
|
||||
servicePort: null
|
||||
|
||||
- it: custom service reference should pass
|
||||
set:
|
||||
ingress.main:
|
||||
enabled: true
|
||||
hosts:
|
||||
- host: chart-test.local
|
||||
paths:
|
||||
- path: /
|
||||
service:
|
||||
name: pathService
|
||||
port: 1234
|
||||
asserts:
|
||||
- documentIndex: &IngressDocument 2
|
||||
isKind:
|
||||
of: Ingress
|
||||
- documentIndex: *IngressDocument
|
||||
equal:
|
||||
path: spec.rules[0].http.paths[0].backend
|
||||
value:
|
||||
serviceName: pathService
|
||||
servicePort: 1234
|
72
charts/other/kah-common-chart/tests/ingress/tls_test.yaml
Normal file
72
charts/other/kah-common-chart/tests/ingress/tls_test.yaml
Normal file
|
@ -0,0 +1,72 @@
|
|||
suite: ingress tls
|
||||
templates:
|
||||
- common.yaml
|
||||
tests:
|
||||
- it: default should pass
|
||||
set:
|
||||
ingress.main.enabled: true
|
||||
asserts:
|
||||
- documentIndex: &IngressDocument 2
|
||||
isKind:
|
||||
of: Ingress
|
||||
- documentIndex: *IngressDocument
|
||||
isNull:
|
||||
path: spec.tls
|
||||
|
||||
- it: tls enabled should pass
|
||||
set:
|
||||
ingress.main:
|
||||
enabled: true
|
||||
tls:
|
||||
- secretName: test
|
||||
hosts:
|
||||
- hostname
|
||||
asserts:
|
||||
- documentIndex: &IngressDocument 2
|
||||
isKind:
|
||||
of: Ingress
|
||||
- documentIndex: *IngressDocument
|
||||
equal:
|
||||
path: spec.tls[0]
|
||||
value:
|
||||
secretName: test
|
||||
hosts:
|
||||
- hostname
|
||||
|
||||
- it: tls enabled without secret should pass
|
||||
set:
|
||||
ingress.main:
|
||||
enabled: true
|
||||
tls:
|
||||
- hosts:
|
||||
- hostname
|
||||
asserts:
|
||||
- documentIndex: &IngressDocument 2
|
||||
isKind:
|
||||
of: Ingress
|
||||
- documentIndex: *IngressDocument
|
||||
equal:
|
||||
path: spec.tls[0]
|
||||
value:
|
||||
hosts:
|
||||
- hostname
|
||||
|
||||
- it: tls enabled with secret template should pass
|
||||
set:
|
||||
ingress.main:
|
||||
enabled: true
|
||||
tls:
|
||||
- secretName: "{{ .Release.Name }}-secret"
|
||||
hosts:
|
||||
- hostname
|
||||
asserts:
|
||||
- documentIndex: &IngressDocument 2
|
||||
isKind:
|
||||
of: Ingress
|
||||
- documentIndex: *IngressDocument
|
||||
equal:
|
||||
path: spec.tls[0]
|
||||
value:
|
||||
secretName: RELEASE-NAME-secret
|
||||
hosts:
|
||||
- hostname
|
72
charts/other/kah-common-chart/tests/ingress/values_test.yaml
Normal file
72
charts/other/kah-common-chart/tests/ingress/values_test.yaml
Normal file
|
@ -0,0 +1,72 @@
|
|||
suite: ingress values
|
||||
templates:
|
||||
- common.yaml
|
||||
tests:
|
||||
- it: default should pass
|
||||
set:
|
||||
ingress.main.enabled: true
|
||||
asserts:
|
||||
- documentIndex: &IngressDocument 2
|
||||
isKind:
|
||||
of: Ingress
|
||||
- documentIndex: *IngressDocument
|
||||
equal:
|
||||
path: spec.rules[0].host
|
||||
value: chart-example.local
|
||||
- documentIndex: *IngressDocument
|
||||
equal:
|
||||
path: spec.rules[0].http.paths[0].path
|
||||
value: "/"
|
||||
|
||||
- it: custom host and path should pass
|
||||
set:
|
||||
ingress.main:
|
||||
enabled: true
|
||||
hosts:
|
||||
- host: chart-test.local
|
||||
paths:
|
||||
- path: /test
|
||||
asserts:
|
||||
- documentIndex: &IngressDocument 2
|
||||
isKind:
|
||||
of: Ingress
|
||||
- documentIndex: *IngressDocument
|
||||
equal:
|
||||
path: spec.rules[0].host
|
||||
value: chart-test.local
|
||||
- documentIndex: *IngressDocument
|
||||
equal:
|
||||
path: spec.rules[0].http.paths[0].path
|
||||
value: "/test"
|
||||
|
||||
- it: host with template should pass
|
||||
set:
|
||||
ingress.main:
|
||||
enabled: true
|
||||
hosts:
|
||||
- host: "{{ .Release.Name }}.hostname"
|
||||
asserts:
|
||||
- documentIndex: &IngressDocument 2
|
||||
isKind:
|
||||
of: Ingress
|
||||
- documentIndex: *IngressDocument
|
||||
equal:
|
||||
path: spec.rules[0].host
|
||||
value: RELEASE-NAME.hostname
|
||||
|
||||
- it: path with template should pass
|
||||
set:
|
||||
ingress.main:
|
||||
enabled: true
|
||||
hosts:
|
||||
- host: chart-test.local
|
||||
paths:
|
||||
- path: "/{{ .Release.Name }}.path"
|
||||
asserts:
|
||||
- documentIndex: &IngressDocument 2
|
||||
isKind:
|
||||
of: Ingress
|
||||
- documentIndex: *IngressDocument
|
||||
equal:
|
||||
path: spec.rules[0].http.paths[0].path
|
||||
value: "/RELEASE-NAME.path"
|
Loading…
Add table
Add a link
Reference in a new issue