From 9dfb5cae07ef22cd076f237302a5974aa2f1929e Mon Sep 17 00:00:00 2001 From: Stavros kois Date: Wed, 9 Nov 2022 13:16:20 +0200 Subject: [PATCH] expand test a bit --- .../tests/pod/deployment-test.yaml | 17 --------- .../tests/pods/deployment-test.yaml | 38 +++++++++++++++++++ .../1.0.0/templates/lib/chart/_names.tpl | 2 +- 3 files changed, 39 insertions(+), 18 deletions(-) delete mode 100644 library/common-test/tests/pod/deployment-test.yaml create mode 100644 library/common-test/tests/pods/deployment-test.yaml diff --git a/library/common-test/tests/pod/deployment-test.yaml b/library/common-test/tests/pod/deployment-test.yaml deleted file mode 100644 index e72f0e9086..0000000000 --- a/library/common-test/tests/pod/deployment-test.yaml +++ /dev/null @@ -1,17 +0,0 @@ -suite: pod deployment -templates: - - common.yaml -tests: - - it: default values should pass - asserts: - - hasDocuments: - count: 1 - - documentIndex: 0 - isKind: - of: Deployment - - equal: - path: apiVersion - value: apps/v1 - - equal: - path: metadata.name - value: RELEASE-NAME-common-test diff --git a/library/common-test/tests/pods/deployment-test.yaml b/library/common-test/tests/pods/deployment-test.yaml new file mode 100644 index 0000000000..dd0565b77a --- /dev/null +++ b/library/common-test/tests/pods/deployment-test.yaml @@ -0,0 +1,38 @@ +suite: pod deployment +templates: + - common.yaml +tests: + - it: should pass with default values + asserts: + - hasDocuments: + count: 1 + - documentIndex: &deploymentDoc 0 + isKind: + of: Deployment + - equal: + documentIndex: *deploymentDoc + path: apiVersion + value: apps/v1 + - equal: + documentIndex: *deploymentDoc + path: metadata.name + value: RELEASE-NAME-common-test + + - it: should pass with nameOverride + set: + nameOverride: overrodeName + asserts: + - equal: + documentIndex: *deploymentDoc + path: metadata.name + value: RELEASE-NAME-overrodeName + + - it: should pass with global.nameOverride + set: + nameOverride: overrodeName + global.nameOverride: globalOverrodeName + asserts: + - equal: + documentIndex: *deploymentDoc + path: metadata.name + value: RELEASE-NAME-globalOverrodeName diff --git a/library/common/1.0.0/templates/lib/chart/_names.tpl b/library/common/1.0.0/templates/lib/chart/_names.tpl index 957020abfc..f0e0df783c 100644 --- a/library/common/1.0.0/templates/lib/chart/_names.tpl +++ b/library/common/1.0.0/templates/lib/chart/_names.tpl @@ -59,7 +59,7 @@ Create the "fqdn" + "." + "svc.cluster.local" {{/* TODO: See if it's needed -Return the properly cased vresion of the controller type +Return the properly cased version of the controller type */}} {{- define "ix.v1.common.names.controllerType" -}} {{- if eq (.Values.controller.type | lower) "deployment" -}}