mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-04 08:57:04 +02:00
feat(common): Release common library 3.7.1 (#383)
Co-authored-by: Aisling McGinn <me@aisling.dev>
This commit is contained in:
parent
c94a28baa3
commit
433f6d132b
146 changed files with 232 additions and 222 deletions
|
@ -0,0 +1,118 @@
|
|||
---
|
||||
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
|
||||
suite: secret metadata
|
||||
templates:
|
||||
- common.yaml
|
||||
values:
|
||||
- ../_values/controllers_main_default_container.yaml
|
||||
tests:
|
||||
- it: default metadata should pass
|
||||
set:
|
||||
secrets:
|
||||
secret:
|
||||
stringData:
|
||||
test: test
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 2
|
||||
- documentIndex: &SecretDocument 1
|
||||
isKind:
|
||||
of: Secret
|
||||
- documentIndex: *SecretDocument
|
||||
notExists:
|
||||
path: metadata.annotations
|
||||
- documentIndex: *SecretDocument
|
||||
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:
|
||||
secrets:
|
||||
secret:
|
||||
stringData:
|
||||
test: test
|
||||
annotations:
|
||||
test_annotation: test
|
||||
labels:
|
||||
test_label: test
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 2
|
||||
- documentIndex: &SecretDocument 1
|
||||
isKind:
|
||||
of: Secret
|
||||
- documentIndex: *SecretDocument
|
||||
equal:
|
||||
path: metadata.annotations
|
||||
value:
|
||||
test_annotation: test
|
||||
- documentIndex: *SecretDocument
|
||||
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
|
||||
secrets:
|
||||
secret:
|
||||
stringData:
|
||||
test: test
|
||||
annotations:
|
||||
test_annotation: test
|
||||
labels:
|
||||
test_label: test
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 2
|
||||
- documentIndex: &SecretDocument 1
|
||||
isKind:
|
||||
of: Secret
|
||||
- documentIndex: *SecretDocument
|
||||
equal:
|
||||
path: metadata.annotations
|
||||
value:
|
||||
global_annotation: test
|
||||
test_annotation: test
|
||||
- documentIndex: *SecretDocument
|
||||
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
|
||||
|
||||
- it: custom secret type should pass
|
||||
set:
|
||||
secrets:
|
||||
secret:
|
||||
stringData:
|
||||
test: test
|
||||
type: &type kubernetes.io/service-account-token
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 2
|
||||
- documentIndex: &SecretDocument 1
|
||||
isKind:
|
||||
of: Secret
|
||||
- documentIndex: *SecretDocument
|
||||
equal:
|
||||
path: type
|
||||
value: *type
|
|
@ -0,0 +1,93 @@
|
|||
---
|
||||
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
|
||||
suite: secret names
|
||||
templates:
|
||||
- common.yaml
|
||||
values:
|
||||
- ../_values/controllers_main_default_container.yaml
|
||||
tests:
|
||||
- it: default should pass
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 1
|
||||
- documentIndex: 0
|
||||
not: true
|
||||
isKind:
|
||||
of: Secret
|
||||
|
||||
- it: with disabled secret should pass
|
||||
set:
|
||||
secrets:
|
||||
secret:
|
||||
enabled: false
|
||||
stringData:
|
||||
test: test
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 1
|
||||
- documentIndex: 0
|
||||
not: true
|
||||
isKind:
|
||||
of: Secret
|
||||
|
||||
- it: with multiple secrets should pass
|
||||
set:
|
||||
secrets:
|
||||
secret:
|
||||
enabled: true
|
||||
stringData:
|
||||
foo: bar
|
||||
secondary:
|
||||
enabled: true
|
||||
stringData:
|
||||
test: test
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 3
|
||||
- documentIndex: &FirstSecretDocument 1
|
||||
isKind:
|
||||
of: Secret
|
||||
- documentIndex: *FirstSecretDocument
|
||||
isNotNullOrEmpty:
|
||||
path: metadata.name
|
||||
- documentIndex: &SecondSecretDocument 2
|
||||
isKind:
|
||||
of: Secret
|
||||
- documentIndex: *SecondSecretDocument
|
||||
isNotNullOrEmpty:
|
||||
path: metadata.name
|
||||
|
||||
- it: default name should pass
|
||||
set:
|
||||
secrets:
|
||||
secret:
|
||||
stringData:
|
||||
test: test
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 2
|
||||
- documentIndex: &SecretDocument 1
|
||||
isKind:
|
||||
of: Secret
|
||||
- documentIndex: *SecretDocument
|
||||
equal:
|
||||
path: metadata.name
|
||||
value: RELEASE-NAME-secret
|
||||
|
||||
- it: with nameOverride should pass
|
||||
set:
|
||||
secrets:
|
||||
secret:
|
||||
stringData:
|
||||
test: test
|
||||
nameOverride: http
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 2
|
||||
- documentIndex: &SecretDocument 1
|
||||
isKind:
|
||||
of: Secret
|
||||
- documentIndex: *SecretDocument
|
||||
equal:
|
||||
path: metadata.name
|
||||
value: RELEASE-NAME-http
|
|
@ -0,0 +1,35 @@
|
|||
---
|
||||
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
|
||||
suite: secret Pod metadata
|
||||
templates:
|
||||
- common.yaml
|
||||
values:
|
||||
- ../_values/controllers_main_default_container.yaml
|
||||
tests:
|
||||
- it: default metadata should pass
|
||||
set:
|
||||
secrets:
|
||||
secret_1:
|
||||
stringData:
|
||||
test: value 1
|
||||
secret_2: # default enabled
|
||||
stringData:
|
||||
test_1: value 1
|
||||
test_2: value 2
|
||||
test_not_in_checksum:
|
||||
includeInChecksum: false
|
||||
stringData:
|
||||
test: value 1
|
||||
test_disabled:
|
||||
enabled: false
|
||||
stringData:
|
||||
test: value 1
|
||||
asserts:
|
||||
- documentIndex: &ControllerDoc 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *ControllerDoc
|
||||
equal:
|
||||
path: spec.template.metadata.annotations
|
||||
value:
|
||||
checksum/secrets: cd4e5076088172611ca1c43c659a275232d9eeb887acc20575ac141038b9aacb
|
Loading…
Add table
Add a link
Reference in a new issue