mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-04 08:57:04 +02:00
feat(common): Release version 2.0.0-beta.1 (#173)
This commit is contained in:
parent
19767d668c
commit
7b6ee00be6
189 changed files with 3110 additions and 3023 deletions
110
charts/library/common-test/tests/secret/metadata_test.yaml
Normal file
110
charts/library/common-test/tests/secret/metadata_test.yaml
Normal file
|
@ -0,0 +1,110 @@
|
|||
suite: secret metadata
|
||||
templates:
|
||||
- common.yaml
|
||||
tests:
|
||||
- it: default metadata should pass
|
||||
set:
|
||||
secrets:
|
||||
secret:
|
||||
enabled: true
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 3
|
||||
- documentIndex: &SecretDocument 2
|
||||
isKind:
|
||||
of: Secret
|
||||
- documentIndex: *SecretDocument
|
||||
isNull:
|
||||
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:
|
||||
enabled: true
|
||||
annotations:
|
||||
test_annotation: test
|
||||
labels:
|
||||
test_label: test
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 3
|
||||
- documentIndex: &SecretDocument 2
|
||||
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:
|
||||
enabled: true
|
||||
annotations:
|
||||
test_annotation: test
|
||||
labels:
|
||||
test_label: test
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 3
|
||||
- documentIndex: &SecretDocument 2
|
||||
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:
|
||||
enabled: true
|
||||
type: &type kubernetes.io/service-account-token
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 3
|
||||
- documentIndex: &SecretDocument 2
|
||||
isKind:
|
||||
of: Secret
|
||||
- documentIndex: *SecretDocument
|
||||
equal:
|
||||
path: type
|
||||
value: *type
|
91
charts/library/common-test/tests/secret/names_test.yaml
Normal file
91
charts/library/common-test/tests/secret/names_test.yaml
Normal file
|
@ -0,0 +1,91 @@
|
|||
suite: secret names
|
||||
templates:
|
||||
- common.yaml
|
||||
tests:
|
||||
- it: default should pass
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 2
|
||||
- documentIndex: 0
|
||||
not: true
|
||||
isKind:
|
||||
of: Secret
|
||||
- documentIndex: 1
|
||||
not: true
|
||||
isKind:
|
||||
of: Secret
|
||||
|
||||
- it: with disabled secret should pass
|
||||
set:
|
||||
secrets:
|
||||
secret:
|
||||
enabled: false
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 2
|
||||
- documentIndex: 0
|
||||
not: true
|
||||
isKind:
|
||||
of: Secret
|
||||
- documentIndex: 1
|
||||
not: true
|
||||
isKind:
|
||||
of: Secret
|
||||
|
||||
- it: with multiple secrets should pass
|
||||
set:
|
||||
secrets:
|
||||
secret:
|
||||
enabled: true
|
||||
data:
|
||||
foo: bar
|
||||
secondary:
|
||||
enabled: true
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 4
|
||||
- documentIndex: &FirstSecretDocument 2
|
||||
isKind:
|
||||
of: Secret
|
||||
- documentIndex: *FirstSecretDocument
|
||||
isNotNull:
|
||||
path: metadata.name
|
||||
- documentIndex: &SecondSecretDocument 3
|
||||
isKind:
|
||||
of: Secret
|
||||
- documentIndex: *SecondSecretDocument
|
||||
isNotNull:
|
||||
path: metadata.name
|
||||
|
||||
- it: default name should pass
|
||||
set:
|
||||
secrets:
|
||||
secret:
|
||||
enabled: true
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 3
|
||||
- documentIndex: &SecretDocument 2
|
||||
isKind:
|
||||
of: Secret
|
||||
- documentIndex: *SecretDocument
|
||||
equal:
|
||||
path: metadata.name
|
||||
value: RELEASE-NAME-secret
|
||||
|
||||
- it: with nameOverride should pass
|
||||
set:
|
||||
secrets:
|
||||
secret:
|
||||
enabled: true
|
||||
nameOverride: http
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 3
|
||||
- documentIndex: &SecretDocument 2
|
||||
isKind:
|
||||
of: Secret
|
||||
- documentIndex: *SecretDocument
|
||||
equal:
|
||||
path: metadata.name
|
||||
value: RELEASE-NAME-http
|
|
@ -0,0 +1,25 @@
|
|||
suite: secret Pod metadata
|
||||
templates:
|
||||
- common.yaml
|
||||
tests:
|
||||
- it: default metadata should pass
|
||||
set:
|
||||
secrets:
|
||||
secret_1:
|
||||
enabled: true
|
||||
data:
|
||||
test: value 1
|
||||
secret_2:
|
||||
enabled: true
|
||||
data:
|
||||
test_1: value 1
|
||||
test_2: value 2
|
||||
asserts:
|
||||
- documentIndex: &ControllerDoc 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *ControllerDoc
|
||||
equal:
|
||||
path: spec.template.metadata.annotations
|
||||
value:
|
||||
checksum/secrets: 4107837201f46be5279f7accdf3942edabd38f0eb534a61c91d2d7cba7ffc557
|
Loading…
Add table
Add a link
Reference in a new issue