mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-04 00:47:04 +02:00
feat(common): Release v3.3.0 (#335)
This commit is contained in:
parent
040eb7b9d2
commit
74f3170cec
19 changed files with 386 additions and 10 deletions
|
@ -0,0 +1,98 @@
|
|||
---
|
||||
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
|
||||
suite: rawResource metadata
|
||||
templates:
|
||||
- common.yaml
|
||||
values:
|
||||
- ../_values/controllers_main_default_container.yaml
|
||||
set:
|
||||
rawResources:
|
||||
config:
|
||||
apiVersion: v1
|
||||
kind: Endpoint
|
||||
spec:
|
||||
test: test
|
||||
tests:
|
||||
- it: default metadata should pass
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 2
|
||||
- documentIndex: &rawResourceDocument 1
|
||||
isKind:
|
||||
of: Endpoint
|
||||
- documentIndex: *rawResourceDocument
|
||||
notExists:
|
||||
path: metadata.annotations
|
||||
- documentIndex: *rawResourceDocument
|
||||
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: common-test-1.0.0
|
||||
|
||||
- it: custom metadata should pass
|
||||
set:
|
||||
rawResources:
|
||||
config:
|
||||
annotations:
|
||||
test_annotation: test
|
||||
labels:
|
||||
test_label: test
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 2
|
||||
- documentIndex: &rawResourceDocument 1
|
||||
isKind:
|
||||
of: Endpoint
|
||||
- documentIndex: *rawResourceDocument
|
||||
equal:
|
||||
path: metadata.annotations
|
||||
value:
|
||||
test_annotation: test
|
||||
- documentIndex: *rawResourceDocument
|
||||
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: common-test-1.0.0
|
||||
test_label: test
|
||||
|
||||
- it: custom metadata with global metadata should pass
|
||||
set:
|
||||
global:
|
||||
labels:
|
||||
global_label: test
|
||||
annotations:
|
||||
global_annotation: test
|
||||
rawResources:
|
||||
config:
|
||||
annotations:
|
||||
test_annotation: test
|
||||
labels:
|
||||
test_label: test
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 2
|
||||
- documentIndex: &rawResourceDocument 1
|
||||
isKind:
|
||||
of: Endpoint
|
||||
- documentIndex: *rawResourceDocument
|
||||
equal:
|
||||
path: metadata.annotations
|
||||
value:
|
||||
global_annotation: test
|
||||
test_annotation: test
|
||||
- documentIndex: *rawResourceDocument
|
||||
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: common-test-1.0.0
|
||||
test_label: test
|
|
@ -0,0 +1,78 @@
|
|||
---
|
||||
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
|
||||
suite: rawResource values
|
||||
templates:
|
||||
- common.yaml
|
||||
values:
|
||||
- ../_values/controllers_main_default_container.yaml
|
||||
set:
|
||||
rawResources:
|
||||
endpoint:
|
||||
apiVersion: v1
|
||||
kind: Endpoint
|
||||
spec:
|
||||
subsets:
|
||||
- addresses:
|
||||
- ip: 127.0.0.1
|
||||
ports:
|
||||
- name: "{{ .Release.Name }}"
|
||||
port: 443
|
||||
protocol: TCP
|
||||
tests:
|
||||
- it: default should pass
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 2
|
||||
- documentIndex: &rawResourceDocument 1
|
||||
isKind:
|
||||
of: Endpoint
|
||||
- documentIndex: *rawResourceDocument
|
||||
equal:
|
||||
path: subsets[0].addresses[0].ip
|
||||
value: 127.0.0.1
|
||||
|
||||
- it: nameOverride should pass
|
||||
set:
|
||||
rawResources.endpoint:
|
||||
nameOverride: test
|
||||
asserts:
|
||||
- documentIndex: &rawResourceDocument 1
|
||||
isKind:
|
||||
of: Endpoint
|
||||
- documentIndex: *rawResourceDocument
|
||||
equal:
|
||||
path: metadata.name
|
||||
value: RELEASE-NAME-test
|
||||
|
||||
- it: nameOverride with template should pass
|
||||
set:
|
||||
rawResources.endpoint:
|
||||
nameOverride: "{{ .Release.Name }}"
|
||||
asserts:
|
||||
- documentIndex: &rawResourceDocument 1
|
||||
isKind:
|
||||
of: Endpoint
|
||||
- documentIndex: *rawResourceDocument
|
||||
equal:
|
||||
path: metadata.name
|
||||
value: RELEASE-NAME
|
||||
|
||||
- it: spec with template should pass
|
||||
set:
|
||||
rawResources.endpoint:
|
||||
spec:
|
||||
subsets:
|
||||
- addresses:
|
||||
- ip: 127.0.0.1
|
||||
ports:
|
||||
- name: "{{ .Release.Name }}"
|
||||
port: 443
|
||||
protocol: TCP
|
||||
asserts:
|
||||
- documentIndex: &rawResourceDocument 1
|
||||
isKind:
|
||||
of: Endpoint
|
||||
- documentIndex: *rawResourceDocument
|
||||
equal:
|
||||
path: subsets[0].ports[0].name
|
||||
value: RELEASE-NAME
|
Loading…
Add table
Add a link
Reference in a new issue