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: controller metadata daemonset
|
||||
templates:
|
||||
- common.yaml
|
||||
tests:
|
||||
- it: default metadata should pass
|
||||
set:
|
||||
controller.type: daemonset
|
||||
asserts:
|
||||
- documentIndex: &ControllerDoc 0
|
||||
isKind:
|
||||
of: DaemonSet
|
||||
- documentIndex: *ControllerDoc
|
||||
isNull:
|
||||
path: metadata.annotations
|
||||
- documentIndex: *ControllerDoc
|
||||
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:
|
||||
controller:
|
||||
type: daemonset
|
||||
annotations:
|
||||
test_annotation: test
|
||||
labels:
|
||||
test_label: test
|
||||
asserts:
|
||||
- documentIndex: &ControllerDoc 0
|
||||
isKind:
|
||||
of: DaemonSet
|
||||
- documentIndex: *ControllerDoc
|
||||
equal:
|
||||
path: metadata.annotations
|
||||
value:
|
||||
test_annotation: test
|
||||
- documentIndex: *ControllerDoc
|
||||
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
|
||||
controller:
|
||||
type: daemonset
|
||||
annotations:
|
||||
test_annotation: test
|
||||
labels:
|
||||
test_label: test
|
||||
asserts:
|
||||
- documentIndex: &ControllerDoc 0
|
||||
isKind:
|
||||
of: DaemonSet
|
||||
- documentIndex: *ControllerDoc
|
||||
equal:
|
||||
path: metadata.annotations
|
||||
value:
|
||||
global_annotation: test
|
||||
test_annotation: test
|
||||
- documentIndex: *ControllerDoc
|
||||
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,83 @@
|
|||
suite: controller metadata deployment
|
||||
templates:
|
||||
- common.yaml
|
||||
tests:
|
||||
- it: default metadata should pass
|
||||
set:
|
||||
controller.type: deployment
|
||||
asserts:
|
||||
- documentIndex: &ControllerDoc 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *ControllerDoc
|
||||
isNull:
|
||||
path: metadata.annotations
|
||||
- documentIndex: *ControllerDoc
|
||||
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:
|
||||
controller:
|
||||
type: deployment
|
||||
annotations:
|
||||
test_annotation: test
|
||||
labels:
|
||||
test_label: test
|
||||
asserts:
|
||||
- documentIndex: &ControllerDoc 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *ControllerDoc
|
||||
equal:
|
||||
path: metadata.annotations
|
||||
value:
|
||||
test_annotation: test
|
||||
- documentIndex: *ControllerDoc
|
||||
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
|
||||
controller:
|
||||
type: deployment
|
||||
annotations:
|
||||
test_annotation: test
|
||||
labels:
|
||||
test_label: test
|
||||
asserts:
|
||||
- documentIndex: &ControllerDoc 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *ControllerDoc
|
||||
equal:
|
||||
path: metadata.annotations
|
||||
value:
|
||||
global_annotation: test
|
||||
test_annotation: test
|
||||
- documentIndex: *ControllerDoc
|
||||
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,83 @@
|
|||
suite: controller metadata statefulset
|
||||
templates:
|
||||
- common.yaml
|
||||
tests:
|
||||
- it: default metadata should pass
|
||||
set:
|
||||
controller.type: statefulset
|
||||
asserts:
|
||||
- documentIndex: &ControllerDoc 0
|
||||
isKind:
|
||||
of: StatefulSet
|
||||
- documentIndex: *ControllerDoc
|
||||
isNull:
|
||||
path: metadata.annotations
|
||||
- documentIndex: *ControllerDoc
|
||||
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:
|
||||
controller:
|
||||
type: statefulset
|
||||
annotations:
|
||||
test_annotation: test
|
||||
labels:
|
||||
test_label: test
|
||||
asserts:
|
||||
- documentIndex: &ControllerDoc 0
|
||||
isKind:
|
||||
of: StatefulSet
|
||||
- documentIndex: *ControllerDoc
|
||||
equal:
|
||||
path: metadata.annotations
|
||||
value:
|
||||
test_annotation: test
|
||||
- documentIndex: *ControllerDoc
|
||||
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
|
||||
controller:
|
||||
type: statefulset
|
||||
annotations:
|
||||
test_annotation: test
|
||||
labels:
|
||||
test_label: test
|
||||
asserts:
|
||||
- documentIndex: &ControllerDoc 0
|
||||
isKind:
|
||||
of: StatefulSet
|
||||
- documentIndex: *ControllerDoc
|
||||
equal:
|
||||
path: metadata.annotations
|
||||
value:
|
||||
global_annotation: test
|
||||
test_annotation: test
|
||||
- documentIndex: *ControllerDoc
|
||||
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,56 @@
|
|||
suite: controller types
|
||||
templates:
|
||||
- common.yaml
|
||||
tests:
|
||||
- it: default should pass
|
||||
asserts:
|
||||
- documentIndex: &ControllerDoc 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *ControllerDoc
|
||||
equal:
|
||||
path: metadata.name
|
||||
value: RELEASE-NAME-common-test
|
||||
|
||||
- it: daemonset should pass
|
||||
set:
|
||||
controller.type: daemonset
|
||||
asserts:
|
||||
- documentIndex: &ControllerDoc 0
|
||||
isKind:
|
||||
of: DaemonSet
|
||||
- documentIndex: *ControllerDoc
|
||||
equal:
|
||||
path: metadata.name
|
||||
value: RELEASE-NAME-common-test
|
||||
|
||||
- it: statefulset should pass
|
||||
set:
|
||||
controller.type: statefulset
|
||||
asserts:
|
||||
- documentIndex: &ControllerDoc 0
|
||||
isKind:
|
||||
of: StatefulSet
|
||||
- documentIndex: *ControllerDoc
|
||||
equal:
|
||||
path: metadata.name
|
||||
value: RELEASE-NAME-common-test
|
||||
|
||||
- it: disabled should pass
|
||||
set:
|
||||
controller.enabled: false
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 1
|
||||
- documentIndex: &ControllerDoc 0
|
||||
not: true
|
||||
isKind:
|
||||
of: StatefulSet
|
||||
- documentIndex: *ControllerDoc
|
||||
not: true
|
||||
isKind:
|
||||
of: DaemonSet
|
||||
- documentIndex: *ControllerDoc
|
||||
not: true
|
||||
isKind:
|
||||
of: Controller
|
Loading…
Add table
Add a link
Reference in a new issue