mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-04 08:57:04 +02:00
130 lines
3.1 KiB
YAML
130 lines
3.1 KiB
YAML
---
|
|
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
|
|
suite: controller revisionHistoryLimit
|
|
templates:
|
|
- common.yaml
|
|
values:
|
|
- ../_values/controllers_main_default_container.yaml
|
|
tests:
|
|
# Deployment
|
|
- it: default should pass for Deployment
|
|
set:
|
|
controllers.main.type: deployment
|
|
asserts:
|
|
- documentIndex: 0
|
|
isKind:
|
|
of: Deployment
|
|
- documentIndex: 0
|
|
equal:
|
|
path: spec.revisionHistoryLimit
|
|
value: 3
|
|
|
|
- it: custom revisionHistoryLimit should pass for Deployment
|
|
set:
|
|
controllers.main:
|
|
type: deployment
|
|
revisionHistoryLimit: 8
|
|
asserts:
|
|
- documentIndex: 0
|
|
isKind:
|
|
of: Deployment
|
|
- documentIndex: 0
|
|
equal:
|
|
path: spec.revisionHistoryLimit
|
|
value: 8
|
|
|
|
- it: explicit revisionHistoryLimit 0 should pass for Deployment
|
|
set:
|
|
controllers.main:
|
|
type: deployment
|
|
revisionHistoryLimit: 0
|
|
asserts:
|
|
- documentIndex: 0
|
|
isKind:
|
|
of: Deployment
|
|
- documentIndex: 0
|
|
equal:
|
|
path: spec.revisionHistoryLimit
|
|
value: 0
|
|
|
|
# StatefulSet
|
|
- it: default should pass for StatefulSet
|
|
set:
|
|
controllers.main.type: statefulset
|
|
asserts:
|
|
- documentIndex: 0
|
|
isKind:
|
|
of: StatefulSet
|
|
- documentIndex: 0
|
|
equal:
|
|
path: spec.revisionHistoryLimit
|
|
value: 3
|
|
|
|
- it: custom revisionHistoryLimit should pass for StatefulSet
|
|
set:
|
|
controllers.main:
|
|
type: statefulset
|
|
revisionHistoryLimit: 8
|
|
asserts:
|
|
- documentIndex: 0
|
|
isKind:
|
|
of: StatefulSet
|
|
- documentIndex: 0
|
|
equal:
|
|
path: spec.revisionHistoryLimit
|
|
value: 8
|
|
|
|
- it: explicit revisionHistoryLimit 0 should pass for StatefulSet
|
|
set:
|
|
controllers.main:
|
|
type: statefulset
|
|
revisionHistoryLimit: 0
|
|
asserts:
|
|
- documentIndex: 0
|
|
isKind:
|
|
of: StatefulSet
|
|
- documentIndex: 0
|
|
equal:
|
|
path: spec.revisionHistoryLimit
|
|
value: 0
|
|
|
|
# DaemonSet
|
|
- it: default should pass for DaemonSet
|
|
set:
|
|
controllers.main.type: daemonset
|
|
asserts:
|
|
- documentIndex: 0
|
|
isKind:
|
|
of: DaemonSet
|
|
- documentIndex: 0
|
|
equal:
|
|
path: spec.revisionHistoryLimit
|
|
value: 3
|
|
|
|
- it: custom revisionHistoryLimit should pass for DaemonSet
|
|
set:
|
|
controllers.main:
|
|
type: daemonset
|
|
revisionHistoryLimit: 8
|
|
asserts:
|
|
- documentIndex: 0
|
|
isKind:
|
|
of: DaemonSet
|
|
- documentIndex: 0
|
|
equal:
|
|
path: spec.revisionHistoryLimit
|
|
value: 8
|
|
|
|
- it: explicit revisionHistoryLimit 0 should pass for DaemonSet
|
|
set:
|
|
controllers.main:
|
|
type: daemonset
|
|
revisionHistoryLimit: 0
|
|
asserts:
|
|
- documentIndex: 0
|
|
isKind:
|
|
of: DaemonSet
|
|
- documentIndex: 0
|
|
equal:
|
|
path: spec.revisionHistoryLimit
|
|
value: 0
|