From 2794cdfc92206878374dc50d113d6027aa0752b4 Mon Sep 17 00:00:00 2001 From: Stavros kois Date: Mon, 13 Feb 2023 13:39:11 +0200 Subject: [PATCH] some cleanup --- .to_be_deleted/common-test/Chart.yaml | 16 - .../common-test/templates/common.yaml | 1 - .../tests/cert/cert_dict_test.yaml | 218 --- .../tests/cert/cert_list_test.yaml | 218 --- .../tests/cert/cert_secret_mount_test.yaml | 447 ------ .../common-test/tests/cert/cert_test.yaml | 185 --- .../tests/configmap/configmap_test.yaml | 616 -------- .../command-arg_test.yaml | 323 ---- .../container_in_deployment/env_from.yaml | 189 --- .../container_in_deployment/env_list.yaml | 223 --- .../container_in_deployment/env_test.yaml | 870 ----------- .../fixedEnv_test.yaml | 460 ------ .../container_in_deployment/image_test.yaml | 145 -- .../lifecycle_test.yaml | 258 ---- .../container_in_deployment/port_test.yaml | 240 --- .../container_in_deployment/probe_test.yaml | 931 ------------ .../resources_test.yaml | 735 --------- .../securityContext_test.yaml | 490 ------ .../various_options_test.yaml | 116 -- .../volumeMounts_test.yaml | 263 ---- .../cronjob_standalone/annotations_test.yaml | 63 - .../cronjob_standalone/controller_test.yaml | 54 - .../cronjob_standalone/default_test.yaml | 155 -- .../cronjob_standalone/generic_test.yaml | 301 ---- .../tests/cronjob_standalone/label_test.yaml | 77 - .../tests/cronjob_standalone/names_test.yaml | 44 - .../tests/daemonset/annotations_test.yaml | 66 - .../tests/daemonset/controller_test.yaml | 67 - .../tests/daemonset/default_test.yaml | 119 -- .../tests/daemonset/generic_test.yaml | 294 ---- .../tests/daemonset/label_test.yaml | 85 -- .../tests/daemonset/names_test.yaml | 44 - .../tests/deployment/annotation_test.yaml | 60 - .../tests/deployment/controller_test.yaml | 107 -- .../tests/deployment/default_test.yaml | 121 -- .../tests/deployment/dns-network_test.yaml | 401 ----- .../tests/deployment/label_test.yaml | 79 - .../tests/deployment/names_test.yaml | 38 - .../deployment/podSecurityContext_test.yaml | 109 -- .../tests/deployment/runtimeClass_test.yaml | 95 -- .../deployment/serviceAccountName_test.yaml | 51 - .../deployment/various_options_test.yaml | 470 ------ .../deployment/volume_configMap_test.yaml | 207 --- .../tests/deployment/volume_custom_test.yaml | 112 -- .../deployment/volume_emptyDir_test.yaml | 114 -- .../deployment/volume_hostPath_test.yaml | 280 ---- .../tests/deployment/volume_ixVols_test.yaml | 145 -- .../tests/deployment/volume_nfs_test.yaml | 68 - .../tests/deployment/volume_pvc_test.yaml | 134 -- .../tests/deployment/volume_secret_test.yaml | 197 --- .../tests/deployment/volume_test.yaml | 24 - .../externalInterfaces_test.yaml | 405 ----- .../image_pull_secrets_test.yaml | 416 ------ ...itional_containers_in_deployment_test.yaml | 1326 ----------------- ...containers_in_deployment_install_test.yaml | 1225 --------------- ...containers_in_deployment_upgrade_test.yaml | 1227 --------------- ...install_containers_in_deployment_test.yaml | 1239 --------------- ...containers_in_deployment_install_copy.yaml | 1225 --------------- ...upgrade_containers_in_deployment_test.yaml | 1242 --------------- .../job_standalone/annotations_test.yaml | 54 - .../tests/job_standalone/controller_test.yaml | 36 - .../tests/job_standalone/default_test.yaml | 135 -- .../tests/job_standalone/generic_test.yaml | 230 --- .../tests/job_standalone/label_test.yaml | 72 - .../tests/job_standalone/names_test.yaml | 38 - .../tests/jobs/cronJobSpecContainer_test.yaml | 1129 -------------- .../common-test/tests/jobs/cronJob_test.yaml | 476 ------ .../tests/jobs/jobSpecContainer_test.yaml | 1021 ------------- .../tests/jobs/jobTemplate_test.yaml | 926 ------------ .../common-test/tests/jobs/job_test.yaml | 127 -- .../tests/lists/deviceList_test.yaml | 70 - .../tests/lists/persistenceList_test.yaml | 106 -- .../tests/lists/serviceList_test.yaml | 180 --- .../tests/portal/portal_host_test.yaml | 279 ---- .../tests/portal/portal_path_test.yaml | 270 ---- .../tests/portal/portal_port_test.yaml | 1139 -------------- .../tests/portal/portal_protocol_test.yaml | 469 ------ .../common-test/tests/portal/portal_test.yaml | 120 -- .../common-test/tests/pvc/pvc_test.yaml | 693 --------- .../common-test/tests/rbac/rbac_test.yaml | 1212 --------------- .../common-test/tests/secret/secret_test.yaml | 679 --------- .../tests/service/service_test.yaml | 401 ----- .../tests/service/service_test_ClusterIP.yaml | 294 ---- .../service/service_test_ExternalIP.yaml | 269 ---- .../service/service_test_ExternalName.yaml | 247 --- .../service/service_test_LoadBalancer.yaml | 378 ----- .../tests/service/service_test_NodePort.yaml | 344 ----- .../tests/service/service_test_hostNet.yaml | 73 - .../serviceAccount/serviceAccount_test.yaml | 164 -- .../tests/statefulset/annotations_test.yaml | 60 - .../tests/statefulset/controller_test.yaml | 74 - .../tests/statefulset/default_test.yaml | 126 -- .../tests/statefulset/generic_test.yaml | 229 --- .../tests/statefulset/label_test.yaml | 79 - .../tests/statefulset/names_test.yaml | 38 - .../tests/statefulset/vct_test.yaml | 125 -- .../tests/utils/utils_primary_port_test.yaml | 116 -- .../tests/utils/utils_primary_rbac_test.yaml | 485 ------ .../utils_primary_serviceAccount_test.yaml | 114 -- .../utils/utils_primary_service_test.yaml | 121 -- .to_be_deleted/common-test/values.yaml | 5 - .to_be_deleted/common/values/annotations.md | 134 -- .to_be_deleted/common/values/certificates.md | 80 - .to_be_deleted/common/values/command-args.md | 141 -- .to_be_deleted/common/values/configmap.md | 48 - .to_be_deleted/common/values/controller.md | 63 - .to_be_deleted/common/values/dns.md | 62 - .../common/values/environment_variable.md | 341 ----- .../common/values/externalInterfaces.md | 67 - .to_be_deleted/common/values/global.md | 138 -- .to_be_deleted/common/values/gpu.md | 48 - .to_be_deleted/common/values/hostNetwork.md | 28 - .to_be_deleted/common/values/host_aliases.md | 34 - .to_be_deleted/common/values/hostname.md | 30 - .to_be_deleted/common/values/image.md | 110 -- .../common/values/imagePullSecrets.md | 35 - .to_be_deleted/common/values/jobs-cronjobs.md | 97 -- .to_be_deleted/common/values/labels.md | 94 -- .to_be_deleted/common/values/lifecycle.md | 88 -- .to_be_deleted/common/values/names.md | 50 - .to_be_deleted/common/values/nodeSelector.md | 33 - .to_be_deleted/common/values/persistence.md | 146 -- .to_be_deleted/common/values/portal.md | 96 -- .../common/values/priorityClassName.md | 30 - .to_be_deleted/common/values/probes.md | 176 --- .to_be_deleted/common/values/rbac.md | 87 -- .to_be_deleted/common/values/resources.md | 73 - .to_be_deleted/common/values/restartPolicy.md | 38 - .../common/values/runtimeClassName.md | 40 - .to_be_deleted/common/values/scheduler.md | 30 - .to_be_deleted/common/values/secret.md | 48 - .to_be_deleted/common/values/security.md | 79 - .../common/values/serviceAccount.md | 48 - .to_be_deleted/common/values/serviceLinks.md | 29 - .to_be_deleted/common/values/stdin.md | 30 - .to_be_deleted/common/values/termination.md | 50 - .to_be_deleted/common/values/tolerations.md | 43 - .to_be_deleted/common/values/tty.md | 30 - .to_be_deleted/common/values/xContainers.md | 167 --- 139 files changed, 35594 deletions(-) delete mode 100644 .to_be_deleted/common-test/Chart.yaml delete mode 100644 .to_be_deleted/common-test/templates/common.yaml delete mode 100644 .to_be_deleted/common-test/tests/cert/cert_dict_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/cert/cert_list_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/cert/cert_secret_mount_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/cert/cert_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/configmap/configmap_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/container_in_deployment/command-arg_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/container_in_deployment/env_from.yaml delete mode 100644 .to_be_deleted/common-test/tests/container_in_deployment/env_list.yaml delete mode 100644 .to_be_deleted/common-test/tests/container_in_deployment/env_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/container_in_deployment/fixedEnv_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/container_in_deployment/image_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/container_in_deployment/lifecycle_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/container_in_deployment/port_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/container_in_deployment/probe_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/container_in_deployment/resources_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/container_in_deployment/securityContext_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/container_in_deployment/various_options_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/container_in_deployment/volumeMounts_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/cronjob_standalone/annotations_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/cronjob_standalone/controller_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/cronjob_standalone/default_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/cronjob_standalone/generic_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/cronjob_standalone/label_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/cronjob_standalone/names_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/daemonset/annotations_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/daemonset/controller_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/daemonset/default_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/daemonset/generic_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/daemonset/label_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/daemonset/names_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/deployment/annotation_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/deployment/controller_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/deployment/default_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/deployment/dns-network_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/deployment/label_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/deployment/names_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/deployment/podSecurityContext_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/deployment/runtimeClass_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/deployment/serviceAccountName_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/deployment/various_options_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/deployment/volume_configMap_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/deployment/volume_custom_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/deployment/volume_emptyDir_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/deployment/volume_hostPath_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/deployment/volume_ixVols_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/deployment/volume_nfs_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/deployment/volume_pvc_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/deployment/volume_secret_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/deployment/volume_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/externalInterfaces/externalInterfaces_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/image_pull_secrets/image_pull_secrets_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/initcontainers_in_deployment/additional_containers_in_deployment_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/initcontainers_in_deployment/init_containers_in_deployment_install_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/initcontainers_in_deployment/init_containers_in_deployment_upgrade_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/initcontainers_in_deployment/install_containers_in_deployment_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/initcontainers_in_deployment/system_containers_in_deployment_install_copy.yaml delete mode 100644 .to_be_deleted/common-test/tests/initcontainers_in_deployment/upgrade_containers_in_deployment_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/job_standalone/annotations_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/job_standalone/controller_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/job_standalone/default_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/job_standalone/generic_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/job_standalone/label_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/job_standalone/names_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/jobs/cronJobSpecContainer_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/jobs/cronJob_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/jobs/jobSpecContainer_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/jobs/jobTemplate_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/jobs/job_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/lists/deviceList_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/lists/persistenceList_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/lists/serviceList_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/portal/portal_host_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/portal/portal_path_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/portal/portal_port_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/portal/portal_protocol_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/portal/portal_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/pvc/pvc_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/rbac/rbac_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/secret/secret_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/service/service_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/service/service_test_ClusterIP.yaml delete mode 100644 .to_be_deleted/common-test/tests/service/service_test_ExternalIP.yaml delete mode 100644 .to_be_deleted/common-test/tests/service/service_test_ExternalName.yaml delete mode 100644 .to_be_deleted/common-test/tests/service/service_test_LoadBalancer.yaml delete mode 100644 .to_be_deleted/common-test/tests/service/service_test_NodePort.yaml delete mode 100644 .to_be_deleted/common-test/tests/service/service_test_hostNet.yaml delete mode 100644 .to_be_deleted/common-test/tests/serviceAccount/serviceAccount_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/statefulset/annotations_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/statefulset/controller_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/statefulset/default_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/statefulset/generic_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/statefulset/label_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/statefulset/names_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/statefulset/vct_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/utils/utils_primary_port_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/utils/utils_primary_rbac_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/utils/utils_primary_serviceAccount_test.yaml delete mode 100644 .to_be_deleted/common-test/tests/utils/utils_primary_service_test.yaml delete mode 100644 .to_be_deleted/common-test/values.yaml delete mode 100644 .to_be_deleted/common/values/annotations.md delete mode 100644 .to_be_deleted/common/values/certificates.md delete mode 100644 .to_be_deleted/common/values/command-args.md delete mode 100644 .to_be_deleted/common/values/configmap.md delete mode 100644 .to_be_deleted/common/values/controller.md delete mode 100644 .to_be_deleted/common/values/dns.md delete mode 100644 .to_be_deleted/common/values/environment_variable.md delete mode 100644 .to_be_deleted/common/values/externalInterfaces.md delete mode 100644 .to_be_deleted/common/values/global.md delete mode 100644 .to_be_deleted/common/values/gpu.md delete mode 100644 .to_be_deleted/common/values/hostNetwork.md delete mode 100644 .to_be_deleted/common/values/host_aliases.md delete mode 100644 .to_be_deleted/common/values/hostname.md delete mode 100644 .to_be_deleted/common/values/image.md delete mode 100644 .to_be_deleted/common/values/imagePullSecrets.md delete mode 100644 .to_be_deleted/common/values/jobs-cronjobs.md delete mode 100644 .to_be_deleted/common/values/labels.md delete mode 100644 .to_be_deleted/common/values/lifecycle.md delete mode 100644 .to_be_deleted/common/values/names.md delete mode 100644 .to_be_deleted/common/values/nodeSelector.md delete mode 100644 .to_be_deleted/common/values/persistence.md delete mode 100644 .to_be_deleted/common/values/portal.md delete mode 100644 .to_be_deleted/common/values/priorityClassName.md delete mode 100644 .to_be_deleted/common/values/probes.md delete mode 100644 .to_be_deleted/common/values/rbac.md delete mode 100644 .to_be_deleted/common/values/resources.md delete mode 100644 .to_be_deleted/common/values/restartPolicy.md delete mode 100644 .to_be_deleted/common/values/runtimeClassName.md delete mode 100644 .to_be_deleted/common/values/scheduler.md delete mode 100644 .to_be_deleted/common/values/secret.md delete mode 100644 .to_be_deleted/common/values/security.md delete mode 100644 .to_be_deleted/common/values/serviceAccount.md delete mode 100644 .to_be_deleted/common/values/serviceLinks.md delete mode 100644 .to_be_deleted/common/values/stdin.md delete mode 100644 .to_be_deleted/common/values/termination.md delete mode 100644 .to_be_deleted/common/values/tolerations.md delete mode 100644 .to_be_deleted/common/values/tty.md delete mode 100644 .to_be_deleted/common/values/xContainers.md diff --git a/.to_be_deleted/common-test/Chart.yaml b/.to_be_deleted/common-test/Chart.yaml deleted file mode 100644 index 95af698921..0000000000 --- a/.to_be_deleted/common-test/Chart.yaml +++ /dev/null @@ -1,16 +0,0 @@ -name: common-test -version: 1.0.0 -apiVersion: v2 -appVersion: v1.0.0 -kubeVersion: '>=1.16.0-0' -description: A chart for the common library chart-testing -home: http://localhost -type: application -icon: https://localhost/icon -dependencies: - - name: common - repository: file://../common/1.0.0 - version: ~1.0.0 -maintainers: - - name: truenas - url: https://www.truenas.com/ diff --git a/.to_be_deleted/common-test/templates/common.yaml b/.to_be_deleted/common-test/templates/common.yaml deleted file mode 100644 index 8b11432b96..0000000000 --- a/.to_be_deleted/common-test/templates/common.yaml +++ /dev/null @@ -1 +0,0 @@ -{{ include "ix.v1.common.loader.all" . }} diff --git a/.to_be_deleted/common-test/tests/cert/cert_dict_test.yaml b/.to_be_deleted/common-test/tests/cert/cert_dict_test.yaml deleted file mode 100644 index 6581676f2b..0000000000 --- a/.to_be_deleted/common-test/tests/cert/cert_dict_test.yaml +++ /dev/null @@ -1,218 +0,0 @@ -suite: certificate dict test -templates: - - common.yaml -tests: - - it: should fail with empty ixCertificates key - set: - scaleCerts: - certname: - id: 1 - # Simulating middleware injection - ixCertificates: {} - asserts: - - failedTemplate: - errorMessage: Key is empty - - - it: should fail with cert that don't exist - set: - scaleCerts: - certname: - id: 1 - # Simulating middleware injection - ixCertificates: - "2": - certificate: cert_content - asserts: - - failedTemplate: - errorMessage: Certificate (1) was not found. - - - it: should fail with expired cert - set: - scaleCerts: - certname: - id: 1 - # Simulating middleware injection - ixCertificates: - "1": - certificate: cert_content - expired: true - asserts: - - failedTemplate: - errorMessage: Certificate (1) is expired - - - it: should fail with revoked cert - set: - scaleCerts: - certname: - id: 1 - # Simulating middleware injection - ixCertificates: - "1": - certificate: cert_content - revoked: true - asserts: - - failedTemplate: - errorMessage: Certificate (1) has been revoked - - - it: should pass with 1 secret created with dash in name - documentIndex: &secretDoc 0 - set: - scaleCerts: - cert-name: - id: 1 - # Simulating middleware injection - ixCertificates: - "1": - certificate: cert_content - privatekey: some_key - asserts: - - isKind: - of: Secret - - isAPIVersion: - of: v1 - - equal: - path: type - value: kubernetes.io/tls - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-cert-name-ixcert-1-0 - - isNotEmpty: - path: data.tls\.crt - - isNotEmpty: - path: data.tls\.key - - - it: should pass with 1 secret created - documentIndex: *secretDoc - set: - scaleCerts: - certname: - id: 1 - # Simulating middleware injection - ixCertificates: - "1": - certificate: cert_content - privatekey: some_key - asserts: &basicAssertion - - isKind: - of: Secret - - isAPIVersion: - of: v1 - - equal: - path: type - value: kubernetes.io/tls - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-certname-ixcert-1-0 - - isNotEmpty: - path: data.tls\.crt - - isNotEmpty: - path: data.tls\.key - - - it: should pass with 1 secret created and revision increased - documentIndex: *secretDoc - release: - revision: 1 - set: - scaleCerts: - certname: - id: 1 - # Simulating middleware injection - ixCertificates: - "1": - certificate: cert_content - privatekey: some_key - asserts: - - isKind: - of: Secret - - isAPIVersion: - of: v1 - - equal: - path: type - value: kubernetes.io/tls - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-certname-ixcert-1-1 - - isNotEmpty: - path: data.tls\.crt - - isNotEmpty: - path: data.tls\.key - - - it: should pass with 1 secret created and revision increased and name overriden - documentIndex: *secretDoc - release: - revision: 1 - set: - scaleCerts: - certname: - id: 1 - nameOverride: name-override - # Simulating middleware injection - ixCertificates: - "1": - certificate: cert_content - privatekey: some_key - asserts: - - isKind: - of: Secret - - isAPIVersion: - of: v1 - - equal: - path: type - value: kubernetes.io/tls - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-name-override-ixcert-1-1 - - isNotEmpty: - path: data.tls\.crt - - isNotEmpty: - path: data.tls\.key - - - it: should pass with 2 secret created (doc1) - documentIndex: *secretDoc - set: - scaleCerts: - certname: - id: 1 - certname2: - id: 2 - # Simulating middleware injection - ixCertificates: - "1": - privatekey: some_key - certificate: cert_content - "2": - privatekey: some_key2 - certificate: cert_content2 - asserts: *basicAssertion - - - it: should pass with 2 secret created (doc2) - documentIndex: &secretDoc 1 - set: - scaleCerts: - certname: - id: 1 - certname2: - id: 2 - # Simulating middleware injection - ixCertificates: - "1": - privatekey: some_key - certificate: cert_content - "2": - privatekey: some_key2 - certificate: cert_content2 - asserts: - - isKind: - of: Secret - - isAPIVersion: - of: v1 - - equal: - path: type - value: kubernetes.io/tls - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-certname2-ixcert-2-0 - - isNotEmpty: - path: data.tls\.crt - - isNotEmpty: - path: data.tls\.key diff --git a/.to_be_deleted/common-test/tests/cert/cert_list_test.yaml b/.to_be_deleted/common-test/tests/cert/cert_list_test.yaml deleted file mode 100644 index c56c0868c0..0000000000 --- a/.to_be_deleted/common-test/tests/cert/cert_list_test.yaml +++ /dev/null @@ -1,218 +0,0 @@ -suite: certificate list test -templates: - - common.yaml -tests: - - it: should fail with empty ixCertificates key - set: - scaleCertsList: - - name: certname - id: 1 - # Simulating middleware injection - ixCertificates: {} - asserts: - - failedTemplate: - errorMessage: Key is empty - - - it: should fail with cert that don't exist - set: - scaleCertsList: - - name: certname - id: 1 - # Simulating middleware injection - ixCertificates: - "2": - certificate: cert_content - asserts: - - failedTemplate: - errorMessage: Certificate (1) was not found. - - - it: should fail with expired cert - set: - scaleCertsList: - - name: certname - id: 1 - # Simulating middleware injection - ixCertificates: - "1": - certificate: cert_content - expired: true - asserts: - - failedTemplate: - errorMessage: Certificate (1) is expired - - - it: should fail with revoked cert - set: - scaleCertsList: - - name: certname - id: 1 - # Simulating middleware injection - ixCertificates: - "1": - certificate: cert_content - revoked: true - asserts: - - failedTemplate: - errorMessage: Certificate (1) has been revoked - - - it: should pass with 1 secret created with dash in the name - documentIndex: &secretDoc 0 - set: - scaleCertsList: - - name: cert-name - id: 1 - # Simulating middleware injection - ixCertificates: - "1": - certificate: cert_content - privatekey: some_key - asserts: - - isKind: - of: Secret - - isAPIVersion: - of: v1 - - equal: - path: type - value: kubernetes.io/tls - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-cert-name-ixcert-1-0 - - isNotEmpty: - path: data.tls\.crt - - isNotEmpty: - path: data.tls\.key - - - it: should pass with 1 secret created - documentIndex: *secretDoc - set: - scaleCertsList: - - name: certname - id: 1 - # Simulating middleware injection - ixCertificates: - "1": - certificate: cert_content - privatekey: some_key - asserts: &basicAssertion - - isKind: - of: Secret - - isAPIVersion: - of: v1 - - equal: - path: type - value: kubernetes.io/tls - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-certname-ixcert-1-0 - - isNotEmpty: - path: data.tls\.crt - - isNotEmpty: - path: data.tls\.key - - - it: should pass with 1 secret created and revision increased - documentIndex: *secretDoc - release: - revision: 1 - set: - scaleCertsList: - - name: certname - id: 1 - # Simulating middleware injection - ixCertificates: - "1": - certificate: cert_content - privatekey: some_key - asserts: - - isKind: - of: Secret - - isAPIVersion: - of: v1 - - equal: - path: type - value: kubernetes.io/tls - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-certname-ixcert-1-1 - - isNotEmpty: - path: data.tls\.crt - - isNotEmpty: - path: data.tls\.key - - - it: should pass with 1 secret created and revision increased and name overriden - documentIndex: *secretDoc - release: - revision: 1 - set: - scaleCertsList: - - name: certname - id: 1 - nameOverride: name-override - # Simulating middleware injection - ixCertificates: - "1": - certificate: cert_content - privatekey: some_key - asserts: - - isKind: - of: Secret - - isAPIVersion: - of: v1 - - equal: - path: type - value: kubernetes.io/tls - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-name-override-ixcert-1-1 - - isNotEmpty: - path: data.tls\.crt - - isNotEmpty: - path: data.tls\.key - - - it: should pass with 2 secret created (doc1) - documentIndex: *secretDoc - set: - scaleCertsList: - - name: certname - id: 1 - - name: certname2 - id: 2 - # Simulating middleware injection - ixCertificates: - "1": - privatekey: some_key - certificate: cert_content - "2": - privatekey: some_key2 - certificate: cert_content2 - asserts: *basicAssertion - - - it: should pass with 2 secret created (doc2) - documentIndex: &secretDoc 1 - set: - scaleCertsList: - - name: certname - id: 1 - - name: certname2 - id: 2 - # Simulating middleware injection - ixCertificates: - "1": - privatekey: some_key - certificate: cert_content - "2": - privatekey: some_key2 - certificate: cert_content2 - asserts: - - isKind: - of: Secret - - isAPIVersion: - of: v1 - - equal: - path: type - value: kubernetes.io/tls - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-certname2-ixcert-2-0 - - isNotEmpty: - path: data.tls\.crt - - isNotEmpty: - path: data.tls\.key diff --git a/.to_be_deleted/common-test/tests/cert/cert_secret_mount_test.yaml b/.to_be_deleted/common-test/tests/cert/cert_secret_mount_test.yaml deleted file mode 100644 index cdf65cae07..0000000000 --- a/.to_be_deleted/common-test/tests/cert/cert_secret_mount_test.yaml +++ /dev/null @@ -1,447 +0,0 @@ -suite: certificate secret mount test -templates: - - common.yaml -release: - revision: 2 -tests: - - it: should pass with 1 secret created - documentIndex: &secretDoc 0 - set: - scaleCerts: - certname: - id: 1 - # Simulating middleware injection - ixCertificates: - "1": - certificate: cert_content - privatekey: some_key - asserts: - - isKind: - of: Secret - - isAPIVersion: - of: v1 - - equal: - path: type - value: kubernetes.io/tls - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-certname-ixcert-1-2 - - isNotEmpty: - path: data.tls\.crt - - isNotEmpty: - path: data.tls\.key - - - it: should pass with secret with dash in the name and mounted both certificate and private key - documentIndex: &deploymentDoc 1 - set: - # Simulating middleware injection - ixCertificates: - "1": - certificate: cert_content - privatekey: some_key - scaleCerts: - cert-name: - id: 1 - cert: - enabled: true - path: /some/path/crt.key - readOnly: true - defaultMode: "0700" - key: - enabled: true - path: /some/path/key.key - readOnly: true - defaultMode: "0700" - asserts: - - isKind: - of: Deployment - - matchRegex: - path: spec.template.spec.volumes[0].name - pattern: &patternCert '^ix-certificate-cert-([0-9]+)-([a-z0-9]){5}$' - - equal: - path: spec.template.spec.volumes[0].secret - value: - secretName: RELEASE-NAME-common-test-cert-name-ixcert-1-2 - defaultMode: 0700 - - matchRegex: - path: spec.template.spec.containers[0].volumeMounts[0].name - pattern: *patternCert - - isSubset: - path: spec.template.spec.containers[0].volumeMounts[0] - content: - mountPath: /some/path/crt.key - subPath: tls.crt - readOnly: true - - matchRegex: - path: spec.template.spec.volumes[1].name - pattern: &patternKey '^ix-certificate-key-([0-9]+)-([a-z0-9]){5}$' - - equal: - path: spec.template.spec.volumes[1].secret - value: - secretName: RELEASE-NAME-common-test-cert-name-ixcert-1-2 - defaultMode: 0700 - - matchRegex: - path: spec.template.spec.containers[0].volumeMounts[1].name - pattern: *patternKey - - isSubset: - path: spec.template.spec.containers[0].volumeMounts[1] - content: - mountPath: /some/path/key.key - subPath: tls.key - readOnly: true - - - it: should pass with mounted secret both certificate and private key - documentIndex: *deploymentDoc - set: - # Simulating middleware injection - ixCertificates: - "1": - certificate: cert_content - privatekey: some_key - scaleCerts: - certname: - id: 1 - cert: - enabled: true - path: /some/path/crt.key - readOnly: true - defaultMode: "0700" - key: - enabled: true - path: /some/path/key.key - readOnly: true - defaultMode: "0700" - asserts: - - isKind: - of: Deployment - - matchRegex: - path: spec.template.spec.volumes[0].name - pattern: *patternCert - - equal: - path: spec.template.spec.volumes[0].secret - value: - secretName: RELEASE-NAME-common-test-certname-ixcert-1-2 - defaultMode: 0700 - - matchRegex: - path: spec.template.spec.containers[0].volumeMounts[0].name - pattern: *patternCert - - isSubset: - path: spec.template.spec.containers[0].volumeMounts[0] - content: - mountPath: /some/path/crt.key - subPath: tls.crt - readOnly: true - - matchRegex: - path: spec.template.spec.volumes[1].name - pattern: *patternKey - - equal: - path: spec.template.spec.volumes[1].secret - value: - secretName: RELEASE-NAME-common-test-certname-ixcert-1-2 - defaultMode: 0700 - - matchRegex: - path: spec.template.spec.containers[0].volumeMounts[1].name - pattern: *patternKey - - isSubset: - path: spec.template.spec.containers[0].volumeMounts[1] - content: - mountPath: /some/path/key.key - subPath: tls.key - readOnly: true - - - it: should pass with mounted secret only certificate - documentIndex: *deploymentDoc - set: - # Simulating middleware injection - ixCertificates: - "1": - certificate: cert_content - privatekey: some_key - scaleCerts: - certname: - id: 1 - cert: - enabled: true - path: /some/path/crt.key - readOnly: true - defaultMode: "0700" - key: - enabled: false - path: /some/path/key.key - readOnly: true - defaultMode: "0700" - asserts: - - isKind: - of: Deployment - - matchRegex: - path: spec.template.spec.volumes[0].name - pattern: *patternCert - - equal: - path: spec.template.spec.volumes[0].secret - value: - secretName: RELEASE-NAME-common-test-certname-ixcert-1-2 - defaultMode: 0700 - - matchRegex: - path: spec.template.spec.containers[0].volumeMounts[0].name - pattern: *patternCert - - isSubset: - path: spec.template.spec.containers[0].volumeMounts[0] - content: - mountPath: /some/path/crt.key - subPath: tls.crt - readOnly: true - - - it: should pass with mounted secret only private key - documentIndex: *deploymentDoc - set: - # Simulating middleware injection - ixCertificates: - "1": - certificate: cert_content - privatekey: some_key - scaleCerts: - certname: - id: 1 - cert: - enabled: false - path: /some/path/crt.key - readOnly: true - defaultMode: "0700" - key: - enabled: true - path: /some/path/key.key - readOnly: true - defaultMode: "0700" - asserts: - - matchRegex: - path: spec.template.spec.volumes[0].name - pattern: *patternKey - - equal: - path: spec.template.spec.volumes[0].secret - value: - secretName: RELEASE-NAME-common-test-certname-ixcert-1-2 - defaultMode: 0700 - - matchRegex: - path: spec.template.spec.containers[0].volumeMounts[0].name - pattern: *patternKey - - isSubset: - path: spec.template.spec.containers[0].volumeMounts[0] - content: - mountPath: /some/path/key.key - subPath: tls.key - readOnly: true - - - it: should pass with 2 mounted secret both certificate and private key - documentIndex: &secondDeploymentDoc 2 - set: - # Simulating middleware injection - ixCertificates: - "1": - certificate: cert_content - privatekey: some_key - "2": - certificate: cert_content - privatekey: some_key - scaleCerts: - certname: - id: 1 - cert: - enabled: true - path: /some/path/crt.key - readOnly: true - defaultMode: "0700" - key: - enabled: true - path: /some/path/key.key - readOnly: true - defaultMode: "0700" - certname2: - id: 2 - cert: - enabled: true - path: /some/path/crt.key - readOnly: true - defaultMode: "0700" - key: - enabled: true - path: /some/path/key.key - readOnly: true - defaultMode: "0700" - asserts: - - isKind: - of: Deployment - - matchRegex: - path: spec.template.spec.volumes[0].name - pattern: *patternCert - - equal: - path: spec.template.spec.volumes[0].secret - value: - secretName: RELEASE-NAME-common-test-certname-ixcert-1-2 - defaultMode: 0700 - - matchRegex: - path: spec.template.spec.containers[0].volumeMounts[0].name - pattern: *patternCert - - isSubset: - path: spec.template.spec.containers[0].volumeMounts[0] - content: - mountPath: /some/path/crt.key - subPath: tls.crt - readOnly: true - - - matchRegex: - path: spec.template.spec.volumes[1].name - pattern: *patternCert - - equal: - path: spec.template.spec.volumes[1].secret - value: - secretName: RELEASE-NAME-common-test-certname2-ixcert-2-2 - defaultMode: 0700 - - matchRegex: - path: spec.template.spec.containers[0].volumeMounts[1].name - pattern: *patternCert - - isSubset: - path: spec.template.spec.containers[0].volumeMounts[1] - content: - mountPath: /some/path/crt.key - subPath: tls.crt - readOnly: true - - - matchRegex: - path: spec.template.spec.volumes[2].name - pattern: *patternKey - - equal: - path: spec.template.spec.volumes[2].secret - value: - secretName: RELEASE-NAME-common-test-certname-ixcert-1-2 - defaultMode: 0700 - - matchRegex: - path: spec.template.spec.containers[0].volumeMounts[2].name - pattern: *patternKey - - isSubset: - path: spec.template.spec.containers[0].volumeMounts[2] - content: - mountPath: /some/path/key.key - subPath: tls.key - readOnly: true - - - matchRegex: - path: spec.template.spec.volumes[3].name - pattern: *patternKey - - equal: - path: spec.template.spec.volumes[3].secret - value: - secretName: RELEASE-NAME-common-test-certname2-ixcert-2-2 - defaultMode: 0700 - - matchRegex: - path: spec.template.spec.containers[0].volumeMounts[3].name - pattern: *patternKey - - isSubset: - path: spec.template.spec.containers[0].volumeMounts[3] - content: - mountPath: /some/path/key.key - subPath: tls.key - readOnly: true - - - it: should pass with mounted secret both certificate and private key without extra options - documentIndex: *deploymentDoc - set: - # Simulating middleware injection - ixCertificates: - "1": - certificate: cert_content - privatekey: some_key - scaleCerts: - certname: - id: 1 - cert: - enabled: true - path: /some/path/crt.key - key: - enabled: true - path: /some/path/key.key - asserts: - - isKind: - of: Deployment - - matchRegex: - path: spec.template.spec.volumes[0].name - pattern: *patternCert - - equal: - path: spec.template.spec.volumes[0].secret - value: - secretName: RELEASE-NAME-common-test-certname-ixcert-1-2 - - matchRegex: - path: spec.template.spec.containers[0].volumeMounts[0].name - pattern: *patternCert - - isSubset: - path: spec.template.spec.containers[0].volumeMounts[0] - content: - mountPath: /some/path/crt.key - subPath: tls.crt - - matchRegex: - path: spec.template.spec.volumes[1].name - pattern: *patternKey - - equal: - path: spec.template.spec.volumes[1].secret - value: - secretName: RELEASE-NAME-common-test-certname-ixcert-1-2 - - matchRegex: - path: spec.template.spec.containers[0].volumeMounts[1].name - pattern: *patternKey - - isSubset: - path: spec.template.spec.containers[0].volumeMounts[1] - content: - mountPath: /some/path/key.key - subPath: tls.key - - - it: should pass with mounted secret both certificate and private key without extra options and paths from tpl - documentIndex: *deploymentDoc - set: - path1: /some/path/crt.key - path2: /some/path/key.key - # Simulating middleware injection - ixCertificates: - "1": - certificate: cert_content - privatekey: some_key - scaleCerts: - certname: - id: 1 - cert: - enabled: true - path: "{{ .Values.path1 }}" - key: - enabled: true - path: "{{ .Values.path2 }}" - asserts: - - isKind: - of: Deployment - - matchRegex: - path: spec.template.spec.volumes[0].name - pattern: *patternCert - - equal: - path: spec.template.spec.volumes[0].secret - value: - secretName: RELEASE-NAME-common-test-certname-ixcert-1-2 - - matchRegex: - path: spec.template.spec.containers[0].volumeMounts[0].name - pattern: *patternCert - - isSubset: - path: spec.template.spec.containers[0].volumeMounts[0] - content: - mountPath: /some/path/crt.key - subPath: tls.crt - - matchRegex: - path: spec.template.spec.volumes[1].name - pattern: *patternKey - - equal: - path: spec.template.spec.volumes[1].secret - value: - secretName: RELEASE-NAME-common-test-certname-ixcert-1-2 - - matchRegex: - path: spec.template.spec.containers[0].volumeMounts[1].name - pattern: *patternKey - - isSubset: - path: spec.template.spec.containers[0].volumeMounts[1] - content: - mountPath: /some/path/key.key - subPath: tls.key diff --git a/.to_be_deleted/common-test/tests/cert/cert_test.yaml b/.to_be_deleted/common-test/tests/cert/cert_test.yaml deleted file mode 100644 index b9d361414d..0000000000 --- a/.to_be_deleted/common-test/tests/cert/cert_test.yaml +++ /dev/null @@ -1,185 +0,0 @@ -suite: certificate test -templates: - - common.yaml -chart: - appVersion: &appVer v1.2.3 -tests: - - it: should pass with 1 secret created - documentIndex: &secretDoc 0 - set: - scaleCerts: - certname: - id: 1 - # Simulating middleware injection - ixCertificates: - "1": - certificate: cert_content - privatekey: some_key - asserts: &basicAssertion - - isKind: - of: Secret - - isAPIVersion: - of: v1 - - equal: - path: type - value: kubernetes.io/tls - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-certname-ixcert-1-0 - - isNotEmpty: - path: data.tls\.crt - - isNotEmpty: - path: data.tls\.key - - equal: - path: metadata.labels - value: - app: common-test - app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: common-test - app.kubernetes.io/version: *appVer - helm-revision: "0" - helm.sh/chart: common-test-1.0.0 - release: RELEASE-NAME - - isNull: - path: metadata.annotations - - - it: should pass with 1 secret created with global labels added - documentIndex: &secretDoc 0 - set: - global: - labels: - some_key: some_value - some_key1: some_value1 - scaleCerts: - certname: - id: 1 - # Simulating middleware injection - ixCertificates: - "1": - certificate: cert_content - privatekey: some_key - asserts: &basicAssertion - - equal: - path: metadata.labels - value: - app: common-test - app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: common-test - app.kubernetes.io/version: *appVer - helm-revision: "0" - helm.sh/chart: common-test-1.0.0 - release: RELEASE-NAME - some_key: some_value - some_key1: some_value1 - - isNull: - path: metadata.annotations - - - it: should pass with 1 secret created with global labels added from tpl - documentIndex: &secretDoc 0 - set: - k1: some_value - k2: some_value1 - global: - labels: - some_key: "{{ .Values.k1 }}" - some_key1: "{{ .Values.k2 }}" - scaleCerts: - certname: - id: 1 - # Simulating middleware injection - ixCertificates: - "1": - certificate: cert_content - privatekey: some_key - asserts: &basicAssertion - - equal: - path: metadata.labels - value: - app: common-test - app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: common-test - app.kubernetes.io/version: *appVer - helm-revision: "0" - helm.sh/chart: common-test-1.0.0 - release: RELEASE-NAME - some_key: some_value - some_key1: some_value1 - - isNull: - path: metadata.annotations - - - it: should pass with 1 secret created with global annotations added - documentIndex: &secretDoc 0 - set: - global: - annotations: - some_key: some_value - some_key1: some_value1 - scaleCerts: - certname: - id: 1 - # Simulating middleware injection - ixCertificates: - "1": - certificate: cert_content - privatekey: some_key - asserts: &basicAssertion - - equal: - path: metadata.annotations - value: - some_key: some_value - some_key1: some_value1 - - - it: should pass with 1 secret created with global annotations added from tpl - documentIndex: &secretDoc 0 - set: - k1: some_value - k2: some_value1 - global: - annotations: - some_key: "{{ .Values.k1 }}" - some_key1: "{{ .Values.k2 }}" - scaleCerts: - certname: - id: 1 - # Simulating middleware injection - ixCertificates: - "1": - certificate: cert_content - privatekey: some_key - asserts: &basicAssertion - - equal: - path: metadata.annotations - value: - some_key: some_value - some_key1: some_value1 - - - it: should fail with uppercase in cert name - set: - scaleCerts: - certName: - id: 1 - # Simulating middleware injection - ixCertificates: - "1": - certificate: cert_content - privatekey: some_key - asserts: - - failedTemplate: - errorMessage: Certificate has invalid name (certName). Name must be lowercase. - - - it: should fail with underscore in cert name - set: - scaleCerts: - cert_name: - id: 1 - # Simulating middleware injection - ixCertificates: - "1": - certificate: cert_content - privatekey: some_key - asserts: - - failedTemplate: - errorMessage: Certificate has invalid name (cert_name). Name cannot contain underscores (_) diff --git a/.to_be_deleted/common-test/tests/configmap/configmap_test.yaml b/.to_be_deleted/common-test/tests/configmap/configmap_test.yaml deleted file mode 100644 index 904200a4ed..0000000000 --- a/.to_be_deleted/common-test/tests/configmap/configmap_test.yaml +++ /dev/null @@ -1,616 +0,0 @@ -suite: configmap test -templates: - - common.yaml -chart: - appVersion: &appVer v1.2.3 -tests: - - it: should pass with default values - documentIndex: &deploymentDoc 0 - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Deployment - - - it: should fail without a dict in configmap - set: - configmap: - enabled: true - content: - key: value - asserts: - - failedTemplate: - errorMessage: key must have at least one dict. Found (bool) - - - it: should fail with uppercase in name in configmap - set: - configmap: - someName: - enabled: true - content: - key: value - asserts: - - failedTemplate: - errorMessage: Configmap has invalid name (someName). Name must be lowercase. - - - it: should fail with underscore in name in configmap - set: - configmap: - some_name: - enabled: true - content: - key: value - asserts: - - failedTemplate: - errorMessage: Configmap has invalid name (some_name). Name cannot contain underscores (_). - - - it: should fail with empty content in configmap - set: - configmap: - somename: - enabled: true - content: - asserts: - - failedTemplate: - errorMessage: Content of Configmap (somename) are empty. Please disable or add content. - - - it: should fail with string in content in configmap - set: - configmap: - somename: - enabled: true - content: something - asserts: - - failedTemplate: - errorMessage: Content of Configmap (somename) are string. Must be in key/value format. Value can be scalar too. - - - it: should pass with 1 configmap created with parseAsEnv set - documentIndex: &configMapDoc 0 - set: - configmap: - some-name: - enabled: true - parseAsEnv: true - content: - key1: 123 - key2: value2 - asserts: - - hasDocuments: - count: 4 - - isKind: - of: ConfigMap - - isAPIVersion: - of: v1 - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-some-name - - equal: - path: data - value: - key1: "123" - key2: value2 - - isNull: - path: metadata.annotations - - equal: - path: metadata.labels - value: - app: common-test - app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: common-test - app.kubernetes.io/version: *appVer - helm-revision: "0" - helm.sh/chart: common-test-1.0.0 - release: RELEASE-NAME - - - it: should pass with empty key in content in configmap - documentIndex: *configMapDoc - set: - configmap: - somename: - enabled: true - content: - key: "" - asserts: - - equal: - path: data - value: - key: "" - - - it: should pass with 1 configmap created with parseAsEnv and values set from tpl - documentIndex: *configMapDoc - set: - k1: 123 - k2: value2 - configmap: - some-name: - enabled: true - parseAsEnv: true - content: - key1: "{{ .Values.k1 }}" - key2: "{{ .Values.k2 }}" - asserts: - - equal: - path: data - value: - key1: "123" - key2: value2 - - - it: should pass with 1 configmap created with nameOverride set - documentIndex: *configMapDoc - set: - k1: true - k2: value2 - configmap: - some-name: - enabled: true - parseAsEnv: true - nameOverride: some-new-name - content: - key1: "{{ .Values.k1 }}" - key2: "{{ .Values.k2 }}" - asserts: - - equal: - path: data - value: - key1: "true" - key2: value2 - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-some-new-name - - - it: should pass with multiple configmap created with parseAsEnv set (1/2) and values from tpl - documentIndex: *configMapDoc - set: - k1: value1 - k2: false - k3: value3 - k4: value4 - configmap: - some-name: - enabled: true - parseAsEnv: true - content: - key1: "{{ .Values.k1 }}" - key2: "{{ .Values.k2 }}" - some-other-name: - enabled: true - parseAsEnv: true - content: - key3: "{{ .Values.k3 }}" - key4: "{{ .Values.k4 }}" - asserts: - - hasDocuments: - count: 5 - - isKind: - of: ConfigMap - - isAPIVersion: - of: v1 - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-some-name - - equal: - path: data - value: - key1: value1 - key2: "false" - - isNull: - path: metadata.annotations - - equal: - path: metadata.labels - value: - app: common-test - app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: common-test - app.kubernetes.io/version: *appVer - helm-revision: "0" - helm.sh/chart: common-test-1.0.0 - release: RELEASE-NAME - - - it: should pass with multiple configmap created with parseAsEnv set (2/2) and values from tpl - documentIndex: &otherConfigMapDoc 1 - set: - configmap: - some-name: - enabled: true - parseAsEnv: true - content: - key1: value1 - key2: value2 - some-other-name: - enabled: true - parseAsEnv: true - content: - key3: value3 - key4: value4 - asserts: - - hasDocuments: - count: 5 - - isKind: - of: ConfigMap - - isAPIVersion: - of: v1 - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-some-other-name - - equal: - path: data - value: - key3: value3 - key4: value4 - - isNull: - path: metadata.annotations - - equal: - path: metadata.labels - value: - app: common-test - app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: common-test - app.kubernetes.io/version: *appVer - helm-revision: "0" - helm.sh/chart: common-test-1.0.0 - release: RELEASE-NAME - - - it: should pass with multiple configmap created with scalar in contents and tpl (1/2) - documentIndex: *configMapDoc - set: - k1: value1 - k2: 80 - k3: pair - k4: value2 - k5: 81 - k6: false - configmap: - some-name: - enabled: true - content: - key: "{{ .Values.k3 }}" - nginx.conf1: | - alias {{ .Values.k1 }} - listen {{ .Values.k2 }} - - function { - # some json - "key": { - "key2": "value", - "key3": "value2" - } - } - some-other-name: - enabled: true - content: - key: "{{ .Values.k6 }}" - nginx.conf2: | - alias {{ .Values.k4 }} - listen {{ .Values.k5 }} - - function { - # some json - "key": { - "key2": "value", - "key3": "value2" - } - } - asserts: - - equal: - path: data - value: - key: pair - nginx.conf1: | - alias value1 - listen 80 - - function { - # some json - "key": { - "key2": "value", - "key3": "value2" - } - } - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-some-name - - - it: should pass with multiple configmap created with scalar in contents and tpl (2/2) - documentIndex: *otherConfigMapDoc - set: - k1: value1 - k2: 80 - k3: pair - k4: value2 - k5: 81 - k6: false - configmap: - some-name: - enabled: true - content: - key: "{{ .Values.k3 }}" - nginx.conf1: | - alias {{ .Values.k1 }} - listen {{ .Values.k2 }} - - function { - # some json - "key": { - "key2": "value", - "key3": "value2" - } - } - some-other-name: - enabled: true - content: - key: "{{ .Values.k6 }}" - nginx.conf2: | - alias {{ .Values.k4 }} - listen {{ .Values.k5 }} - - function { - # some json - "key": { - "key2": "value", - "key3": "value2" - } - } - asserts: - - equal: - path: data - value: - key: "false" - nginx.conf2: | - alias value2 - listen 81 - - function { - # some json - "key": { - "key2": "value", - "key3": "value2" - } - } - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-some-other-name - - - it: should pass with multiple configmap created and labels and global labels added from tpl (1/2) - documentIndex: *configMapDoc - set: - l1: lab1 - l2: lab2 - l5: lab5 - l6: lab6 - global: - labels: - gl1: glab1 - gl2: glab2 - configmap: - some-name: - enabled: true - labels: - label1: "{{ .Values.l1 }}" - label2: "{{ .Values.l2 }}" - label3: lab3 - label4: lab4 - content: - key1: value1 - key2: value2 - some-other-name: - enabled: true - labels: - label5: "{{ .Values.l5 }}" - label6: "{{ .Values.l6 }}" - label7: lab7 - label8: lab8 - content: - key1: value1 - key2: value2 - asserts: - - hasDocuments: - count: 5 - - isKind: - of: ConfigMap - - isNull: - path: metadata.annotations - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-some-name - - equal: - path: metadata.labels - value: - app: common-test - app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: common-test - app.kubernetes.io/version: *appVer - helm-revision: "0" - helm.sh/chart: common-test-1.0.0 - release: RELEASE-NAME - label1: lab1 - label2: lab2 - label3: lab3 - label4: lab4 - gl1: glab1 - gl2: glab2 - - - it: should pass with multiple configmap created and labels and global labels added from tpl (2/2) - documentIndex: *otherConfigMapDoc - set: - l1: lab1 - l2: lab2 - l5: lab5 - l6: lab6 - global: - labels: - gl1: glab1 - gl2: glab2 - configmap: - some-name: - enabled: true - labels: - label1: "{{ .Values.l1 }}" - label2: "{{ .Values.l2 }}" - label3: lab3 - label4: lab4 - content: - key1: value1 - key2: value2 - some-other-name: - enabled: true - labels: - label5: "{{ .Values.l5 }}" - label6: "{{ .Values.l6 }}" - label7: lab7 - label8: lab8 - content: - key1: value1 - key2: value2 - asserts: - - hasDocuments: - count: 5 - - isKind: - of: ConfigMap - - isNull: - path: metadata.annotations - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-some-other-name - - equal: - path: metadata.labels - value: - app: common-test - app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: common-test - app.kubernetes.io/version: *appVer - helm-revision: "0" - helm.sh/chart: common-test-1.0.0 - release: RELEASE-NAME - label5: lab5 - label6: lab6 - label7: lab7 - label8: lab8 - gl1: glab1 - gl2: glab2 - - - it: should pass with multiple configmap created and annotations and global annotations added from tpl (1/2) - documentIndex: *configMapDoc - set: - a1: anno1 - a2: anno2 - a5: anno5 - a6: anno6 - global: - annotations: - ga1: ganno1 - ga2: ganno2 - configmap: - some-name: - enabled: true - annotations: - annotation1: "{{ .Values.a1 }}" - annotation2: "{{ .Values.a2 }}" - annotation3: anno3 - annotation4: anno4 - content: - key1: value1 - key2: value2 - some-other-name: - enabled: true - annotations: - annotation5: "{{ .Values.a5 }}" - annotation6: "{{ .Values.a6 }}" - annotation7: anno7 - annotation8: anno8 - content: - key1: value1 - key2: value2 - asserts: - - hasDocuments: - count: 5 - - isKind: - of: ConfigMap - - equal: - path: metadata.annotations - value: - annotation1: anno1 - annotation2: anno2 - annotation3: anno3 - annotation4: anno4 - ga1: ganno1 - ga2: ganno2 - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-some-name - - equal: - path: metadata.labels - value: - app: common-test - app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: common-test - app.kubernetes.io/version: *appVer - helm-revision: "0" - helm.sh/chart: common-test-1.0.0 - release: RELEASE-NAME - - - it: should pass with multiple configmap created and annotations and global annotations added from tpl (2/2) - documentIndex: *otherConfigMapDoc - set: - a1: anno1 - a2: anno2 - a5: anno5 - a6: anno6 - global: - annotations: - ga1: ganno1 - ga2: ganno2 - configmap: - some-name: - enabled: true - annotations: - annotation1: "{{ .Values.a1 }}" - annotation2: "{{ .Values.a2 }}" - annotation3: anno3 - annotation4: anno4 - content: - key1: value1 - key2: value2 - some-other-name: - enabled: true - annotations: - annotation5: "{{ .Values.a5 }}" - annotation6: "{{ .Values.a6 }}" - annotation7: anno7 - annotation8: anno8 - content: - key1: value1 - key2: value2 - asserts: - - hasDocuments: - count: 5 - - isKind: - of: ConfigMap - - equal: - path: metadata.annotations - value: - annotation5: anno5 - annotation6: anno6 - annotation7: anno7 - annotation8: anno8 - ga1: ganno1 - ga2: ganno2 - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-some-other-name - - equal: - path: metadata.labels - value: - app: common-test - app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: common-test - app.kubernetes.io/version: *appVer - helm-revision: "0" - helm.sh/chart: common-test-1.0.0 - release: RELEASE-NAME diff --git a/.to_be_deleted/common-test/tests/container_in_deployment/command-arg_test.yaml b/.to_be_deleted/common-test/tests/container_in_deployment/command-arg_test.yaml deleted file mode 100644 index d04aa4c587..0000000000 --- a/.to_be_deleted/common-test/tests/container_in_deployment/command-arg_test.yaml +++ /dev/null @@ -1,323 +0,0 @@ -suite: container in deployment command-arg test -templates: - - common.yaml -tests: - - it: should pass with default values - documentIndex: &deploymentDoc 0 - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Deployment - - - it: should pass with command set single value - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - command: entrypoint.sh - asserts: - - equal: - path: spec.template.spec.containers[0].command - value: - - entrypoint.sh - - - it: should pass with command set single value from tpl - documentIndex: *deploymentDoc - set: - cmd: entrypoint.sh - controllers: - main: - pod: - containers: - main: - command: "{{ .Values.cmd }}" - asserts: - - equal: - path: spec.template.spec.containers[0].command - value: - - entrypoint.sh - - - it: should pass with command set - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - command: - - /bin/bash - - test - asserts: - - equal: - path: spec.template.spec.containers[0].command - value: - - /bin/bash - - test - - - it: should pass with command block set - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - command: - - /bin/bash - - -c - - | - echo "works!" - exit - asserts: - - equal: - path: spec.template.spec.containers[0].command - value: - - /bin/bash - - -c - - | - echo "works!" - exit - - - it: should pass with command set from tpl - documentIndex: *deploymentDoc - set: - some_key: some_value - controllers: - main: - pod: - containers: - main: - command: - - /bin/bash - - "{{ .Values.some_key }}" - asserts: - - equal: - path: spec.template.spec.containers[0].command - value: - - /bin/bash - - some_value - - - it: should pass with args set with single value - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - args: --worker - asserts: - - equal: - path: spec.template.spec.containers[0].args - value: - - --worker - - - it: should pass with args set with single value from tpl - documentIndex: *deploymentDoc - set: - some_arg: --worker - controllers: - main: - pod: - containers: - main: - args: "{{ .Values.some_arg }}" - asserts: - - equal: - path: spec.template.spec.containers[0].args - value: - - --worker - - - it: should pass with args set - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - args: - - --port - - 8000 - asserts: - - equal: - path: spec.template.spec.containers[0].args - value: - - --port - - "8000" - - - it: should pass with args set from tpl - documentIndex: *deploymentDoc - set: - some_port: 9000 - controllers: - main: - pod: - containers: - main: - args: - - --port - - "{{ .Values.some_port }}" - asserts: - - equal: - path: spec.template.spec.containers[0].args - value: - - --port - - "9000" - - - it: should pass with extraArgs set single value - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - extraArgs: --worker - asserts: - - equal: - path: spec.template.spec.containers[0].args - value: - - --worker - - - it: should pass with extraArgs set single value from tpl - documentIndex: *deploymentDoc - set: - some_extra_arg: --worker - controllers: - main: - pod: - containers: - main: - extraArgs: "{{ .Values.some_extra_arg }}" - asserts: - - equal: - path: spec.template.spec.containers[0].args - value: - - --worker - - - it: should pass with extraArgs set - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - extraArgs: - - --port - - 8000 - asserts: - - equal: - path: spec.template.spec.containers[0].args - value: - - --port - - "8000" - - - it: should pass with extraArgs set from tpl - documentIndex: *deploymentDoc - set: - some_port: 9000 - controllers: - main: - pod: - containers: - main: - extraArgs: - - --port - - "{{ .Values.some_port }}" - asserts: - - equal: - path: spec.template.spec.containers[0].args - value: - - --port - - "9000" - - - it: should pass with args and extraArgs set - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - args: - - --port - - 8000 - extraArgs: - - --photos - - /photos - asserts: - - equal: - path: spec.template.spec.containers[0].args - value: - - --port - - "8000" - - --photos - - /photos - - - it: should pass with args and extraArgs set from tpl - documentIndex: *deploymentDoc - set: - some_port: 9000 - some_path: /photos - controllers: - main: - pod: - containers: - main: - args: - - --port - - "{{ .Values.some_port }}" - extraArgs: - - --photos - - "{{ .Values.some_path }}" - asserts: - - equal: - path: spec.template.spec.containers[0].args - value: - - --port - - "9000" - - --photos - - /photos - - - it: should pass with args and extraArgs set - single values - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - args: --path - extraArgs: /photos - asserts: - - equal: - path: spec.template.spec.containers[0].args - value: - - --path - - /photos - - - it: should pass with args and extraArgs set from tpl - single values - documentIndex: *deploymentDoc - set: - some_arg: --path - some_path: /photos - controllers: - main: - pod: - containers: - main: - args: "{{ .Values.some_arg }}" - extraArgs: "{{ .Values.some_path }}" - asserts: - - equal: - path: spec.template.spec.containers[0].args - value: - - --path - - /photos diff --git a/.to_be_deleted/common-test/tests/container_in_deployment/env_from.yaml b/.to_be_deleted/common-test/tests/container_in_deployment/env_from.yaml deleted file mode 100644 index ee89c2f5a8..0000000000 --- a/.to_be_deleted/common-test/tests/container_in_deployment/env_from.yaml +++ /dev/null @@ -1,189 +0,0 @@ -suite: container in deployment envFrom test -templates: - - common.yaml -tests: - - it: should pass with default values - documentIndex: &deploymentDoc 0 - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Deployment - - - it: should fail with envFrom configMapRef has empty name - set: - controllers: - main: - pod: - containers: - main: - envFrom: - - configMapRef: - name: "" - asserts: - - failedTemplate: - errorMessage: Name is required for configMapRef in envFrom. - - - it: should fail with envFrom secretRef has empty name - set: - controllers: - main: - pod: - containers: - main: - envFrom: - - secretRef: - name: "" - asserts: - - failedTemplate: - errorMessage: Name is required for secretRef in envFrom. - - - it: should fail with envFrom secretRef has missing name - set: - controllers: - main: - pod: - containers: - main: - envFrom: - - secretRef: - asserts: - - failedTemplate: - errorMessage: Not valid Ref or key is missing in envFrom. - - - it: should fail with envFrom configMapRef has missing name - set: - controllers: - main: - pod: - containers: - main: - envFrom: - - configMapRef: - asserts: - - failedTemplate: - errorMessage: Not valid Ref or key is missing in envFrom. - - - it: should fail with envFrom configMapRef and secretRef on the same item - set: - controllers: - main: - pod: - containers: - main: - envFrom: - - configMapRef: - name: something - secretRef: - name: something - asserts: - - failedTemplate: - errorMessage: You can't define both secretRef and configMapRef on the same item. - - - it: should pass with envFrom configMapRef entry added - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - envFrom: - - configMapRef: - name: some_name - asserts: - - equal: - path: spec.template.spec.containers[0].envFrom - value: - - configMapRef: - name: some_name - - - it: should pass with envFrom configMapRef entries added from tpl - documentIndex: *deploymentDoc - set: - some_name: a_name - some_name2: a_name2 - controllers: - main: - pod: - containers: - main: - envFrom: - - configMapRef: - name: "{{ .Values.some_name }}" - - configMapRef: - name: "{{ .Values.some_name2 }}" - asserts: - - equal: - path: spec.template.spec.containers[0].envFrom - value: - - configMapRef: - name: a_name - - configMapRef: - name: a_name2 - - - it: should pass with envFrom secretRef entry added - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - envFrom: - - secretRef: - name: some_name - asserts: - - equal: - path: spec.template.spec.containers[0].envFrom - value: - - secretRef: - name: some_name - - - it: should pass with envFrom secretRef entries added from tpl - documentIndex: *deploymentDoc - set: - some_name: a_name - some_name2: a_name2 - controllers: - main: - pod: - containers: - main: - envFrom: - - secretRef: - name: "{{ .Values.some_name }}" - - secretRef: - name: "{{ .Values.some_name2 }}" - asserts: - - equal: - path: spec.template.spec.containers[0].envFrom - value: - - secretRef: - name: a_name - - secretRef: - name: a_name2 - - - it: should pass with envFrom secretRef and configMapRef entries added from tpl - documentIndex: *deploymentDoc - set: - some_name: a_name - some_name2: a_name2 - controllers: - main: - pod: - containers: - main: - envFrom: - - secretRef: - name: "{{ .Values.some_name }}" - - configMapRef: - name: "{{ .Values.some_name2 }}" - asserts: - - equal: - path: spec.template.spec.containers[0].envFrom - value: - - secretRef: - name: a_name - - configMapRef: - name: a_name2 diff --git a/.to_be_deleted/common-test/tests/container_in_deployment/env_list.yaml b/.to_be_deleted/common-test/tests/container_in_deployment/env_list.yaml deleted file mode 100644 index af2c9b5164..0000000000 --- a/.to_be_deleted/common-test/tests/container_in_deployment/env_list.yaml +++ /dev/null @@ -1,223 +0,0 @@ -suite: container in deployment env list test -templates: - - common.yaml -tests: - - it: should pass with default values - documentIndex: &deploymentDoc 0 - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Deployment - - - it: should fail with envList missing name - set: - controllers: - main: - pod: - containers: - main: - envList: - - value: some_value - asserts: - - failedTemplate: - errorMessage: Please specify both name and value for environment variable - - - it: should fail with envList missing value - set: - controllers: - main: - pod: - containers: - main: - envList: - - name: some_name - asserts: - - failedTemplate: - errorMessage: Please specify both name and value for environment variable - - - it: should fail with envList name as a map - set: - controllers: - main: - pod: - containers: - main: - envList: - - name: - some_key: some_value - value: some_value - asserts: - - failedTemplate: - errorMessage: Name in envList cannot be a map or slice - - - it: should fail with envList name as a slice - set: - controllers: - main: - pod: - containers: - main: - envList: - - name: - - some_key: some_value - value: some_value - asserts: - - failedTemplate: - errorMessage: Name in envList cannot be a map or slice - - - it: should fail with envList value as a map - set: - controllers: - main: - pod: - containers: - main: - envList: - - name: some_name - value: - some_key: some_value - asserts: - - failedTemplate: - errorMessage: Value in envList cannot be a map or slice - - - it: should fail with envList value as a slice - set: - controllers: - main: - pod: - containers: - main: - envList: - - name: some_name - value: - - some_key: some_value - asserts: - - failedTemplate: - errorMessage: Value in envList cannot be a map or slice - - - it: should pass with envList entry added - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - envList: - - name: some_name - value: some_value - asserts: - - equal: - path: spec.template.spec.containers[0].env - value: - - name: TZ - value: UTC - - name: UMASK - value: "002" - - name: UMASK_SET - value: "002" - - name: NVIDIA_VISIBLE_DEVICES - value: void - - name: S6_READ_ONLY_ROOT - value: "1" - - name: some_name - value: some_value - - - it: should pass with envList entries added - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - envList: - - name: some_name - value: some_value - - name: some_name2 - value: some_value2 - asserts: - - equal: - path: spec.template.spec.containers[0].env - value: - - name: TZ - value: UTC - - name: UMASK - value: "002" - - name: UMASK_SET - value: "002" - - name: NVIDIA_VISIBLE_DEVICES - value: void - - name: S6_READ_ONLY_ROOT - value: "1" - - name: some_name - value: some_value - - name: some_name2 - value: some_value2 - - - it: should pass with envList entry added from tpl - documentIndex: *deploymentDoc - set: - some_name: a_name - some_value: a_value - controllers: - main: - pod: - containers: - main: - envList: - - name: "{{ .Values.some_name }}" - value: "{{ .Values.some_value }}" - asserts: - - equal: - path: spec.template.spec.containers[0].env - value: - - name: TZ - value: UTC - - name: UMASK - value: "002" - - name: UMASK_SET - value: "002" - - name: NVIDIA_VISIBLE_DEVICES - value: void - - name: S6_READ_ONLY_ROOT - value: "1" - - name: a_name - value: a_value - - - it: should pass with envList entries added - documentIndex: *deploymentDoc - set: - some_name: a_name - some_value: a_value - some_name2: a_name2 - some_value2: a_value2 - controllers: - main: - pod: - containers: - main: - envList: - - name: "{{ .Values.some_name }}" - value: "{{ .Values.some_value }}" - - name: "{{ .Values.some_name2 }}" - value: "{{ .Values.some_value2 }}" - asserts: - - equal: - path: spec.template.spec.containers[0].env - value: - - name: TZ - value: UTC - - name: UMASK - value: "002" - - name: UMASK_SET - value: "002" - - name: NVIDIA_VISIBLE_DEVICES - value: void - - name: S6_READ_ONLY_ROOT - value: "1" - - name: a_name - value: a_value - - name: a_name2 - value: a_value2 diff --git a/.to_be_deleted/common-test/tests/container_in_deployment/env_test.yaml b/.to_be_deleted/common-test/tests/container_in_deployment/env_test.yaml deleted file mode 100644 index 1a1cd4fec7..0000000000 --- a/.to_be_deleted/common-test/tests/container_in_deployment/env_test.yaml +++ /dev/null @@ -1,870 +0,0 @@ -suite: container in deployment env test -templates: - - common.yaml -tests: - - it: should pass with default values - documentIndex: &deploymentDoc 0 - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Deployment - - - it: should fail with envs defined as a list - set: - controllers: - main: - pod: - containers: - main: - env: - - name: some_name - value: some_value - asserts: - - failedTemplate: - errorMessage: Environment Variables as a list is not supported. Use key-value format. - - - it: should fail with envs defined with an invalid keyRef - set: - controllers: - main: - pod: - containers: - main: - env: - ENVVAR: - invalidKeyRef: - name: blabla - key: blbla - asserts: - - failedTemplate: - errorMessage: Not a valid valueFrom reference. Valid options are (configMapKeyRef and secretKeyRef) - - - it: should fail with envs defined without a name in configMapKeyRef - set: - controllers: - main: - pod: - containers: - main: - env: - ENVVAR: - configMapKeyRef: - key: some_key - asserts: - - failedTemplate: - errorMessage: for the keyRef is not defined in (ENVVAR) - - - it: should fail with envs defined without a name in secretKeyRef - set: - controllers: - main: - pod: - containers: - main: - env: - ENVVAR: - secretKeyRef: - key: some_key - asserts: - - failedTemplate: - errorMessage: for the keyRef is not defined in (ENVVAR) - - - it: should fail with envs defined without a key in configMapKeyRef - set: - controllers: - main: - pod: - containers: - main: - env: - ENVVAR: - configMapKeyRef: - name: some_name - asserts: - - failedTemplate: - errorMessage: for the keyRef is not defined in (ENVVAR) - - - it: should fail with envs defined without a key in secretKeyRef - set: - controllers: - main: - pod: - containers: - main: - env: - ENVVAR: - secretKeyRef: - name: some_name - asserts: - - failedTemplate: - errorMessage: for the keyRef is not defined in (ENVVAR) - - - it: should fail with envs defined with a non-bool in secretKeyRef - set: - controllers: - main: - pod: - containers: - main: - env: - ENVVAR: - secretKeyRef: - name: some_name - key: some_key - optional: non-bool - asserts: - - failedTemplate: - errorMessage: in secretKeyRef must be a boolean on Environment Variable (ENVVAR) - - - it: should fail with envs defined with valueFrom key - set: - controllers: - main: - pod: - containers: - main: - env: - ENVVAR: - valueFrom: - secretKeyRef: - name: some_name - key: some_key - optional: non-bool - asserts: - - failedTemplate: - errorMessage: Please remove and use directly configMapKeyRef or secretKeyRef - - - it: should fail with envs defined with optional in configMapKeyRef - set: - controllers: - main: - pod: - containers: - main: - env: - ENVVAR: - configMapKeyRef: - name: some_name - key: some_key - optional: non-bool - asserts: - - failedTemplate: - errorMessage: is not supported in configMapRefKey - - - it: should fail with env trying to override fixedEnv - set: - controllers: - main: - pod: - containers: - main: - env: - TZ: something - asserts: - - failedTemplate: - errorMessage: Environment Variable (TZ) on container (RELEASE-NAME-common-test) is set more than once. [to (UTC) on (fixedEnv)] and [to (something) on (env)] - - - it: should fail with env trying to override configmap - set: - controllers: - main: - pod: - containers: - main: - env: - ENVVAR: something - envFrom: - - configMapRef: - name: '{{ include "ix.v1.common.names.fullname" . }}-somename' - configmap: - somename: - enabled: true - parseAsEnv: true - content: - ENVVAR: ABC - asserts: - - failedTemplate: - errorMessage: Environment Variable (ENVVAR) on container (RELEASE-NAME-common-test) is set more than once. [to (something) on (env)] and [to (ABC) on (configmap-RELEASE-NAME-common-test-somename)] - - - it: should fail with env trying to override secret - set: - controllers: - main: - pod: - containers: - main: - env: - ENVVAR: something - envFrom: - - secretRef: - name: RELEASE-NAME-common-test-somename - secret: - somename: - enabled: true - parseAsEnv: true - content: - ENVVAR: ABC - asserts: - - failedTemplate: - errorMessage: Environment Variable (ENVVAR) on container (RELEASE-NAME-common-test) is set more than once. [to (something) on (env)] and [to (ABC) on (secret-RELEASE-NAME-common-test-somename)] - - - it: should fail with env trying to override envList - set: - controllers: - main: - pod: - containers: - main: - env: - ENVVAR: something - envList: - - name: ENVVAR - value: ABC - asserts: - - failedTemplate: - errorMessage: Environment Variable (ENVVAR) on container (RELEASE-NAME-common-test) is set more than once. [to (something) on (env)] and [to (ABC) on (envList)] - - - it: should fail with envList trying to override fixedEnv - set: - controllers: - main: - pod: - containers: - main: - envList: - - name: TZ - value: something - asserts: - - failedTemplate: - errorMessage: Environment Variable (TZ) on container (RELEASE-NAME-common-test) is set more than once. [to (UTC) on (fixedEnv)] and [to (something) on (envList)] - - - it: should fail with envList trying to override env - set: - controllers: - main: - pod: - containers: - main: - env: - POSTGRES_HOST: postgres.svc.cluster.local - envList: - - name: POSTGRES_HOST - value: something - asserts: - - failedTemplate: - errorMessage: Environment Variable (POSTGRES_HOST) on container (RELEASE-NAME-common-test) is set more than once. [to (postgres.svc.cluster.local) on (env)] and [to (something) on (envList)] - - - it: should fail with envList trying to override configmap - set: - controllers: - main: - pod: - containers: - main: - envList: - - name: POSTGRES_HOST - value: something - envFrom: - - configMapRef: - name: '{{ include "ix.v1.common.names.fullname" . }}-somename' - configmap: - somename: - enabled: true - parseAsEnv: true - content: - POSTGRES_HOST: something - asserts: - - failedTemplate: - errorMessage: Environment Variable (POSTGRES_HOST) on container (RELEASE-NAME-common-test) is set more than once. [to (something) on (envList)] and [to (something) on (configmap-RELEASE-NAME-common-test-somename)] - - - it: should fail with envList trying to override secret - set: - controllers: - main: - pod: - containers: - main: - envList: - - name: POSTGRES_HOST - value: something - envFrom: - - secretRef: - name: RELEASE-NAME-common-test-somename - secret: - somename: - enabled: true - parseAsEnv: true - content: - POSTGRES_HOST: something - asserts: - - failedTemplate: - errorMessage: Environment Variable (POSTGRES_HOST) on container (RELEASE-NAME-common-test) is set more than once. [to (something) on (envList)] and [to (something) on (secret-RELEASE-NAME-common-test-somename)] - - - it: should fail with configmap trying to override fixedEnv - set: - configmap: - somename: - enabled: true - parseAsEnv: true - content: - TZ: something - controllers: - main: - pod: - containers: - main: - envFrom: - - configMapRef: - name: '{{ include "ix.v1.common.names.fullname" . }}-somename' - asserts: - - failedTemplate: - errorMessage: Environment Variable (TZ) on container (RELEASE-NAME-common-test) is set more than once. [to (UTC) on (fixedEnv)] and [to (something) on (configmap-RELEASE-NAME-common-test-somename)] - - - it: should fail with configmap trying to override env - set: - controllers: - main: - pod: - containers: - main: - env: - POSTGRES_HOST: postgres.svc.cluster.local - envFrom: - - configMapRef: - name: '{{ include "ix.v1.common.names.fullname" . }}-somename' - configmap: - somename: - enabled: true - parseAsEnv: true - content: - POSTGRES_HOST: something - asserts: - - failedTemplate: - errorMessage: Environment Variable (POSTGRES_HOST) on container (RELEASE-NAME-common-test) is set more than once. [to (postgres.svc.cluster.local) on (env)] and [to (something) on (configmap-RELEASE-NAME-common-test-somename)] - - - it: should fail with configmap trying to override envList - set: - controllers: - main: - pod: - containers: - main: - envList: - - name: POSTGRES_HOST - value: postgres.svc.cluster.local - envFrom: - - configMapRef: - name: '{{ include "ix.v1.common.names.fullname" . }}-somename' - configmap: - somename: - enabled: true - parseAsEnv: true - content: - POSTGRES_HOST: something - asserts: - - failedTemplate: - errorMessage: Environment Variable (POSTGRES_HOST) on container (RELEASE-NAME-common-test) is set more than once. [to (postgres.svc.cluster.local) on (envList)] and [to (something) on (configmap-RELEASE-NAME-common-test-somename)] - - - it: should fail with configmap trying to override secret - set: - secret: - somename: - enabled: true - parseAsEnv: true - content: - POSTGRES_HOST: something123 - configmap: - somename: - enabled: true - parseAsEnv: true - content: - POSTGRES_HOST: something - controllers: - main: - pod: - containers: - main: - envFrom: - - configMapRef: - name: '{{ include "ix.v1.common.names.fullname" . }}-somename' - - secretRef: - name: '{{ include "ix.v1.common.names.fullname" . }}-somename' - asserts: - - failedTemplate: - errorMessage: Environment Variable (POSTGRES_HOST) on container (RELEASE-NAME-common-test) is set more than once. [to (something) on (configmap-RELEASE-NAME-common-test-somename)] and [to (something123) on (secret-RELEASE-NAME-common-test-somename)] - - - it: should fail with secret trying to override fixedEnv - set: - secret: - somename: - enabled: true - parseAsEnv: true - content: - TZ: something - controllers: - main: - pod: - containers: - main: - envFrom: - - secretRef: - name: RELEASE-NAME-common-test-somename - asserts: - - failedTemplate: - errorMessage: Environment Variable (TZ) on container (RELEASE-NAME-common-test) is set more than once. [to (UTC) on (fixedEnv)] and [to (something) on (secret-RELEASE-NAME-common-test-somename)] - - - it: should fail with secret trying to override env - set: - controllers: - main: - pod: - containers: - main: - env: - POSTGRES_HOST: postgres.svc.cluster.local - envFrom: - - secretRef: - name: RELEASE-NAME-common-test-somename - secret: - somename: - enabled: true - parseAsEnv: true - content: - POSTGRES_HOST: something - asserts: - - failedTemplate: - errorMessage: Environment Variable (POSTGRES_HOST) on container (RELEASE-NAME-common-test) is set more than once. [to (postgres.svc.cluster.local) on (env)] and [to (something) on (secret-RELEASE-NAME-common-test-somename)] - - - it: should fail with secret trying to override envList - set: - controllers: - main: - pod: - containers: - main: - envList: - - name: POSTGRES_HOST - value: postgres.svc.cluster.local - envFrom: - - secretRef: - name: RELEASE-NAME-common-test-somename - secret: - somename: - enabled: true - parseAsEnv: true - content: - POSTGRES_HOST: something - asserts: - - failedTemplate: - errorMessage: Environment Variable (POSTGRES_HOST) on container (RELEASE-NAME-common-test) is set more than once. [to (postgres.svc.cluster.local) on (envList)] and [to (something) on (secret-RELEASE-NAME-common-test-somename)] - - - it: should fail with secret trying to override configmap - set: - configmap: - somename: - enabled: true - parseAsEnv: true - content: - POSTGRES_HOST: something123 - secret: - somename: - enabled: true - parseAsEnv: true - content: - POSTGRES_HOST: something - controllers: - main: - pod: - containers: - main: - envFrom: - - configMapRef: - name: '{{ include "ix.v1.common.names.fullname" . }}-somename' - - secretRef: - name: '{{ include "ix.v1.common.names.fullname" . }}-somename' - asserts: - - failedTemplate: - errorMessage: Environment Variable (POSTGRES_HOST) on container (RELEASE-NAME-common-test) is set more than once. [to (something123) on (configmap-RELEASE-NAME-common-test-somename)] and [to (something) on (secret-RELEASE-NAME-common-test-somename)] - - - it: should pass with envs defined with int value - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - env: - ENVVAR: 123 - asserts: - - equal: - path: spec.template.spec.containers[0].env - value: - - name: TZ - value: "UTC" - - name: UMASK - value: "002" - - name: UMASK_SET - value: "002" - - name: NVIDIA_VISIBLE_DEVICES - value: "void" - - name: S6_READ_ONLY_ROOT - value: "1" - - name: ENVVAR - value: "123" - - - it: should pass with envs defined with bool value - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - env: - ENVVAR: true - asserts: - - equal: - path: spec.template.spec.containers[0].env - value: - - name: TZ - value: "UTC" - - name: UMASK - value: "002" - - name: UMASK_SET - value: "002" - - name: NVIDIA_VISIBLE_DEVICES - value: "void" - - name: S6_READ_ONLY_ROOT - value: "1" - - name: ENVVAR - value: "true" - - - it: should pass with envs defined with string value - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - env: - ENVVAR: "some_value" - asserts: - - equal: - path: spec.template.spec.containers[0].env - value: - - name: TZ - value: "UTC" - - name: UMASK - value: "002" - - name: UMASK_SET - value: "002" - - name: NVIDIA_VISIBLE_DEVICES - value: "void" - - name: S6_READ_ONLY_ROOT - value: "1" - - name: ENVVAR - value: "some_value" - - - it: should pass with multiple envs defined via tpl - documentIndex: *deploymentDoc - set: - some_string: a_string - some_int: 123 - some_bool: false - controllers: - main: - pod: - containers: - main: - env: - ENVVAR: "{{ .Values.some_string }}" - ENVVAR2: "{{ .Values.some_int }}" - ENVVAR3: "{{ .Values.some_bool }}" - asserts: - - equal: - path: spec.template.spec.containers[0].env - value: - - name: TZ - value: "UTC" - - name: UMASK - value: "002" - - name: UMASK_SET - value: "002" - - name: NVIDIA_VISIBLE_DEVICES - value: "void" - - name: S6_READ_ONLY_ROOT - value: "1" - - name: ENVVAR - value: "a_string" - - name: ENVVAR2 - value: "123" - - name: ENVVAR3 - value: "false" - - - it: should pass with envs defined with valueFrom configMapKeyRef - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - env: - ENVVAR: - configMapKeyRef: - name: some_name - key: some_key - asserts: - - equal: - path: spec.template.spec.containers[0].env - value: - - name: TZ - value: "UTC" - - name: UMASK - value: "002" - - name: UMASK_SET - value: "002" - - name: NVIDIA_VISIBLE_DEVICES - value: "void" - - name: S6_READ_ONLY_ROOT - value: "1" - - name: ENVVAR - valueFrom: - configMapKeyRef: - name: some_name - key: some_key - - - it: should pass with envs defined with valueFrom secretKeyRef - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - env: - ENVVAR: - secretKeyRef: - name: some_name - key: some_key - asserts: - - equal: - path: spec.template.spec.containers[0].env - value: - - name: TZ - value: "UTC" - - name: UMASK - value: "002" - - name: UMASK_SET - value: "002" - - name: NVIDIA_VISIBLE_DEVICES - value: "void" - - name: S6_READ_ONLY_ROOT - value: "1" - - name: ENVVAR - valueFrom: - secretKeyRef: - name: some_name - key: some_key - - - it: should pass with envs defined with valueFrom configMapKeyRef from tpl - documentIndex: *deploymentDoc - set: - name: some_name - key: some_key - controllers: - main: - pod: - containers: - main: - env: - ENVVAR: - configMapKeyRef: - name: "{{ .Values.name }}" - key: "{{ .Values.key }}" - asserts: - - equal: - path: spec.template.spec.containers[0].env - value: - - name: TZ - value: "UTC" - - name: UMASK - value: "002" - - name: UMASK_SET - value: "002" - - name: NVIDIA_VISIBLE_DEVICES - value: "void" - - name: S6_READ_ONLY_ROOT - value: "1" - - name: ENVVAR - valueFrom: - configMapKeyRef: - name: some_name - key: some_key - - - it: should pass with envs defined with valueFrom secretKeyRef from tpl - documentIndex: *deploymentDoc - set: - name: some_name - key: some_key - controllers: - main: - pod: - containers: - main: - env: - ENVVAR: - secretKeyRef: - name: "{{ .Values.name }}" - key: "{{ .Values.key }}" - asserts: - - equal: - path: spec.template.spec.containers[0].env - value: - - name: TZ - value: "UTC" - - name: UMASK - value: "002" - - name: UMASK_SET - value: "002" - - name: NVIDIA_VISIBLE_DEVICES - value: "void" - - name: S6_READ_ONLY_ROOT - value: "1" - - name: ENVVAR - valueFrom: - secretKeyRef: - name: some_name - key: some_key - - - it: should pass with envs defined with valueFrom secretKeyRef with true - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - env: - ENVVAR: - secretKeyRef: - name: some_name - key: some_key - optional: true - asserts: - - equal: - path: spec.template.spec.containers[0].env - value: - - name: TZ - value: "UTC" - - name: UMASK - value: "002" - - name: UMASK_SET - value: "002" - - name: NVIDIA_VISIBLE_DEVICES - value: "void" - - name: S6_READ_ONLY_ROOT - value: "1" - - name: ENVVAR - valueFrom: - secretKeyRef: - optional: true - name: some_name - key: some_key - - - it: should pass with envs defined with valueFrom secretKeyRef with false - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - env: - ENVVAR: - secretKeyRef: - name: some_name - key: some_key - optional: false - asserts: - - equal: - path: spec.template.spec.containers[0].env - value: - - name: TZ - value: "UTC" - - name: UMASK - value: "002" - - name: UMASK_SET - value: "002" - - name: NVIDIA_VISIBLE_DEVICES - value: "void" - - name: S6_READ_ONLY_ROOT - value: "1" - - name: ENVVAR - valueFrom: - secretKeyRef: - optional: false - name: some_name - key: some_key - - - it: should pass with multiple envs defined with valueFrom configMapKeyRef and secretKeyRef via tpl - documentIndex: *deploymentDoc - set: - name: some_name - key: some_key - name2: some_name2 - key2: some_key2 - name3: some_name3 - key3: some_key3 - controllers: - main: - pod: - containers: - main: - env: - ENVVAR: - configMapKeyRef: - name: "{{ .Values.name }}" - key: "{{ .Values.key }}" - ENVVAR2: - secretKeyRef: - name: "{{ .Values.name2 }}" - key: "{{ .Values.key2 }}" - optional: false - ENVVAR3: - secretKeyRef: - name: "{{ .Values.name3 }}" - key: "{{ .Values.key3 }}" - asserts: - - equal: - path: spec.template.spec.containers[0].env - value: - - name: TZ - value: "UTC" - - name: UMASK - value: "002" - - name: UMASK_SET - value: "002" - - name: NVIDIA_VISIBLE_DEVICES - value: "void" - - name: S6_READ_ONLY_ROOT - value: "1" - - name: ENVVAR - valueFrom: - configMapKeyRef: - name: some_name - key: some_key - - name: ENVVAR2 - valueFrom: - secretKeyRef: - name: some_name2 - key: some_key2 - optional: false - - name: ENVVAR3 - valueFrom: - secretKeyRef: - name: some_name3 - key: some_key3 diff --git a/.to_be_deleted/common-test/tests/container_in_deployment/fixedEnv_test.yaml b/.to_be_deleted/common-test/tests/container_in_deployment/fixedEnv_test.yaml deleted file mode 100644 index 47684e8682..0000000000 --- a/.to_be_deleted/common-test/tests/container_in_deployment/fixedEnv_test.yaml +++ /dev/null @@ -1,460 +0,0 @@ -suite: container in deployment fixed env test -templates: - - common.yaml -tests: - - it: should pass with default values - documentIndex: &deploymentDoc 0 - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Deployment - - - it: should fail with empty PUID - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - PUID: - asserts: - - failedTemplate: - errorMessage: key cannot be empty. Set a value or remove the key for the default (568) to take effect. - - - it: should fail with PUID not-int - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - PUID: "1000" - asserts: - - failedTemplate: - errorMessage: key has value of ("1000"). But must be an int. - - - it: should fail with empty UMASK - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - UMASK: - asserts: - - failedTemplate: - errorMessage: key cannot be empty. Set a value or remove the key for the default (002) to take effect. - - - it: should fail with UMASK not-string - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - UMASK: 2 - asserts: - - failedTemplate: - errorMessage: key must be a string, so the format is kept intact. - - - it: should pass with injectFixedEnvs false - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - injectFixedEnvs: false - asserts: - - isNull: - path: spec.template.spec.containers[0].env - - - it: should pass with TZ and UMASK changed - documentIndex: *deploymentDoc - set: - TZ: ETC - UMASK: "003" - asserts: - - equal: - path: spec.template.spec.containers[0].env - value: - - name: TZ - value: ETC - - name: UMASK - value: "003" - - name: UMASK_SET - value: "003" - - name: NVIDIA_VISIBLE_DEVICES - value: void - - name: S6_READ_ONLY_ROOT - value: "1" - - - it: should pass with an env referencing TZ and PUID - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - securityContext: - runAsUser: 0 - runAsNonRoot: false - env: - TIMEZONE: "{{ .Values.TZ }}" - APP_USER_ID: "{{ .Values.PUID }}" - asserts: - - equal: - path: spec.template.spec.containers[0].env - value: - - name: TZ - value: UTC - - name: UMASK - value: "002" - - name: UMASK_SET - value: "002" - - name: NVIDIA_VISIBLE_DEVICES - value: void - - name: PUID - value: "568" - - name: USER_ID - value: "568" - - name: UID - value: "568" - - name: PGID - value: "568" - - name: GROUP_ID - value: "568" - - name: GID - value: "568" - - name: S6_READ_ONLY_ROOT - value: "1" - - name: APP_USER_ID - value: "568" - - name: TIMEZONE - value: UTC - - - it: should pass without S6_READ_ONLY_ROOT - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - securityContext: - readOnlyRootFilesystem: false - runAsNonRoot: false - asserts: - - equal: - path: spec.template.spec.containers[0].env - value: - - name: TZ - value: UTC - - name: UMASK - value: "002" - - name: UMASK_SET - value: "002" - - name: NVIDIA_VISIBLE_DEVICES - value: void - - - it: should pass with scaleGPU set - documentIndex: *deploymentDoc - set: - scaleGPU: - gpu.intel.com/i915: "1" - asserts: - - equal: - path: spec.template.spec.containers[0].env - value: - - name: TZ - value: UTC - - name: UMASK - value: "002" - - name: UMASK_SET - value: "002" - - name: NVIDIA_DRIVER_CAPABILITIES - value: all - - name: S6_READ_ONLY_ROOT - value: "1" - - - it: should pass with envs changed because run as user root - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - securityContext: - runAsUser: 0 - runAsNonRoot: false - asserts: - - equal: - path: spec.template.spec.containers[0].env - value: - - name: TZ - value: UTC - - name: UMASK - value: "002" - - name: UMASK_SET - value: "002" - - name: NVIDIA_VISIBLE_DEVICES - value: void - - name: PUID - value: "568" - - name: USER_ID - value: "568" - - name: UID - value: "568" - - name: PGID - value: "568" - - name: GROUP_ID - value: "568" - - name: GID - value: "568" - - name: S6_READ_ONLY_ROOT - value: "1" - - - it: should pass with envs changed because run as group root - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - securityContext: - runAsGroup: 0 - runAsNonRoot: false - asserts: - - equal: - path: spec.template.spec.containers[0].env - value: - - name: TZ - value: UTC - - name: UMASK - value: "002" - - name: UMASK_SET - value: "002" - - name: NVIDIA_VISIBLE_DEVICES - value: void - - name: PUID - value: "568" - - name: USER_ID - value: "568" - - name: UID - value: "568" - - name: PGID - value: "568" - - name: GROUP_ID - value: "568" - - name: GID - value: "568" - - name: S6_READ_ONLY_ROOT - value: "1" - - - it: should pass with envs changed because run as user root and PUID 0 - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - securityContext: - runAsUser: 0 - runAsNonRoot: false - PUID: 0 - asserts: - - equal: - path: spec.template.spec.containers[0].env - value: - - name: TZ - value: UTC - - name: UMASK - value: "002" - - name: UMASK_SET - value: "002" - - name: NVIDIA_VISIBLE_DEVICES - value: void - - name: PUID - value: "0" - - name: USER_ID - value: "0" - - name: UID - value: "0" - - name: PGID - value: "568" - - name: GROUP_ID - value: "568" - - name: GID - value: "568" - - name: S6_READ_ONLY_ROOT - value: "1" - - - it: should pass with envs changed because run as group root and PUID 0 - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - securityContext: - runAsGroup: 0 - runAsNonRoot: false - PUID: 0 - asserts: - - equal: - path: spec.template.spec.containers[0].env - value: - - name: TZ - value: UTC - - name: UMASK - value: "002" - - name: UMASK_SET - value: "002" - - name: NVIDIA_VISIBLE_DEVICES - value: void - - name: PUID - value: "0" - - name: USER_ID - value: "0" - - name: UID - value: "0" - - name: PGID - value: "568" - - name: GROUP_ID - value: "568" - - name: GID - value: "568" - - name: S6_READ_ONLY_ROOT - value: "1" - - - it: should pass with envs changed because run as group root and fsGroup 0 and PUID 0 - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - securityContext: - fsGroup: 0 - containers: - main: - securityContext: - runAsGroup: 0 - runAsNonRoot: false - PUID: 0 - asserts: - - equal: - path: spec.template.spec.containers[0].env - value: - - name: TZ - value: UTC - - name: UMASK - value: "002" - - name: UMASK_SET - value: "002" - - name: NVIDIA_VISIBLE_DEVICES - value: void - - name: PUID - value: "0" - - name: USER_ID - value: "0" - - name: UID - value: "0" - - name: PGID - value: "0" - - name: GROUP_ID - value: "0" - - name: GID - value: "0" - - name: S6_READ_ONLY_ROOT - value: "1" - - - it: should pass with envs defined with scaleGPU - documentIndex: *deploymentDoc - set: - scaleGPU: - gpu.intel.com/i915: "1" - asserts: - - equal: - path: spec.template.spec.containers[0].env - value: - - name: TZ - value: "UTC" - - name: UMASK - value: "002" - - name: UMASK_SET - value: "002" - - name: NVIDIA_DRIVER_CAPABILITIES - value: "all" - - name: S6_READ_ONLY_ROOT - value: "1" - - - it: should fail with non-unique nvidiaCaps - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - nvidiaCaps: - - compute - - compute - - utility - asserts: - - failedTemplate: - errorMessage: ([compute compute utility]) are must have unique values only - - - it: should fail with invalid nvidiaCaps value - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - nvidiaCaps: - - invalid - - compute - - utility - asserts: - - failedTemplate: - errorMessage: Invalid options in (invalid). Valid options are compute, utility, all, graphics, video - - - it: should pass with envs defined with scaleGPU and custom capabilities - documentIndex: *deploymentDoc - set: - scaleGPU: - gpu.intel.com/i915: "1" - controllers: - main: - pod: - containers: - main: - nvidiaCaps: - - compute - - utility - asserts: - - equal: - path: spec.template.spec.containers[0].env - value: - - name: TZ - value: "UTC" - - name: UMASK - value: "002" - - name: UMASK_SET - value: "002" - - name: NVIDIA_DRIVER_CAPABILITIES - value: "compute,utility" - - name: S6_READ_ONLY_ROOT - value: "1" diff --git a/.to_be_deleted/common-test/tests/container_in_deployment/image_test.yaml b/.to_be_deleted/common-test/tests/container_in_deployment/image_test.yaml deleted file mode 100644 index 09cd5d21ec..0000000000 --- a/.to_be_deleted/common-test/tests/container_in_deployment/image_test.yaml +++ /dev/null @@ -1,145 +0,0 @@ - -suite: container in deployment image test -templates: - - common.yaml -tests: - - it: should pass with default values - documentIndex: &deploymentDoc 0 - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Deployment - - - it: should pass with imagePullPolicy changed - documentIndex: *deploymentDoc - set: - image: - pullPolicy: Always - asserts: - - equal: - path: spec.template.spec.containers[0].imagePullPolicy - value: Always - - - it: should pass with image changed - documentIndex: *deploymentDoc - set: - image: - repository: some_repo - tag: some_tag - asserts: - - equal: - path: spec.template.spec.containers[0].image - value: some_repo:some_tag - - - it: should fail without repository - set: - image: - repository: "" - tag: some_tag - asserts: - - failedTemplate: - errorMessage: Image is required - - - it: should fail without tag - set: - image: - repository: some_repo - tag: "" - asserts: - - failedTemplate: - errorMessage: Image is required - - - it: should fail with invalid pullPolicy - set: - image: - repository: some_repo - tag: some_tag - pullPolicy: invalid_policy - asserts: - - failedTemplate: - errorMessage: Invalid option (invalid_policy). Valid options are IfNotPresent, Always, Never - - - it: should fail with selected image that does not exist in values - set: - imageX: - repository: some_repo - tag: some_tag - pullPolicy: invalid_policy - controllers: - main: - pod: - containers: - main: - imageSelector: imageY - asserts: - - failedTemplate: - errorMessage: Selected image (imageY) does not exist in values - - - it: should pass with image from image selector - documentIndex: *deploymentDoc - set: - betaImage: - repository: some_other_repo - tag: some_other_tag - controllers: - main: - pod: - containers: - main: - imageSelector: betaImage - asserts: - - equal: - path: spec.template.spec.containers[0].image - value: some_other_repo:some_other_tag - - - it: should pass with pullPolicy from image selector - documentIndex: *deploymentDoc - set: - betaImage: - repository: some_other_repo - tag: some_other_tag - pullPolicy: Never - controllers: - main: - pod: - containers: - main: - imageSelector: betaImage - asserts: - - equal: - path: spec.template.spec.containers[0].image - value: some_other_repo:some_other_tag - - equal: - path: spec.template.spec.containers[0].imagePullPolicy - value: Never - - - it: should fail without repo from image selector - set: - betaImage: - repository: "" - tag: some_other_tag - controllers: - main: - pod: - containers: - main: - imageSelector: betaImage - asserts: - - failedTemplate: - errorMessage: Image is required - - - it: should fail without tag from image selector - set: - betaImage: - repository: some_other_repo - tag: "" - controllers: - main: - pod: - containers: - main: - imageSelector: betaImage - asserts: - - failedTemplate: - errorMessage: Image is required diff --git a/.to_be_deleted/common-test/tests/container_in_deployment/lifecycle_test.yaml b/.to_be_deleted/common-test/tests/container_in_deployment/lifecycle_test.yaml deleted file mode 100644 index da81e593cc..0000000000 --- a/.to_be_deleted/common-test/tests/container_in_deployment/lifecycle_test.yaml +++ /dev/null @@ -1,258 +0,0 @@ - -suite: container in deployment lifecycle test -templates: - - common.yaml -tests: - - it: should pass with default values - documentIndex: &deploymentDoc 0 - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Deployment - - - it: should pass with single postStart lifecycle set - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - lifecycle: - postStart: - command: some_command - asserts: - - equal: - path: spec.template.spec.containers[0].lifecycle - value: - postStart: - exec: - command: - - some_command - - - it: should pass with single postStart lifecycle set from tpl - documentIndex: *deploymentDoc - set: - some_key: some_command - controllers: - main: - pod: - containers: - main: - lifecycle: - postStart: - command: "{{ .Values.some_key }}" - asserts: - - equal: - path: spec.template.spec.containers[0].lifecycle - value: - postStart: - exec: - command: - - some_command - - - it: should pass with postStart lifecycle set - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - lifecycle: - postStart: - command: - - /bin/bash - - test - asserts: - - equal: - path: spec.template.spec.containers[0].lifecycle - value: - postStart: - exec: - command: - - /bin/bash - - test - - - it: should pass with postStart lifecycle set from tpl - documentIndex: *deploymentDoc - set: - some_key: some_value - controllers: - main: - pod: - containers: - main: - lifecycle: - postStart: - command: - - /bin/bash - - "{{ .Values.some_key }}" - asserts: - - equal: - path: spec.template.spec.containers[0].lifecycle - value: - postStart: - exec: - command: - - /bin/bash - - some_value - - - it: should pass with single preStop lifecycle set - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - lifecycle: - preStop: - command: some_command - asserts: - - equal: - path: spec.template.spec.containers[0].lifecycle - value: - preStop: - exec: - command: - - some_command - - - it: should pass with single preStop lifecycle set from tpl - documentIndex: *deploymentDoc - set: - some_key: some_command - controllers: - main: - pod: - containers: - main: - lifecycle: - preStop: - command: "{{ .Values.some_key }}" - asserts: - - equal: - path: spec.template.spec.containers[0].lifecycle - value: - preStop: - exec: - command: - - some_command - - - it: should pass with preStop lifecycle set - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - lifecycle: - preStop: - command: - - /bin/bash - - test - asserts: - - equal: - path: spec.template.spec.containers[0].lifecycle - value: - preStop: - exec: - command: - - /bin/bash - - test - - - it: should pass with preStop lifecycle set from tpl - documentIndex: *deploymentDoc - set: - some_key: some_value - controllers: - main: - pod: - containers: - main: - lifecycle: - preStop: - command: - - /bin/bash - - "{{ .Values.some_key }}" - asserts: - - equal: - path: spec.template.spec.containers[0].lifecycle - value: - preStop: - exec: - command: - - /bin/bash - - some_value - - - it: should fail with invalid key - set: - controllers: - main: - pod: - containers: - main: - lifecycle: - preStart: - command: something - asserts: - - failedTemplate: - errorMessage: Invalid key (preStart) in lifecycle. Valid keys are preStop and postStart - - - it: should fail with no command in preStop - set: - controllers: - main: - pod: - containers: - main: - lifecycle: - preStop: - command: "" - asserts: - - failedTemplate: - errorMessage: No commands were given for preStop lifecycle hook - - - it: should fail with no command in postStart - set: - controllers: - main: - pod: - containers: - main: - lifecycle: - postStart: - command: "" - asserts: - - failedTemplate: - errorMessage: No commands were given for postStart lifecycle hook - - - it: should fail with no command in preStop - set: - controllers: - main: - pod: - containers: - main: - lifecycle: - preStop: - command: "" - asserts: - - failedTemplate: - errorMessage: No commands were given for preStop lifecycle hook - - - it: should fail with no command in postStart - set: - controllers: - main: - pod: - containers: - main: - lifecycle: - postStart: - command: "" - asserts: - - failedTemplate: - errorMessage: No commands were given for postStart lifecycle hook diff --git a/.to_be_deleted/common-test/tests/container_in_deployment/port_test.yaml b/.to_be_deleted/common-test/tests/container_in_deployment/port_test.yaml deleted file mode 100644 index a1607b25bf..0000000000 --- a/.to_be_deleted/common-test/tests/container_in_deployment/port_test.yaml +++ /dev/null @@ -1,240 +0,0 @@ -suite: container in deployment port test -templates: - - common.yaml -tests: - - it: should pass with default values - documentIndex: &deploymentDoc 0 - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Deployment - - - it: should fail with named port - set: - service: - main: - ports: - main: - port: 443 - targetPort: some_name - asserts: - - failedTemplate: - errorMessage: This common library does not support named ports for targetPort. port name (main), targetPort (some_name) - - - it: should fail without port - set: - service: - main: - ports: - main: - port: - asserts: - - failedTemplate: - errorMessage: Port is required on enabled services. Service (main) - - - it: should fail with multiple port, but none set as primary - set: - service: - main: - ports: - main: - enabled: true - primary: false - port: 65535 - main2: - enabled: true - primary: false - port: 65534 - asserts: - - failedTemplate: - errorMessage: At least one port must be set as primary in service (main) - - - it: should fail without ports dict in an enabled service - set: - service: - other: - enabled: true - asserts: - - failedTemplate: - errorMessage: At least one port is required in an enabled service (other) - - - it: should fail with disabled port on enabled service - set: - service: - main: - ports: - main: - enabled: false - asserts: - - failedTemplate: - errorMessage: No ports are enabled for the service - - - it: should fail with invalid protocol - set: - service: - main: - ports: - main: - port: 443 - protocol: NOT_VALID - asserts: - - failedTemplate: - errorMessage: Not valid (NOT_VALID) - - - it: should pass with only port set - documentIndex: *deploymentDoc - set: - service: - main: - ports: - main: - port: 443 - asserts: - - equal: - path: spec.template.spec.containers[0].ports[0] - value: - name: main - containerPort: 443 - protocol: TCP - - - it: should pass with port and targetPort set - documentIndex: *deploymentDoc - set: - service: - main: - ports: - main: - port: 443 - targetPort: 8000 - asserts: - - equal: - path: spec.template.spec.containers[0].ports[0] - value: - name: main - containerPort: 8000 - protocol: TCP - - - it: should pass with port and targetPort and protocol set - documentIndex: *deploymentDoc - set: - service: - main: - ports: - main: - port: 443 - protocol: TCP - targetPort: 8000 - asserts: - - equal: - path: spec.template.spec.containers[0].ports[0] - value: - name: main - containerPort: 8000 - protocol: TCP - - - it: should pass with port and targetPort and protocol UDP set - documentIndex: *deploymentDoc - set: - service: - main: - ports: - main: - port: 443 - protocol: UDP - targetPort: 8000 - controllers: - main: - pod: - containers: - main: - probes: - liveness: - enabled: false - readiness: - enabled: false - startup: - enabled: false - asserts: - - equal: - path: spec.template.spec.containers[0].ports[0] - value: - name: main - containerPort: 8000 - protocol: UDP - - - it: should pass with port and targetPort and protocol HTTP set - documentIndex: *deploymentDoc - set: - service: - main: - ports: - main: - port: 443 - protocol: HTTP - targetPort: 8000 - asserts: - - equal: - path: spec.template.spec.containers[0].ports[0] - value: - name: main - containerPort: 8000 - protocol: TCP - - - it: should pass with port and targetPort and protocol HTTPS set - documentIndex: *deploymentDoc - set: - service: - main: - ports: - main: - port: 443 - protocol: HTTPS - targetPort: 8000 - asserts: - - equal: - path: spec.template.spec.containers[0].ports[0] - value: - name: main - containerPort: 8000 - protocol: TCP - - - it: should pass with multiple port and targetPort and protocol set - documentIndex: *deploymentDoc - set: - service: - main: - ports: - main: - port: 443 - protocol: HTTP - targetPort: 8000 - secondary: - enabled: true - ports: - secondary: - enabled: true - port: 444 - protocol: TCP - targetPort: 8001 - third: - enabled: true - ports: - third: - enabled: true - port: 445 - protocol: UDP - targetPort: 8002 - asserts: - - equal: - path: spec.template.spec.containers[0].ports - value: - - name: main - containerPort: 8000 - protocol: TCP - - name: secondary - containerPort: 8001 - protocol: TCP - - name: third - containerPort: 8002 - protocol: UDP diff --git a/.to_be_deleted/common-test/tests/container_in_deployment/probe_test.yaml b/.to_be_deleted/common-test/tests/container_in_deployment/probe_test.yaml deleted file mode 100644 index 7324492733..0000000000 --- a/.to_be_deleted/common-test/tests/container_in_deployment/probe_test.yaml +++ /dev/null @@ -1,931 +0,0 @@ -suite: container in deployment probe test -templates: - - common.yaml -tests: - - it: should pass with default values - documentIndex: &deploymentDoc 0 - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Deployment - - isSubset: - path: spec.template.spec.containers[0] - content: - livenessProbe: - httpGet: - path: / - scheme: HTTP - port: 65535 - initialDelaySeconds: 10 - failureThreshold: 5 - timeoutSeconds: 5 - periodSeconds: 10 - readinessProbe: - httpGet: - path: / - scheme: HTTP - port: 65535 - initialDelaySeconds: 10 - failureThreshold: 5 - timeoutSeconds: 5 - periodSeconds: 10 - startupProbe: - httpGet: - path: / - scheme: HTTP - port: 65535 - initialDelaySeconds: 10 - failureThreshold: 60 - timeoutSeconds: 2 - periodSeconds: 5 - - - it: should fail with wrong probe name - set: - controllers: - main: - pod: - containers: - main: - probes: - invalid_probe_name: - asserts: - - failedTemplate: - errorMessage: Invalid probe name (invalid_probe_name) in (RELEASE-NAME-common-test) container. Valid options are (liveness, readiness, startup) - - - it: should fail with auto probe type and no service enabled - set: - service: - main: - enabled: false - controllers: - main: - pod: - containers: - main: - probes: - liveness: - type: auto - asserts: - - failedTemplate: - errorMessage: probe type in probe (liveness) in (RELEASE-NAME-common-test) container, is only supported for the main container and only if there is at least 1 port enabled - - - it: should fail with probe type set to UDP - set: - controllers: - main: - pod: - containers: - main: - probes: - liveness: - type: udp - asserts: - - failedTemplate: - errorMessage: Invalid probe type (udp) on probe (liveness) in (RELEASE-NAME-common-test) container. Valid types are tcp, http, https, grpc, exec, auto - - - it: should fail with probe type auto and port protocol UDP - set: - controllers: - main: - pod: - containers: - main: - probes: - liveness: - type: auto - service: - main: - ports: - main: - port: 65535 - protocol: UDP - asserts: - - failedTemplate: - errorMessage: UDP Probes are not supported. Please use a different probe type or disable probes in (RELEASE-NAME-common-test) container. - - - it: should fail without commands on exec probe - set: - controllers: - main: - pod: - containers: - main: - probes: - liveness: - type: exec - asserts: - - failedTemplate: - errorMessage: No commands were defined for type on probe (liveness) in (RELEASE-NAME-common-test) container. - - - it: should fail without port on http(s) liveness probe and disabled service - set: - service: - main: - enabled: false - ports: - main: - enabled: false - controllers: - main: - pod: - containers: - main: - probes: - liveness: - path: "/" - type: http - asserts: - - failedTemplate: - errorMessage: must be defined for / probe types in probe (liveness) in (RELEASE-NAME-common-test) container. - - - it: should fail without port on http(s) liveness probe and disabled service - set: - service: - main: - enabled: false - ports: - main: - enabled: false - controllers: - main: - pod: - containers: - main: - probes: - liveness: - path: "/" - type: https - port: - asserts: - - failedTemplate: - errorMessage: must be defined for / probe types in probe (liveness) in (RELEASE-NAME-common-test) container. - - - it: should fail without port on http(s) liveness probe and disabled service - set: - service: - main: - enabled: false - ports: - main: - enabled: false - controllers: - main: - pod: - containers: - main: - probes: - liveness: - path: "/" - type: http - port: - asserts: - - failedTemplate: - errorMessage: must be defined for / probe types in probe (liveness) in (RELEASE-NAME-common-test) container. - - - it: should fail without initialDelaySeconds on non-custom probes - set: - controllers: - main: - pod: - containers: - main: - probes: - liveness: - spec: - initialDelaySeconds: - asserts: - - failedTemplate: - errorMessage: cannot be empty in probe (liveness) in (RELEASE-NAME-common-test) container - - - it: should fail without failureThreshold on non-custom probes - set: - controllers: - main: - pod: - containers: - main: - probes: - liveness: - spec: - failureThreshold: - asserts: - - failedTemplate: - errorMessage: cannot be empty in probe (liveness) in (RELEASE-NAME-common-test) container - - - it: should fail without timeoutSeconds on non-custom probes - set: - controllers: - main: - pod: - containers: - main: - probes: - liveness: - spec: - timeoutSeconds: - asserts: - - failedTemplate: - errorMessage: cannot be empty in probe (liveness) in (RELEASE-NAME-common-test) container - - - it: should fail without periodSeconds on non-custom probes - set: - controllers: - main: - pod: - containers: - main: - probes: - liveness: - spec: - periodSeconds: - asserts: - - failedTemplate: - errorMessage: cannot be empty in probe (liveness) in (RELEASE-NAME-common-test) container - - - it: should fail with invalid probe type - set: - controllers: - main: - pod: - containers: - main: - probes: - liveness: - type: not_valid_type - asserts: - - failedTemplate: - errorMessage: Invalid probe type (not_valid_type) on probe (liveness) in (RELEASE-NAME-common-test) container. Valid types are tcp, http, https, grpc, exec, auto - - - it: should fail with probe path not starting with / - set: - controllers: - main: - pod: - containers: - main: - probes: - liveness: - type: http - path: a/random/path - asserts: - - failedTemplate: - errorMessage: Probe in container (RELEASE-NAME-common-test) with path (a/random/path), must start with a forward slash -> / <- - - - it: should fail with httpHeader value is defined as list - set: - controllers: - main: - pod: - containers: - main: - probes: - liveness: - type: http - httpHeaders: - some_header: - - list_value - - list_value2 - asserts: - - failedTemplate: - errorMessage: Lists or Dicts are not allowed in httpHeaders on probe (liveness) - - - it: should fail with httpHeader value is defined as dict - set: - controllers: - main: - pod: - containers: - main: - probes: - liveness: - type: http - httpHeaders: - some_header: - some_key: - asserts: - - failedTemplate: - errorMessage: Lists or Dicts are not allowed in httpHeaders on probe (liveness) - - - it: should fail without spec in custom defined probe - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - probes: - liveness: - type: custom - spec: {} - asserts: - - failedTemplate: - errorMessage: must be defined for probe types in probe (liveness) in (RELEASE-NAME-common-test) container. - - - it: should pass with with custom defined liveness probe - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - probes: - liveness: - type: custom - spec: - httpGet: - path: /path - scheme: HTTPS - port: 1234 - initialDelaySeconds: 15 - failureThreshold: 10 - timeoutSeconds: 10 - periodSeconds: 15 - asserts: - - equal: - path: spec.template.spec.containers[0].livenessProbe - value: - httpGet: - path: /path - scheme: HTTPS - port: 1234 - initialDelaySeconds: 15 - failureThreshold: 10 - timeoutSeconds: 10 - periodSeconds: 15 - - - it: should pass with with custom defined readiness probe - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - probes: - readiness: - type: custom - spec: - httpGet: - path: /path - scheme: HTTPS - port: 1234 - initialDelaySeconds: 15 - failureThreshold: 10 - timeoutSeconds: 10 - periodSeconds: 15 - asserts: - - equal: - path: spec.template.spec.containers[0].readinessProbe - value: - httpGet: - path: /path - scheme: HTTPS - port: 1234 - initialDelaySeconds: 15 - failureThreshold: 10 - timeoutSeconds: 10 - periodSeconds: 15 - - - it: should pass with with custom defined startup probe - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - probes: - startup: - type: custom - spec: - httpGet: - path: /path - scheme: HTTPS - port: 1234 - initialDelaySeconds: 15 - failureThreshold: 10 - timeoutSeconds: 10 - periodSeconds: 15 - asserts: - - equal: - path: spec.template.spec.containers[0].startupProbe - value: - httpGet: - path: /path - scheme: HTTPS - port: 1234 - initialDelaySeconds: 15 - failureThreshold: 10 - timeoutSeconds: 10 - periodSeconds: 15 - - - it: should pass with with no probe type and service HTTP - documentIndex: *deploymentDoc - set: - service: - main: - ports: - main: - protocol: HTTP - asserts: - - equal: - path: spec.template.spec.containers[0].livenessProbe - value: - httpGet: - path: / - scheme: HTTP - port: 65535 - initialDelaySeconds: 10 - failureThreshold: 5 - timeoutSeconds: 5 - periodSeconds: 10 - - - it: should pass with with probe type TCP and service TCP - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - probes: - liveness: - type: tcp - asserts: - - equal: - path: spec.template.spec.containers[0].livenessProbe - value: - tcpSocket: - port: 65535 - initialDelaySeconds: 10 - failureThreshold: 5 - timeoutSeconds: 5 - periodSeconds: 10 - - - it: should fail without port on tcp liveness probe and disabled service - set: - service: - main: - enabled: false - ports: - main: - enabled: false - controllers: - main: - pod: - containers: - main: - probes: - liveness: - path: "/" - type: tcp - port: "" - asserts: - - failedTemplate: - errorMessage: must be defined for probe types in probe (liveness) in (RELEASE-NAME-common-test) container. - - - it: should pass with with no probe type and service HTTP with custom path - documentIndex: *deploymentDoc - set: - service: - main: - ports: - main: - protocol: HTTP - controllers: - main: - pod: - containers: - main: - probes: - liveness: - path: /some_path - asserts: - - equal: - path: spec.template.spec.containers[0].livenessProbe - value: - httpGet: - path: /some_path - scheme: HTTP - port: 65535 - initialDelaySeconds: 10 - failureThreshold: 5 - timeoutSeconds: 5 - periodSeconds: 10 - - - it: should pass with with no probe type and service HTTP with custom port - documentIndex: *deploymentDoc - set: - service: - main: - ports: - main: - protocol: HTTP - controllers: - main: - pod: - containers: - main: - probes: - liveness: - port: 1234 - asserts: - - equal: - path: spec.template.spec.containers[0].livenessProbe - value: - httpGet: - path: / - scheme: HTTP - port: 1234 - initialDelaySeconds: 10 - failureThreshold: 5 - timeoutSeconds: 5 - periodSeconds: 10 - - - it: should pass with with no probe type and service HTTP with httpHeaders - documentIndex: *deploymentDoc - set: - service: - main: - ports: - main: - protocol: HTTP - controllers: - main: - pod: - containers: - main: - probes: - liveness: - httpHeaders: - some_header: 1234 - asserts: - - equal: - path: spec.template.spec.containers[0].livenessProbe - value: - httpGet: - path: / - scheme: HTTP - port: 65535 - httpHeaders: - - name: some_header - value: 1234 - initialDelaySeconds: 10 - failureThreshold: 5 - timeoutSeconds: 5 - periodSeconds: 10 - - - it: should pass with with probe type HTTP with httpHeaders set from tpl - documentIndex: *deploymentDoc - set: - some_header_value: 1234 - controllers: - main: - pod: - containers: - main: - probes: - liveness: - type: http - httpHeaders: - some_header: "{{ .Values.some_header_value }}" - asserts: - - equal: - path: spec.template.spec.containers[0].livenessProbe - value: - httpGet: - path: / - scheme: HTTP - port: 65535 - httpHeaders: - - name: some_header - value: 1234 - initialDelaySeconds: 10 - failureThreshold: 5 - timeoutSeconds: 5 - periodSeconds: 10 - - - it: should pass with with probe type HTTP with multiple httpHeaders set from tpl - documentIndex: *deploymentDoc - set: - some_header_value: 1234 - some_header_value2: some_value - controllers: - main: - pod: - containers: - main: - probes: - liveness: - type: http - httpHeaders: - some_header: "{{ .Values.some_header_value }}" - some_header2: "{{ .Values.some_header_value2 }}" - asserts: - - equal: - path: spec.template.spec.containers[0].livenessProbe - value: - httpGet: - path: / - scheme: HTTP - port: 65535 - httpHeaders: - - name: some_header - value: 1234 - - name: some_header2 - value: some_value - initialDelaySeconds: 10 - failureThreshold: 5 - timeoutSeconds: 5 - periodSeconds: 10 - - - it: should pass with with probe type HTTP with path set from tpl - documentIndex: *deploymentDoc - set: - some_path: /ping - controllers: - main: - pod: - containers: - main: - probes: - liveness: - type: http - path: "{{ .Values.some_path }}" - asserts: - - equal: - path: spec.template.spec.containers[0].livenessProbe - value: - httpGet: - path: /ping - scheme: HTTP - port: 65535 - initialDelaySeconds: 10 - failureThreshold: 5 - timeoutSeconds: 5 - periodSeconds: 10 - - - it: should pass with with probe type HTTP with port set from tpl - documentIndex: *deploymentDoc - set: - some_port: 1234 - controllers: - main: - pod: - containers: - main: - probes: - liveness: - type: http - port: "{{ .Values.some_port }}" - asserts: - - equal: - path: spec.template.spec.containers[0].livenessProbe - value: - httpGet: - path: / - scheme: HTTP - port: 1234 - initialDelaySeconds: 10 - failureThreshold: 5 - timeoutSeconds: 5 - periodSeconds: 10 - - - it: should pass with with probe type TCP with port set from tpl - documentIndex: *deploymentDoc - set: - some_port: 1234 - controllers: - main: - pod: - containers: - main: - probes: - liveness: - type: tcp - port: "{{ .Values.some_port }}" - asserts: - - equal: - path: spec.template.spec.containers[0].livenessProbe - value: - tcpSocket: - port: 1234 - initialDelaySeconds: 10 - failureThreshold: 5 - timeoutSeconds: 5 - periodSeconds: 10 - - - it: should pass with with changed times - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - probes: - liveness: - type: tcp - spec: - initialDelaySeconds: 15 - failureThreshold: 10 - timeoutSeconds: 10 - periodSeconds: 15 - asserts: - - equal: - path: spec.template.spec.containers[0].livenessProbe - value: - tcpSocket: - port: 65535 - initialDelaySeconds: 15 - failureThreshold: 10 - timeoutSeconds: 10 - periodSeconds: 15 - - - it: should pass with with probe type GRPC - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - probes: - liveness: - type: grpc - asserts: - - equal: - path: spec.template.spec.containers[0].livenessProbe - value: - grpc: - port: 65535 - initialDelaySeconds: 10 - failureThreshold: 5 - timeoutSeconds: 5 - periodSeconds: 10 - - - it: should fail without port on grpc liveness probe and disabled service - set: - service: - main: - enabled: false - ports: - main: - enabled: false - controllers: - main: - pod: - containers: - main: - probes: - liveness: - path: "/" - type: grpc - port: "" - asserts: - - failedTemplate: - errorMessage: must be defined for probe types in probe (liveness) in (RELEASE-NAME-common-test) container. - - - it: should pass with with probe type exec with multiline command - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - probes: - liveness: - type: exec - command: - - /bin/bash - - -c - - | - echo "probe!" - asserts: - - equal: - path: spec.template.spec.containers[0].livenessProbe - value: - exec: - command: - - /bin/bash - - -c - - | - echo "probe!" - initialDelaySeconds: 10 - failureThreshold: 5 - timeoutSeconds: 5 - periodSeconds: 10 - - - it: should pass with with probe type exec with multiline command from tpl - documentIndex: *deploymentDoc - set: - some_msg: probe! - controllers: - main: - pod: - containers: - main: - probes: - liveness: - type: exec - command: - - /bin/bash - - -c - - | - echo "{{ .Values.some_msg }}" - asserts: - - equal: - path: spec.template.spec.containers[0].livenessProbe - value: - exec: - command: - - /bin/bash - - -c - - | - echo "probe!" - initialDelaySeconds: 10 - failureThreshold: 5 - timeoutSeconds: 5 - periodSeconds: 10 - - - it: should pass with with probe type exec single command - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - probes: - liveness: - type: exec - command: env - asserts: - - equal: - path: spec.template.spec.containers[0].livenessProbe - value: - exec: - command: - - env - initialDelaySeconds: 10 - failureThreshold: 5 - timeoutSeconds: 5 - periodSeconds: 10 - - - it: should pass with with probe type exec single command from tpl - documentIndex: *deploymentDoc - set: - some_command: env - controllers: - main: - pod: - containers: - main: - probes: - liveness: - type: exec - command: "{{ .Values.some_command }}" - asserts: - - equal: - path: spec.template.spec.containers[0].livenessProbe - value: - exec: - command: - - env - initialDelaySeconds: 10 - failureThreshold: 5 - timeoutSeconds: 5 - periodSeconds: 10 - - - it: should pass with with probe type exec single command and custom timings - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - probes: - liveness: - type: exec - command: env - spec: - initialDelaySeconds: 15 - failureThreshold: 10 - timeoutSeconds: 10 - periodSeconds: 15 - asserts: - - equal: - path: spec.template.spec.containers[0].livenessProbe - value: - exec: - command: - - env - initialDelaySeconds: 15 - failureThreshold: 10 - timeoutSeconds: 10 - periodSeconds: 15 diff --git a/.to_be_deleted/common-test/tests/container_in_deployment/resources_test.yaml b/.to_be_deleted/common-test/tests/container_in_deployment/resources_test.yaml deleted file mode 100644 index 9d8b3a0cbf..0000000000 --- a/.to_be_deleted/common-test/tests/container_in_deployment/resources_test.yaml +++ /dev/null @@ -1,735 +0,0 @@ -suite: container in deployment resources test -templates: - - common.yaml -tests: - - it: should pass with default values - documentIndex: &deploymentDoc 0 - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Deployment - - equal: - path: spec.template.spec.containers[0].resources - value: - limits: - cpu: 4000m - memory: 8Gi - requests: - cpu: 10m - memory: 50Mi - - - it: should fail with inherit defined in main container - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - resources: - inherit: - asserts: - - failedTemplate: - errorMessage: key is only available for additional/init/install/upgrade containers. - - - it: should fail with empty key in gpu - documentIndex: *deploymentDoc - set: - scaleGPU: - somekey: - controllers: - main: - pod: - containers: - main: - resources: - limits: - cpu: 3000m - memory: 4Gi - requests: - cpu: 20m - memory: 100Mi - asserts: - - failedTemplate: - errorMessage: Value is not provided for GPU ( somekey) - - - it: should fail with empty requests.cpu - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - resources: - limits: - cpu: 3000m - memory: 4Gi - requests: - cpu: - memory: 100Mi - asserts: - - failedTemplate: - errorMessage: cannot be empty. - - - it: should fail with empty requests.memory - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - resources: - limits: - cpu: 3000m - memory: 4Gi - requests: - cpu: 20m - memory: - asserts: - - failedTemplate: - errorMessage: cannot be empty. - - - it: should fail with invalid format in requests.memory (zero) - documentIndex: *deploymentDoc - set: - scaleGPU: - somekey: - controllers: - main: - pod: - containers: - main: - resources: - limits: - cpu: 3000m - memory: 4Gi - requests: - cpu: 20m - memory: 0.0 - asserts: - - failedTemplate: - errorMessage: has invalid format in value (0). Valid formats are (Suffixed with EPTGMK eg. 1G) (Suffixed with EPTGMK + i eg. 1Gi) (Plain integer (in bytes) eg. 1024) (Exponent eg. 134e6). - - - it: should fail with invalid format in requests.memory (zero exponent) - documentIndex: *deploymentDoc - set: - scaleGPU: - somekey: - controllers: - main: - pod: - containers: - main: - resources: - limits: - cpu: 3000m - memory: 4Gi - requests: - cpu: 20m - memory: 0e0 - asserts: - - failedTemplate: - errorMessage: has invalid format in value (0). Valid formats are (Suffixed with EPTGMK eg. 1G) (Suffixed with EPTGMK + i eg. 1Gi) (Plain integer (in bytes) eg. 1024) (Exponent eg. 134e6). - - - it: should fail with invalid format in requests.memory (zero with suffix) - documentIndex: *deploymentDoc - set: - scaleGPU: - somekey: - controllers: - main: - pod: - containers: - main: - resources: - limits: - cpu: 3000m - memory: 4Gi - requests: - cpu: 20m - memory: 0M - asserts: - - failedTemplate: - errorMessage: has invalid format in value (0M). Valid formats are (Suffixed with EPTGMK eg. 1G) (Suffixed with EPTGMK + i eg. 1Gi) (Plain integer (in bytes) eg. 1024) (Exponent eg. 134e6). - - - it: should fail with invalid format in requests.memory (string) - documentIndex: *deploymentDoc - set: - scaleGPU: - somekey: - controllers: - main: - pod: - containers: - main: - resources: - limits: - cpu: 3000m - memory: 4Gi - requests: - cpu: 20m - memory: not-valid - asserts: - - failedTemplate: - errorMessage: has invalid format in value (not-valid). Valid formats are (Suffixed with EPTGMK eg. 1G) (Suffixed with EPTGMK + i eg. 1Gi) (Plain integer (in bytes) eg. 1024) (Exponent eg. 134e6). - - - it: should fail with invalid format in limits.memory (zero) - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - resources: - limits: - cpu: 3000m - memory: 0.0 - requests: - cpu: 20m - memory: 100Mi - asserts: - - failedTemplate: - errorMessage: has invalid format in value (0). Valid formats are (Suffixed with EPTGMK eg. 1G) (Suffixed with EPTGMK + i eg. 1Gi) (Plain integer (in bytes) eg. 1024) (Exponent eg. 134e6). - - - it: should fail with invalid format in limits.memory (zero exponent) - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - resources: - limits: - cpu: 3000m - memory: 0e0 - requests: - cpu: 20m - memory: 100Mi - asserts: - - failedTemplate: - errorMessage: has invalid format in value (0). Valid formats are (Suffixed with EPTGMK eg. 1G) (Suffixed with EPTGMK + i eg. 1Gi) (Plain integer (in bytes) eg. 1024) (Exponent eg. 134e6). - - - it: should fail with invalid format in requests.limits (zero with suffix) - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - resources: - limits: - cpu: 3000m - memory: 0M - requests: - cpu: 20m - memory: 100Mi - asserts: - - failedTemplate: - errorMessage: has invalid format in value (0M). Valid formats are (Suffixed with EPTGMK eg. 1G) (Suffixed with EPTGMK + i eg. 1Gi) (Plain integer (in bytes) eg. 1024) (Exponent eg. 134e6). - - - it: should fail with invalid format in limits.memory (string) - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - resources: - limits: - cpu: 3000m - memory: not-valid - requests: - cpu: 20m - memory: 100Mi - asserts: - - failedTemplate: - errorMessage: has invalid format in value (not-valid). Valid formats are (Suffixed with EPTGMK eg. 1G) (Suffixed with EPTGMK + i eg. 1Gi) (Plain integer (in bytes) eg. 1024) (Exponent eg. 134e6). - - - it: should fail with invalid format in limits.cpu (zero) - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - resources: - limits: - cpu: 0.0 - memory: 4Gi - requests: - cpu: 20m - memory: 100Mi - asserts: - - failedTemplate: - errorMessage: has invalid format in value (0). Valid formats are (Plain Integer eg. 1) (Float eg. 0.5) (Milicpu 500m). - - - it: should fail with invalid format in limits.cpu (zero with suffix) - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - resources: - limits: - cpu: 0m - memory: 4Gi - requests: - cpu: 20m - memory: 100Mi - asserts: - - failedTemplate: - errorMessage: has invalid format in value (0m). Valid formats are (Plain Integer eg. 1) (Float eg. 0.5) (Milicpu 500m). - - - it: should fail with invalid format in limits.cpu (string) - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - resources: - limits: - cpu: not-valid - memory: 4Gi - requests: - cpu: 20m - memory: 100Mi - asserts: - - failedTemplate: - errorMessage: has invalid format in value (not-valid). Valid formats are (Plain Integer eg. 1) (Float eg. 0.5) (Milicpu 500m). - - - it: should fail with invalid format in requests.cpu (zero) - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - resources: - limits: - cpu: 4000m - memory: 4Gi - requests: - cpu: 0.0 - memory: 100Mi - asserts: - - failedTemplate: - errorMessage: has invalid format in value (0). Valid formats are (Plain Integer eg. 1) (Float eg. 0.5) (Milicpu 500m). - - - it: should fail with invalid format in requests.cpu (zero with suffix) - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - resources: - limits: - cpu: 4000m - memory: 4Gi - requests: - cpu: 0m - memory: 100Mi - asserts: - - failedTemplate: - errorMessage: has invalid format in value (0m). Valid formats are (Plain Integer eg. 1) (Float eg. 0.5) (Milicpu 500m). - - - it: should fail with invalid format in requests.cpu (string) - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - resources: - limits: - cpu: 4000m - memory: 4Gi - requests: - cpu: not-valid - memory: 100Mi - asserts: - - failedTemplate: - errorMessage: has invalid format in value (not-valid). Valid formats are (Plain Integer eg. 1) (Float eg. 0.5) (Milicpu 500m). - - - it: should pass with changed resources - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - resources: - limits: - cpu: 3000m - memory: 4Gi - requests: - cpu: 20m - memory: 100Mi - asserts: - - equal: - path: spec.template.spec.containers[0].resources - value: - limits: - cpu: 3000m - memory: 4Gi - requests: - cpu: 20m - memory: 100Mi - - - it: should pass with only limits.cpu resource changed - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - resources: - limits: - cpu: 3000m - asserts: - - equal: - path: spec.template.spec.containers[0].resources - value: - limits: - cpu: 3000m - memory: 8Gi - requests: - cpu: 10m - memory: 50Mi - - - it: should pass with only limits.memory resource changed - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - resources: - limits: - memory: 4Gi - asserts: - - equal: - path: spec.template.spec.containers[0].resources - value: - limits: - cpu: 4000m - memory: 4Gi - requests: - cpu: 10m - memory: 50Mi - - - it: should pass with only requests.cpu resource changed - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - resources: - requests: - cpu: 20m - asserts: - - equal: - path: spec.template.spec.containers[0].resources - value: - limits: - cpu: 4000m - memory: 8Gi - requests: - cpu: 20m - memory: 50Mi - - - it: should pass with only requests.memory resource changed - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - resources: - requests: - memory: 25Mi - asserts: - - equal: - path: spec.template.spec.containers[0].resources - value: - limits: - cpu: 4000m - memory: 8Gi - requests: - cpu: 10m - memory: 25Mi - - - it: should pass with only scaleGOU resource changed - documentIndex: *deploymentDoc - set: - scaleGPU: - gpu.intel.com/i915: "1" - asserts: - - equal: - path: spec.template.spec.containers[0].resources - value: - limits: - cpu: 4000m - memory: 8Gi - gpu.intel.com/i915: "1" - requests: - cpu: 10m - memory: 50Mi - - - it: should pass with changed resources and added GPU - documentIndex: *deploymentDoc - set: - scaleGPU: - gpu.intel.com/i915: "1" - controllers: - main: - pod: - containers: - main: - resources: - limits: - cpu: 3000m - memory: 4Gi - requests: - cpu: 20m - memory: 100Mi - asserts: - - equal: - path: spec.template.spec.containers[0].resources - value: - limits: - cpu: 3000m - memory: 4Gi - gpu.intel.com/i915: "1" - requests: - cpu: 20m - memory: 100Mi - - - it: should pass with empty resources.limits - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - resources: - limits: - cpu: - memory: - asserts: - - equal: - path: spec.template.spec.containers[0].resources - value: - requests: - cpu: 10m - memory: 50Mi - - - it: should pass with only limits.cpu defined - documentIndex: *deploymentDoc - set: - scaleGPU: {} - controllers: - main: - pod: - containers: - main: - resources: - limits: - cpu: 3000m - memory: - asserts: - - equal: - path: spec.template.spec.containers[0].resources - value: - limits: - cpu: 3000m - requests: - cpu: 10m - memory: 50Mi - - - it: should pass with only limits.memory defined - documentIndex: *deploymentDoc - set: - scaleGPU: {} - controllers: - main: - pod: - containers: - main: - resources: - limits: - cpu: - memory: 4Gi - asserts: - - equal: - path: spec.template.spec.containers[0].resources - value: - limits: - memory: 4Gi - requests: - cpu: 10m - memory: 50Mi - - - it: should pass with only requests.cpu defined - documentIndex: *deploymentDoc - set: - scaleGPU: {} - controllers: - main: - pod: - containers: - main: - resources: - limits: - cpu: - memory: - requests: - cpu: 30m - asserts: - - equal: - path: spec.template.spec.containers[0].resources - value: - requests: - cpu: 30m - memory: 50Mi - - - it: should pass with only requests.memory defined - documentIndex: *deploymentDoc - set: - scaleGPU: {} - controllers: - main: - pod: - containers: - main: - resources: - limits: - cpu: - memory: - requests: - memory: 15Mi - asserts: - - equal: - path: spec.template.spec.containers[0].resources - value: - requests: - cpu: 10m - memory: 15Mi - - - it: should pass with only limits.gpu defined - documentIndex: *deploymentDoc - set: - scaleGPU: - gpu.intel.com/i915: "1" - controllers: - main: - pod: - containers: - main: - resources: - limits: - cpu: - memory: - asserts: - - equal: - path: spec.template.spec.containers[0].resources - value: - limits: - gpu.intel.com/i915: "1" - requests: - cpu: 10m - memory: 50Mi - - - it: should pass with only requests defined - documentIndex: *deploymentDoc - set: - scaleGPU: {} - controllers: - main: - pod: - containers: - main: - resources: - limits: - cpu: - memory: - requests: - cpu: 10m - memory: 50Mi - asserts: - - equal: - path: spec.template.spec.containers[0].resources - value: - requests: - cpu: 10m - memory: 50Mi - - - it: should pass with only limits defined - documentIndex: *deploymentDoc - set: - scaleGPU: {} - controllers: - main: - pod: - containers: - main: - resources: - limits: - cpu: 1000m - memory: 1Gi - asserts: - - equal: - path: spec.template.spec.containers[0].resources - value: - limits: - cpu: 1000m - memory: 1Gi - requests: - cpu: 10m - memory: 50Mi - - - it: should pass with only gpu defined - documentIndex: *deploymentDoc - set: - scaleGPU: - gpu.intel.com/i915: "1" - controllers: - main: - pod: - containers: - main: - resources: - limits: - cpu: - memory: - asserts: - - equal: - path: spec.template.spec.containers[0].resources - value: - limits: - gpu.intel.com/i915: "1" - requests: - cpu: 10m - memory: 50Mi diff --git a/.to_be_deleted/common-test/tests/container_in_deployment/securityContext_test.yaml b/.to_be_deleted/common-test/tests/container_in_deployment/securityContext_test.yaml deleted file mode 100644 index 20ae3482ec..0000000000 --- a/.to_be_deleted/common-test/tests/container_in_deployment/securityContext_test.yaml +++ /dev/null @@ -1,490 +0,0 @@ -suite: container in deployment securityContext test -templates: - - common.yaml -tests: - - it: should pass with default values - documentIndex: &deploymentDoc 0 - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Deployment - - equal: - path: spec.template.spec.containers[0].securityContext - value: - allowPrivilegeEscalation: false - privileged: false - readOnlyRootFilesystem: true - runAsNonRoot: true - runAsUser: 568 - runAsGroup: 568 - capabilities: - add: [] - drop: - - ALL - - - it: should pass with securityContext changed - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - securityContext: - runAsNonRoot: false - runAsUser: 0 - runAsGroup: 0 - readOnlyRootFilesystem: false - allowPrivilegeEscalation: true - privileged: true - capabilities: - add: - - SYS_MODULE - drop: - - NET_ADMIN - asserts: - - equal: - path: spec.template.spec.containers[0].securityContext - value: - allowPrivilegeEscalation: true - privileged: true - readOnlyRootFilesystem: false - runAsNonRoot: false - runAsUser: 0 - runAsGroup: 0 - capabilities: - add: - - SYS_MODULE - drop: - - NET_ADMIN - - - it: should pass with securityContext changed from tpl - documentIndex: *deploymentDoc - set: - source: - addCap: SYS_MODULE - remCap: NET_ADMIN - controllers: - main: - pod: - containers: - main: - securityContext: - capabilities: - add: - - "{{ .Values.source.addCap }}" - drop: - - "{{ .Values.source.remCap }}" - asserts: - - equal: - path: spec.template.spec.containers[0].securityContext - value: - allowPrivilegeEscalation: false - capabilities: - add: - - SYS_MODULE - drop: - - NET_ADMIN - privileged: false - readOnlyRootFilesystem: true - runAsNonRoot: true - runAsUser: 568 - runAsGroup: 568 - - - it: should fail with inherit key added in securityContext on main container - set: - controllers: - main: - pod: - containers: - main: - securityContext: - inherit: true - asserts: - - failedTemplate: - errorMessage: key is only available for additional/init/install/upgrade containers. - - - it: should fail with securityContext changed, runAsNonRoot true and runAsUser 0 - set: - controllers: - main: - pod: - containers: - main: - securityContext: - runAsNonRoot: true - runAsUser: 0 - asserts: - - failedTemplate: - errorMessage: You are trying to run as root (user or group), but runAsNonRoot is set to true - - - it: should fail with securityContext changed, runAsNonRoot true and runAsGroup 0 - set: - controllers: - main: - pod: - containers: - main: - securityContext: - runAsNonRoot: true - runAsUser: 0 - asserts: - - failedTemplate: - errorMessage: You are trying to run as root (user or group), but runAsNonRoot is set to true - - - it: should fail with securityContext changed and runAsNonRoot set to a non-bool value - set: - controllers: - main: - pod: - containers: - main: - securityContext: - runAsNonRoot: non-bool - asserts: - - failedTemplate: - errorMessage: key has value (non-bool). But it must be boolean. - - - it: should fail with securityContext changed and privileged set to a non-bool value - set: - controllers: - main: - pod: - containers: - main: - securityContext: - privileged: non-bool - asserts: - - failedTemplate: - errorMessage: key has value (non-bool). But it must be boolean. - - - it: should fail with securityContext changed and readOnlyRootFilesystem set to a non-bool value - set: - controllers: - main: - pod: - containers: - main: - securityContext: - readOnlyRootFilesystem: non-bool - asserts: - - failedTemplate: - errorMessage: key has value (non-bool). But it must be boolean. - - - it: should fail with securityContext changed and allowPrivilegeEscalation set to a non-bool value - set: - controllers: - main: - pod: - containers: - main: - securityContext: - allowPrivilegeEscalation: non-bool - asserts: - - failedTemplate: - errorMessage: key has value (non-bool). But it must be boolean. - - - it: should fail with securityContext changed and capabilities.add is not a list - set: - controllers: - main: - pod: - containers: - main: - securityContext: - capabilities: - add: non-a-list - asserts: - - failedTemplate: - errorMessage: key has value (non-a-list). But it must be a list. Set a list value or remove the key for the default ([]) to take effect. - - - it: should fail with securityContext changed and capabilities.drop is not a list - set: - controllers: - main: - pod: - containers: - main: - securityContext: - capabilities: - drop: non-a-list - asserts: - - failedTemplate: - errorMessage: key has value (non-a-list). But it must be a list. Set a list value or remove the key for the default ([ALL]) to take effect. - - - it: should fail with empty capabilities.drop in securityContext - set: - controllers: - main: - pod: - containers: - main: - securityContext: - capabilities: - drop: - asserts: - - failedTemplate: - errorMessage: key has value (). But it must be a list. Set a list value or remove the key for the default ([ALL]) to take effect. - - - it: should fail with empty capabilities.add in securityContext - set: - controllers: - main: - pod: - containers: - main: - securityContext: - capabilities: - add: - asserts: - - failedTemplate: - errorMessage: key has value (). But it must be a list. Set a list value or remove the key for the default ([]) to take effect. - - - it: should fail with empty runAsGroup in securityContext - set: - controllers: - main: - pod: - containers: - main: - securityContext: - runAsGroup: - asserts: - - failedTemplate: - errorMessage: key cannot be empty. Set a value or remove the key for the default (568) to take effect. - - - it: should fail with non int runAsGroup in securityContext - set: - controllers: - main: - pod: - containers: - main: - securityContext: - runAsGroup: "1000" - asserts: - - failedTemplate: - errorMessage: key has value of ("1000"). But must be an int. - - - it: should fail with non int runAsUser in securityContext - set: - controllers: - main: - pod: - containers: - main: - securityContext: - runAsUser: "1000" - asserts: - - failedTemplate: - errorMessage: key has value of ("1000"). But must be an int. - - - it: should fail with empty runAsUser in securityContext - set: - controllers: - main: - pod: - containers: - main: - securityContext: - runAsUser: - asserts: - - failedTemplate: - errorMessage: key cannot be empty. Set a value or remove the key for the default (568) to take effect. - - - it: should fail with empty privileged in securityContext - set: - controllers: - main: - pod: - containers: - main: - securityContext: - privileged: - asserts: - - failedTemplate: - errorMessage: key has value (). But it must be boolean. - - - it: should fail with empty allowPrivilegeEscalation in securityContext - set: - controllers: - main: - pod: - containers: - main: - securityContext: - allowPrivilegeEscalation: - asserts: - - failedTemplate: - errorMessage: key has value (). But it must be boolean. - - - it: should fail with empty readOnlyRootFilesystem in securityContext - set: - controllers: - main: - pod: - containers: - main: - securityContext: - readOnlyRootFilesystem: - asserts: - - failedTemplate: - errorMessage: key has value (). But it must be boolean. - - - it: should fail with empty runAsNonRoot in securityContext - set: - controllers: - main: - pod: - containers: - main: - securityContext: - runAsNonRoot: - asserts: - - failedTemplate: - errorMessage: key has value (). But it must be boolean. - - - it: should pass with deviceList defined - documentIndex: *deploymentDoc - set: - deviceList: - - enabled: true - hostPath: /dev/usb - mountPath: /host/dev/usb - asserts: - - equal: - path: spec.template.spec.securityContext - value: - fsGroup: 568 - fsGroupChangePolicy: OnRootMismatch - supplementalGroups: - - 5 - - 10 - - 20 - - 24 - - equal: - path: spec.template.spec.containers[0].securityContext - value: - allowPrivilegeEscalation: true - privileged: true - readOnlyRootFilesystem: true - runAsNonRoot: true - runAsUser: 568 - runAsGroup: 568 - capabilities: - add: [] - drop: - - ALL - - - it: should pass with scaleGPU defined - documentIndex: *deploymentDoc - set: - scaleGPU: - nvidia: something - asserts: - - equal: - path: spec.template.spec.securityContext - value: - fsGroup: 568 - fsGroupChangePolicy: OnRootMismatch - supplementalGroups: - - 44 - - equal: - path: spec.template.spec.containers[0].securityContext - value: - allowPrivilegeEscalation: false - privileged: false - readOnlyRootFilesystem: true - runAsNonRoot: true - runAsUser: 568 - runAsGroup: 568 - capabilities: - add: [] - drop: - - ALL - - - it: should pass with both scaleGPU and deviceList defined - documentIndex: *deploymentDoc - set: - deviceList: - - enabled: true - hostPath: /dev/usb - mountPath: /host/dev/usb - scaleGPU: - nvidia: something - asserts: - - equal: - path: spec.template.spec.securityContext - value: - fsGroup: 568 - fsGroupChangePolicy: OnRootMismatch - supplementalGroups: - - 5 - - 10 - - 20 - - 24 - - 44 - - equal: - path: spec.template.spec.containers[0].securityContext - value: - allowPrivilegeEscalation: true - privileged: true - readOnlyRootFilesystem: true - runAsNonRoot: true - runAsUser: 568 - runAsGroup: 568 - capabilities: - add: [] - drop: - - ALL - - - it: should pass with container port <=1024 defined - documentIndex: *deploymentDoc - set: - service: - main: - ports: - main: - port: 5000 - targetPort: 1024 - asserts: - - equal: - path: spec.template.spec.containers[0].securityContext - value: - allowPrivilegeEscalation: false - privileged: false - readOnlyRootFilesystem: true - runAsNonRoot: true - runAsUser: 568 - runAsGroup: 568 - capabilities: - add: - - NET_BIND_SERVICE - drop: - - ALL - - - it: should pass with container port <=1024 defined - documentIndex: *deploymentDoc - set: - service: - main: - ports: - main: - port: 5000 - targetPort: 80 - asserts: - - equal: - path: spec.template.spec.containers[0].securityContext - value: - allowPrivilegeEscalation: false - privileged: false - readOnlyRootFilesystem: true - runAsNonRoot: true - runAsUser: 568 - runAsGroup: 568 - capabilities: - add: - - NET_BIND_SERVICE - drop: - - ALL diff --git a/.to_be_deleted/common-test/tests/container_in_deployment/various_options_test.yaml b/.to_be_deleted/common-test/tests/container_in_deployment/various_options_test.yaml deleted file mode 100644 index 31af5696fe..0000000000 --- a/.to_be_deleted/common-test/tests/container_in_deployment/various_options_test.yaml +++ /dev/null @@ -1,116 +0,0 @@ - -suite: container in deployment various options test -templates: - - common.yaml -tests: - - it: should pass with default values - documentIndex: &deploymentDoc 0 - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Deployment - - - it: should pass with tty set - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - tty: true - asserts: - - equal: - path: spec.template.spec.containers[0].tty - value: true - - - it: should pass with stdin set - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - stdin: true - asserts: - - equal: - path: spec.template.spec.containers[0].stdin - value: true - - - it: should pass with terminationMessagePath set - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - termination: - messagePath: /tmp/log - asserts: - - equal: - path: spec.template.spec.containers[0].terminationMessagePath - value: /tmp/log - - - it: should pass with terminationMessagePath set from tpl - documentIndex: *deploymentDoc - set: - some_path: /tmp/log - controllers: - main: - pod: - containers: - main: - termination: - messagePath: "{{ .Values.some_path }}" - asserts: - - equal: - path: spec.template.spec.containers[0].terminationMessagePath - value: /tmp/log - - - it: should pass with terminationMessagePolicy set - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - containers: - main: - termination: - messagePolicy: FallbackToLogsOnError - asserts: - - equal: - path: spec.template.spec.containers[0].terminationMessagePolicy - value: FallbackToLogsOnError - - - it: should pass with terminationMessagePolicy set from tpl - documentIndex: *deploymentDoc - set: - some_key: FallbackToLogsOnError - controllers: - main: - pod: - containers: - main: - termination: - messagePolicy: "{{ .Values.some_key }}" - asserts: - - equal: - path: spec.template.spec.containers[0].terminationMessagePolicy - value: FallbackToLogsOnError - - - it: should fail with invalid terminationMessagePolicy - set: - some_key: invalid - controllers: - main: - pod: - containers: - main: - termination: - messagePolicy: "{{ .Values.some_key }}" - asserts: - - failedTemplate: - errorMessage: Not valid option for messagePolicy (invalid). Valid options are FallbackToLogsOnError and File diff --git a/.to_be_deleted/common-test/tests/container_in_deployment/volumeMounts_test.yaml b/.to_be_deleted/common-test/tests/container_in_deployment/volumeMounts_test.yaml deleted file mode 100644 index 4d1d486de1..0000000000 --- a/.to_be_deleted/common-test/tests/container_in_deployment/volumeMounts_test.yaml +++ /dev/null @@ -1,263 +0,0 @@ -suite: container in deployment volumeMount test -templates: - - common.yaml -tests: - - it: should pass with default values - documentIndex: &deploymentDoc 0 - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Deployment - - equal: - path: spec.template.spec.containers[0].volumeMounts - value: - - mountPath: /shared - name: shared - - mountPath: /tmp - name: tmp - - mountPath: /var/logs - name: varlogs - - - it: should fail with no mountPath set - set: - persistence: - vol1: - enabled: true - asserts: - - failedTemplate: - errorMessage: must be defined, alternatively use the flag. - - - it: should fail when mountPath does not start with / - set: - persistence: - vol1: - enabled: true - mountPath: relative/path/to/dir - asserts: - - failedTemplate: - errorMessage: Mount path (relative/path/to/dir), must start with a forward slash -> / <- - - - it: should fail with empty readOnly - set: - persistence: - vol1: - enabled: true - mountPath: /some/path - readOnly: - asserts: - - failedTemplate: - errorMessage: cannot be empty on item (vol1) - - - it: should fail with empty mountPath - set: - persistence: - vol1: - enabled: true - mountPath: - asserts: - - failedTemplate: - errorMessage: must be defined, alternatively use the flag. - - - it: should pass with enabled false - documentIndex: *deploymentDoc - set: - persistence: - vol1: - enabled: false - asserts: - - notContains: - path: spec.template.spec.containers[0].volumeMounts - content: - name: vol1 - - - it: should pass with noMount true - documentIndex: *deploymentDoc - set: - persistence: - vol1: - noMount: true - asserts: - - notContains: - path: spec.template.spec.containers[0].volumeMounts - content: - name: vol1 - - - it: should pass with mountPath set - documentIndex: *deploymentDoc - set: - persistence: - vol1: - enabled: true - mountPath: /some_path - asserts: - - contains: - path: spec.template.spec.containers[0].volumeMounts - content: - mountPath: /some_path - name: vol1 - - - it: should pass with mountPath set (multiple entries) - documentIndex: *deploymentDoc - set: - persistence: - vol1: - enabled: true - mountPath: /some_path - vol2: - enabled: true - mountPath: /some_path2 - asserts: - - contains: - path: spec.template.spec.containers[0].volumeMounts - content: - mountPath: /some_path - name: vol1 - - contains: - path: spec.template.spec.containers[0].volumeMounts - content: - mountPath: /some_path2 - name: vol2 - - - it: should pass with mountPath and readOnly(true) set - documentIndex: *deploymentDoc - set: - persistence: - vol1: - enabled: true - mountPath: /some_path - readOnly: true - asserts: - - contains: - path: spec.template.spec.containers[0].volumeMounts - content: - mountPath: /some_path - name: vol1 - readOnly: true - - - it: should pass with mountPath and readOnly(false) set - documentIndex: *deploymentDoc - set: - persistence: - vol1: - enabled: true - mountPath: /some_path - readOnly: false - asserts: - - contains: - path: spec.template.spec.containers[0].volumeMounts - content: - mountPath: /some_path - name: vol1 - readOnly: false - - - it: should pass with mountPath and subPath set - documentIndex: *deploymentDoc - set: - persistence: - vol1: - enabled: true - mountPath: /some_path - subPath: config.yaml - asserts: - - contains: - path: spec.template.spec.containers[0].volumeMounts - content: - mountPath: /some_path - name: vol1 - subPath: config.yaml - - - it: should pass with mountPath and mountPropagation set - documentIndex: *deploymentDoc - set: - persistence: - vol1: - enabled: true - mountPath: /some_path - mountPropagation: HostToContainer - asserts: - - contains: - path: spec.template.spec.containers[0].volumeMounts - content: - mountPath: /some_path - name: vol1 - mountPropagation: HostToContainer - - - it: should pass with all set set - documentIndex: *deploymentDoc - set: - persistence: - vol1: - enabled: true - mountPath: /some_path - mountPropagation: HostToContainer - asserts: - - contains: - path: spec.template.spec.containers[0].volumeMounts - content: - mountPath: /some_path - name: vol1 - mountPropagation: HostToContainer - - - it: should pass with all set (readonly false) - documentIndex: *deploymentDoc - set: - persistence: - vol1: - enabled: true - mountPath: /some_path - subPath: config.yaml - readOnly: false - mountPropagation: HostToContainer - asserts: - - contains: - path: spec.template.spec.containers[0].volumeMounts - content: - mountPath: /some_path - name: vol1 - subPath: config.yaml - readOnly: false - mountPropagation: HostToContainer - - - it: should pass with all set (readonly true) - documentIndex: *deploymentDoc - set: - persistence: - vol1: - enabled: true - mountPath: /some_path - subPath: config.yaml - readOnly: true - mountPropagation: HostToContainer - asserts: - - contains: - path: spec.template.spec.containers[0].volumeMounts - content: - mountPath: /some_path - name: vol1 - subPath: config.yaml - readOnly: true - mountPropagation: HostToContainer - - - it: should pass with all set (readonly true) from tpl - documentIndex: *deploymentDoc - set: - some_mount: /some_path - sub_path: config.yaml - mount_propagation: HostToContainer - persistence: - vol1: - enabled: true - mountPath: "{{ .Values.some_mount }}" - subPath: "{{ .Values.sub_path }}" - readOnly: true - mountPropagation: "{{ .Values.mount_propagation }}" - asserts: - - contains: - path: spec.template.spec.containers[0].volumeMounts - content: - mountPath: /some_path - name: vol1 - subPath: config.yaml - readOnly: true - mountPropagation: HostToContainer diff --git a/.to_be_deleted/common-test/tests/cronjob_standalone/annotations_test.yaml b/.to_be_deleted/common-test/tests/cronjob_standalone/annotations_test.yaml deleted file mode 100644 index 284d6d3519..0000000000 --- a/.to_be_deleted/common-test/tests/cronjob_standalone/annotations_test.yaml +++ /dev/null @@ -1,63 +0,0 @@ -suite: cronjob annotation test -templates: - - common.yaml -tests: - - it: should pass with default values - documentIndex: &cronJobDoc 2 - set: - controllers: - main: - type: CronJob - schedule: "*/1 * * * *" - asserts: - - hasDocuments: - count: 3 - - isKind: - of: CronJob - - isNull: - path: metadata.annotations - - - it: should pass with controller and global annotations - documentIndex: *cronJobDoc - set: - some_key: some_value - controllers: - main: - type: CronJob - schedule: "*/1 * * * *" - annotations: - controller_key: controller_value - controller_key2: "{{ .Values.some_key }}" - global: - annotations: - global_key: global_value - global_key2: "{{ .Values.some_key }}" - asserts: - - isSubset: - path: metadata.annotations - content: - controller_key: controller_value - controller_key2: some_value - global_key: global_value - global_key2: some_value - - isNull: - path: metadata.annotations.rollme - - - it: should pass with podAnnotations set - documentIndex: *cronJobDoc - set: - some_key: some_value2 - controllers: - main: - type: CronJob - schedule: "*/1 * * * *" - pod: - annotations: - test: some_value - test2: "{{ .Values.some_key }}" - asserts: - - isSubset: - path: metadata.annotations - content: - test2: some_value2 - test: some_value diff --git a/.to_be_deleted/common-test/tests/cronjob_standalone/controller_test.yaml b/.to_be_deleted/common-test/tests/cronjob_standalone/controller_test.yaml deleted file mode 100644 index 7575978b99..0000000000 --- a/.to_be_deleted/common-test/tests/cronjob_standalone/controller_test.yaml +++ /dev/null @@ -1,54 +0,0 @@ -suite: cronjob controller test -templates: - - common.yaml -tests: - - it: should pass with strategy changed in cronjob - documentIndex: &cronJobDoc 2 - set: - controllers: - main: - type: CronJob - schedule: "* * * * *" - asserts: - - hasDocuments: - count: 3 - - isKind: - of: CronJob - - - it: should pass with job options changed in cronJob - documentIndex: *cronJobDoc - set: - controllers: - main: - type: CronJob - backoffLimit: 11 - ttlSecondsAfterFinished: 22 - activeDeadlineSeconds: 33 - parallelism: 44 - completions: 55 - completionMode: Indexed - schedule: "* * * * *" - concurrencyPolicy: Allow - failedJobsHistoryLimit: 7 - successfulJobsHistoryLimit: 11 - timezone: "America/New_York" - startingDeadlineSeconds: 13 - asserts: - - isSubset: - path: spec - content: - schedule: "* * * * *" - timeZone: "America/New_York" - concurrencyPolicy: Allow - failedJobsHistoryLimit: 7 - successfulJobsHistoryLimit: 11 - startingDeadlineSeconds: 13 - - isSubset: - path: spec.jobTemplate.spec - content: - backoffLimit: 11 - ttlSecondsAfterFinished: 22 - activeDeadlineSeconds: 33 - parallelism: 44 - completions: 55 - completionMode: Indexed diff --git a/.to_be_deleted/common-test/tests/cronjob_standalone/default_test.yaml b/.to_be_deleted/common-test/tests/cronjob_standalone/default_test.yaml deleted file mode 100644 index 6846744362..0000000000 --- a/.to_be_deleted/common-test/tests/cronjob_standalone/default_test.yaml +++ /dev/null @@ -1,155 +0,0 @@ -suite: cronjob default test -templates: - - common.yaml -tests: - - it: should pass with controller set to CronJob - documentIndex: &cronjobDoc 2 - set: - controllers: - main: - type: CronJob - schedule: "*/5 * * * *" - asserts: - - hasDocuments: - count: 3 - - isKind: - of: CronJob - - isAPIVersion: - of: batch/v1 - - equal: - path: spec.schedule - value: "*/5 * * * *" - - equal: - path: spec.timeZone - value: UTC - - equal: - path: spec.concurrencyPolicy - value: Forbid - - equal: - path: spec.failedJobsHistoryLimit - value: 1 - - equal: - path: spec.successfulJobsHistoryLimit - value: 3 - - isNull: - path: spec.startingDeadlineSeconds - - equal: - path: spec.jobTemplate.spec.backoffLimit - value: 6 - - isNull: - path: spec.jobTemplate.spec.ttlSecondsAfterFinished - - isNull: - path: spec.jobTemplate.spec.activeDeadlineSeconds - - isNull: - path: spec.jobTemplate.spec.parallelism - - isNull: - path: spec.jobTemplate.spec.completions - - equal: - path: spec.jobTemplate.spec.completionMode - value: NonIndexed - - equal: - path: spec.jobTemplate.spec.template.spec.hostNetwork - value: false - - equal: - path: spec.jobTemplate.spec.template.spec.enableServiceLinks - value: false - - isNull: - path: spec.jobTemplate.spec.template.spec.serviceAccountName - - equal: - path: spec.jobTemplate.spec.template.spec.restartPolicy - value: Never - - isNull: - path: spec.jobTemplate.spec.template.spec.schedulerName - - isNull: - path: spec.jobTemplate.spec.template.spec.priorityClassName - - isNull: - path: spec.jobTemplate.spec.template.spec.hostname - - equal: - path: spec.jobTemplate.spec.template.spec.dnsPolicy - value: ClusterFirst - - isNull: - path: spec.jobTemplate.spec.template.spec.dnsConfig - - isNull: - path: spec.jobTemplate.spec.template.spec.hostAliases - - isNull: - path: spec.jobTemplate.spec.template.spec.nodeSelector - - isNull: - path: spec.jobTemplate.spec.template.spec.tolerations - - isNull: - path: spec.jobTemplate.spec.template.spec.imagePullSecrets - - isNull: - path: spec.jobTemplate.spec.template.spec.runtimeClassName - - isNull: - path: spec.jobTemplate.spec.template.spec.terminationGracePeriodSeconds - - equal: - path: spec.jobTemplate.spec.template.spec.containers[0].name - value: RELEASE-NAME-common-test-job-main - - equal: - path: spec.jobTemplate.spec.template.spec.containers[0].image - value: repo:tag - - isNull: - path: spec.jobTemplate.spec.template.spec.containers[0].command - - isNull: - path: spec.jobTemplate.spec.template.spec.containers[0].args - - equal: - path: spec.jobTemplate.spec.template.spec.containers[0].tty - value: false - - equal: - path: spec.jobTemplate.spec.template.spec.containers[0].stdin - value: false - - isNull: - path: spec.jobTemplate.spec.template.spec.containers[0].lifecycle - - isNull: - path: spec.jobTemplate.spec.template.spec.containers[0].terminationMessagePath - - isNull: - path: spec.jobTemplate.spec.template.spec.containers[0].terminationMessagePolicy - - equal: - path: spec.jobTemplate.spec.template.spec.securityContext - value: - fsGroup: 568 - fsGroupChangePolicy: OnRootMismatch - supplementalGroups: [] - - equal: - path: spec.jobTemplate.spec.template.spec.containers[0].securityContext - value: - allowPrivilegeEscalation: false - privileged: false - readOnlyRootFilesystem: true - runAsNonRoot: true - runAsUser: 568 - runAsGroup: 568 - capabilities: - add: [] - drop: - - ALL - - equal: - path: spec.jobTemplate.spec.template.spec.containers[0].env - value: - - name: TZ - value: UTC - - name: UMASK - value: "002" - - name: UMASK_SET - value: "002" - - name: NVIDIA_VISIBLE_DEVICES - value: void - - name: S6_READ_ONLY_ROOT - value: "1" - - equal: - path: spec.jobTemplate.spec.template.spec.containers[0].volumeMounts - value: - - mountPath: /shared - name: shared - - mountPath: /tmp - name: tmp - - mountPath: /var/logs - name: varlogs - - equal: - path: spec.jobTemplate.spec.template.spec.volumes - value: - - name: shared - emptyDir: {} - - name: tmp - emptyDir: {} - - name: varlogs - emptyDir: {} diff --git a/.to_be_deleted/common-test/tests/cronjob_standalone/generic_test.yaml b/.to_be_deleted/common-test/tests/cronjob_standalone/generic_test.yaml deleted file mode 100644 index e1b49df3bf..0000000000 --- a/.to_be_deleted/common-test/tests/cronjob_standalone/generic_test.yaml +++ /dev/null @@ -1,301 +0,0 @@ -suite: cronjob generic test -templates: - - common.yaml -tests: - - it: should pass with controller set to CronJob - documentIndex: &cronjobDoc 2 - set: - controllers: - main: - type: CronJob - schedule: "*/5 * * * *" - asserts: - - hasDocuments: - count: 3 - - isKind: - of: CronJob - - isAPIVersion: - of: batch/v1 - - - it: should pass with podSecurityContext changed - documentIndex: *cronjobDoc - set: - controllers: - main: - type: CronJob - schedule: "* * * * *" - pod: - securityContext: - fsGroup: 0 - fsGroupChangePolicy: Always - supplementalGroups: - - 1000 - asserts: - - equal: - path: spec.jobTemplate.spec.template.spec.securityContext - value: - fsGroup: 0 - fsGroupChangePolicy: Always - supplementalGroups: - - 1000 - - - it: should pass with podSecurityContext changed from the default - documentIndex: *cronjobDoc - set: - controllers: - main: - type: CronJob - schedule: "* * * * *" - podSecurityContext: - fsGroup: 0 - fsGroupChangePolicy: Always - supplementalGroups: - - 1000 - asserts: - - equal: - path: spec.jobTemplate.spec.template.spec.securityContext - value: - fsGroup: 0 - fsGroupChangePolicy: Always - supplementalGroups: - - 1000 - - - it: should pass with securityContext changed - documentIndex: *cronjobDoc - set: - controllers: - main: - type: CronJob - schedule: "* * * * *" - pod: - containers: - main: - securityContext: - runAsUser: 1000 - runAsGroup: 1000 - capabilities: - add: - - something - asserts: - - equal: - path: spec.jobTemplate.spec.template.spec.containers[0].securityContext - value: - allowPrivilegeEscalation: false - privileged: false - readOnlyRootFilesystem: true - runAsNonRoot: true - runAsUser: 1000 - runAsGroup: 1000 - capabilities: - add: - - something - drop: - - ALL - - - it: should pass with securityContext changed from the default - documentIndex: *cronjobDoc - set: - controllers: - main: - type: CronJob - schedule: "* * * * *" - securityContext: - runAsUser: 1000 - runAsGroup: 1000 - capabilities: - add: - - something - asserts: - - equal: - path: spec.jobTemplate.spec.template.spec.containers[0].securityContext - value: - allowPrivilegeEscalation: false - privileged: false - readOnlyRootFilesystem: true - runAsNonRoot: true - runAsUser: 1000 - runAsGroup: 1000 - capabilities: - add: - - something - drop: - - ALL - - - it: should pass with multiple envs defined via tpl - documentIndex: *cronjobDoc - set: - controllers: - main: - type: CronJob - schedule: "* * * * *" - pod: - containers: - main: - env: - ENVVAR: "{{ .Values.some_string }}" - ENVVAR2: "{{ .Values.some_int }}" - ENVVAR3: "{{ .Values.some_bool }}" - some_string: a_string - some_int: 123 - some_bool: false - asserts: - - equal: - path: spec.jobTemplate.spec.template.spec.containers[0].env - value: - - name: TZ - value: "UTC" - - name: UMASK - value: "002" - - name: UMASK_SET - value: "002" - - name: NVIDIA_VISIBLE_DEVICES - value: "void" - - name: S6_READ_ONLY_ROOT - value: "1" - - name: ENVVAR - value: "a_string" - - name: ENVVAR2 - value: "123" - - name: ENVVAR3 - value: "false" - - - it: should pass with addNvidiaRuntimeClass and nvidiaRuntimeClassName set - documentIndex: *cronjobDoc - set: - controllers: - main: - type: CronJob - schedule: "* * * * *" - scaleGPU: - something: blabla - global: - ixChartContext: - addNvidiaRuntimeClass: true - nvidiaRuntimeClassName: something - asserts: - - equal: - path: spec.jobTemplate.spec.template.spec.runtimeClassName - value: something - - - it: should pass with deviceList set - documentIndex: *cronjobDoc - set: - controllers: - main: - type: CronJob - schedule: "* * * * *" - deviceList: - - enabled: true - hostPath: /dev/usb - mountPath: /host/dev/usb - asserts: - - equal: - path: spec.jobTemplate.spec.template.spec.securityContext - value: - fsGroup: 568 - fsGroupChangePolicy: OnRootMismatch - supplementalGroups: - - 5 - - 10 - - 20 - - 24 - - - it: should pass with added persistence - documentIndex: &cronjobDoc 3 - set: - controllers: - main: - type: CronJob - schedule: "* * * * *" - persistence: - volume0: - type: pvc - enabled: true - mountPath: /pvc/path - volume1: - enabled: true - type: nfs - server: some.server.local - path: /nfs/path - mountPath: /nfs - volume2: - enabled: true - type: ixVolume - datasetName: ix-app - mountPath: /ixVol - volume3: - enabled: true - type: hostPath - hostPath: /mnt/pool/test - mountPath: /some/path - volume4: - enabled: true - type: emptyDir - medium: Memory - sizeLimit: 1Gi - mountPath: /temp-path - volume5: - type: secret - enabled: true - objectName: some_object_name - defaultMode: "0777" - mountPath: /secret-path - volume6: - type: configMap - enabled: true - objectName: some_object_name - defaultMode: "0777" - mountPath: /configmap-path - ixVolumes: - - /mnt/pool/ix-applications/ix-app - asserts: - - isKind: - of: CronJob - - hasDocuments: - count: 4 - - contains: - path: spec.jobTemplate.spec.template.spec.volumes - content: - name: volume0 - persistentVolumeClaim: - claimName: RELEASE-NAME-common-test-volume0 - - contains: - path: spec.jobTemplate.spec.template.spec.volumes - content: - name: volume1 - nfs: - path: /nfs/path - server: some.server.local - - contains: - path: spec.jobTemplate.spec.template.spec.volumes - content: - name: volume2 - hostPath: - path: /mnt/pool/ix-applications/ix-app - - contains: - path: spec.jobTemplate.spec.template.spec.volumes - content: - name: volume3 - hostPath: - path: /mnt/pool/test - - contains: - path: spec.jobTemplate.spec.template.spec.volumes - content: - name: volume4 - emptyDir: - medium: Memory - sizeLimit: 1Gi - - contains: - path: spec.jobTemplate.spec.template.spec.volumes - content: - name: volume5 - secret: - defaultMode: 511 - secretName: some_object_name - - contains: - path: spec.jobTemplate.spec.template.spec.volumes - content: - name: volume6 - configMap: - defaultMode: 511 - name: some_object_name diff --git a/.to_be_deleted/common-test/tests/cronjob_standalone/label_test.yaml b/.to_be_deleted/common-test/tests/cronjob_standalone/label_test.yaml deleted file mode 100644 index 9d8997d92a..0000000000 --- a/.to_be_deleted/common-test/tests/cronjob_standalone/label_test.yaml +++ /dev/null @@ -1,77 +0,0 @@ -suite: cronjob label test -templates: - - common.yaml -chart: - appVersion: &appVer v1.2.3 -tests: - - it: should pass with default values - documentIndex: &cronJobDoc 2 - set: - controller: - type: CronJob - schedule: "*/5 * * * *" - asserts: - - hasDocuments: - count: 3 - - isKind: - of: CronJob - - equal: - path: metadata.labels - value: - app: common-test - app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: common-test - app.kubernetes.io/version: *appVer - helm-revision: "0" - helm.sh/chart: common-test-1.0.0 - release: RELEASE-NAME - - - it: should pass with controller and global labels - documentIndex: *cronJobDoc - set: - some_key: some_value - controller: - type: CronJob - schedule: "*/5 * * * *" - labels: - controller_key: controller_value - controller_key2: "{{ .Values.some_key }}" - global: - labels: - global_key: global_value - global_key2: "{{ .Values.some_key }}" - asserts: - - equal: - path: metadata.labels - value: - controller_key: controller_value - controller_key2: some_value - global_key: global_value - global_key2: some_value - app: common-test - app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: common-test - app.kubernetes.io/version: *appVer - helm-revision: "0" - helm.sh/chart: common-test-1.0.0 - release: RELEASE-NAME - - - it: should pass with podLabels set - documentIndex: *cronJobDoc - set: - controller: - type: CronJob - schedule: "*/5 * * * *" - some_key: some_value2 - podLabels: - test: some_value - test2: "{{ .Values.some_key }}" - asserts: - - equal: - path: metadata.labels.test2 - value: some_value2 - - equal: - path: metadata.labels.test - value: some_value diff --git a/.to_be_deleted/common-test/tests/cronjob_standalone/names_test.yaml b/.to_be_deleted/common-test/tests/cronjob_standalone/names_test.yaml deleted file mode 100644 index 8e04d0f387..0000000000 --- a/.to_be_deleted/common-test/tests/cronjob_standalone/names_test.yaml +++ /dev/null @@ -1,44 +0,0 @@ -suite: cronjob name test -templates: - - common.yaml -tests: - - it: should pass with default values - documentIndex: &cronjobDoc 2 - set: - controller: - type: CronJob - schedule: "* * * * *" - asserts: - - hasDocuments: - count: 3 - - isKind: - of: CronJob - - equal: - path: metadata.name - value: RELEASE-NAME-common-test - - - it: should pass with nameOverride - documentIndex: *cronjobDoc - set: - controller: - type: CronJob - schedule: "* * * * *" - nameOverride: overrodename - asserts: - - equal: - path: metadata.name - value: RELEASE-NAME-overrodename - - - it: should pass with global.nameOverride - documentIndex: *cronjobDoc - set: - controller: - type: CronJob - schedule: "* * * * *" - nameOverride: overrodename - global: - nameOverride: globaloverrodename - asserts: - - equal: - path: metadata.name - value: RELEASE-NAME-globaloverrodename diff --git a/.to_be_deleted/common-test/tests/daemonset/annotations_test.yaml b/.to_be_deleted/common-test/tests/daemonset/annotations_test.yaml deleted file mode 100644 index dfcb231298..0000000000 --- a/.to_be_deleted/common-test/tests/daemonset/annotations_test.yaml +++ /dev/null @@ -1,66 +0,0 @@ -suite: daemonset annotation test -templates: - - common.yaml -tests: - - it: should pass with default values - documentIndex: &daemonsetDoc 0 - set: - controllers: - main: - type: DaemonSet - asserts: - - hasDocuments: - count: 3 - - isKind: - of: DaemonSet - - isNull: - path: metadata.annotations - - matchRegex: - path: spec.template.metadata.annotations.rollme - pattern: "^[a-zA-Z0-9]{5}$" - - - it: should pass with controller and global annotations - documentIndex: *daemonsetDoc - set: - some_key: some_value - controllers: - main: - type: DaemonSet - annotations: - controller_key: controller_value - controller_key2: "{{ .Values.some_key }}" - global: - annotations: - global_key: global_value - global_key2: "{{ .Values.some_key }}" - asserts: - - equal: - path: metadata.annotations - value: - controller_key: controller_value - controller_key2: some_value - global_key: global_value - global_key2: some_value - - isNull: - path: metadata.annotations.rollme - - matchRegex: - path: spec.template.metadata.annotations.rollme - pattern: "^[a-zA-Z0-9]{5}$" - - - it: should pass with podAnnotations set - documentIndex: *daemonsetDoc - set: - some_key: some_value2 - controllers: - main: - type: DaemonSet - pod: - annotations: - test: some_value - test2: "{{ .Values.some_key }}" - asserts: - - isSubset: - path: spec.template.metadata.annotations - content: - test2: some_value2 - test: some_value diff --git a/.to_be_deleted/common-test/tests/daemonset/controller_test.yaml b/.to_be_deleted/common-test/tests/daemonset/controller_test.yaml deleted file mode 100644 index 05e49b57b3..0000000000 --- a/.to_be_deleted/common-test/tests/daemonset/controller_test.yaml +++ /dev/null @@ -1,67 +0,0 @@ -suite: daemonset strategy test -templates: - - common.yaml -tests: - - it: should pass with strategy changed in DaemonSet - documentIndex: &dameonsetDoc 0 - set: - controllers: - main: - type: DaemonSet - strategy: OnDelete - rollingUpdate: - surge: 5 - unavailable: 6 - asserts: - - hasDocuments: - count: 3 - - isKind: - of: DaemonSet - - equal: - path: spec.updateStrategy - value: - type: OnDelete - - isNull: - path: spec.updateStrategy.rollingUpdate - - - it: should pass with strategy changed in DaemonSet - documentIndex: *dameonsetDoc - set: - controllers: - main: - type: DaemonSet - strategy: RollingUpdate - rollingUpdate: - surge: 5 - unavailable: 6 - asserts: - - equal: - path: spec.updateStrategy - value: - type: RollingUpdate - rollingUpdate: - maxSurge: 5 - maxUnavailable: 6 - - - it: should fail with wrong strategy - documentIndex: *dameonsetDoc - set: - controllers: - main: - type: DaemonSet - strategy: not_valid_strategy - asserts: - - failedTemplate: - errorMessage: Not a valid strategy type for DaemonSet (not_valid_strategy) - - - it: should pass with revisionHistoryLimit changed - documentIndex: *dameonsetDoc - set: - controllers: - main: - type: DaemonSet - revisionHistoryLimit: 1 - asserts: - - equal: - path: spec.revisionHistoryLimit - value: 1 diff --git a/.to_be_deleted/common-test/tests/daemonset/default_test.yaml b/.to_be_deleted/common-test/tests/daemonset/default_test.yaml deleted file mode 100644 index e8638b18e5..0000000000 --- a/.to_be_deleted/common-test/tests/daemonset/default_test.yaml +++ /dev/null @@ -1,119 +0,0 @@ -suite: daemonset default test -templates: - - common.yaml -tests: - - it: should pass with controller set to DaemonSet - documentIndex: &daemonsetDoc 0 - set: - controllers: - main: - type: DaemonSet - asserts: - - hasDocuments: - count: 3 - - isKind: - of: DaemonSet - - isAPIVersion: - of: apps/v1 - - equal: - path: spec.revisionHistoryLimit - value: 3 - - equal: - path: spec.updateStrategy.type - value: RollingUpdate - - equal: - path: spec.template.spec.serviceAccountName - value: default - - equal: - path: spec.template.spec.hostNetwork - value: false - - equal: - path: spec.template.spec.enableServiceLinks - value: false - - equal: - path: spec.template.spec.terminationGracePeriodSeconds - value: 10 - - isNull: - path: spec.template.spec.hostname - - equal: - path: spec.template.spec.dnsPolicy - value: ClusterFirst - - isNull: - path: spec.template.spec.dnsConfig - - isNull: - path: spec.template.spec.priorityClassName - - isNull: - path: spec.template.spec.schedulerName - - isNull: - path: spec.template.spec.hostAliases - - isNull: - path: spec.template.spec.nodeSelector - - isNull: - path: spec.template.spec.tolerations - - isNull: - path: spec.template.spec.imagePullSecrets - - isNull: - path: spec.template.spec.runtimeClassName - - equal: - path: spec.template.spec.containers[0].name - value: RELEASE-NAME-common-test - - equal: - path: spec.template.spec.containers[0].image - value: repo:tag - - isNull: - path: spec.template.spec.containers[0].command - - isNull: - path: spec.template.spec.containers[0].args - - equal: - path: spec.template.spec.containers[0].tty - value: false - - equal: - path: spec.template.spec.containers[0].stdin - value: false - - isNull: - path: spec.template.spec.containers[0].lifecycle - - isNull: - path: spec.template.spec.containers[0].terminationMessagePath - - isNull: - path: spec.template.spec.containers[0].terminationMessagePolicy - - equal: - path: spec.template.spec.securityContext - value: - fsGroup: 568 - fsGroupChangePolicy: OnRootMismatch - supplementalGroups: [] - - equal: - path: spec.template.spec.containers[0].securityContext - value: - allowPrivilegeEscalation: false - privileged: false - readOnlyRootFilesystem: true - runAsNonRoot: true - runAsUser: 568 - runAsGroup: 568 - capabilities: - add: [] - drop: - - ALL - - equal: - path: spec.template.spec.containers[0].env - value: - - name: TZ - value: UTC - - name: UMASK - value: "002" - - name: UMASK_SET - value: "002" - - name: NVIDIA_VISIBLE_DEVICES - value: void - - name: S6_READ_ONLY_ROOT - value: "1" - - equal: - path: spec.template.spec.containers[0].volumeMounts - value: - - mountPath: /shared - name: shared - - mountPath: /tmp - name: tmp - - mountPath: /var/logs - name: varlogs diff --git a/.to_be_deleted/common-test/tests/daemonset/generic_test.yaml b/.to_be_deleted/common-test/tests/daemonset/generic_test.yaml deleted file mode 100644 index dbbcaef637..0000000000 --- a/.to_be_deleted/common-test/tests/daemonset/generic_test.yaml +++ /dev/null @@ -1,294 +0,0 @@ -suite: daemonset generic test -templates: - - common.yaml -tests: - - it: should pass with controller set to DaemonSet - documentIndex: &daemonsetDoc 0 - set: - controllers: - main: - type: DaemonSet - asserts: - - hasDocuments: - count: 3 - - isKind: - of: DaemonSet - - isAPIVersion: - of: apps/v1 - - - it: should pass with podSecurityContext changed - documentIndex: *daemonsetDoc - set: - controllers: - main: - type: DaemonSet - pod: - securityContext: - fsGroup: 0 - fsGroupChangePolicy: Always - supplementalGroups: - - 1000 - asserts: - - equal: - path: spec.template.spec.securityContext - value: - fsGroup: 0 - fsGroupChangePolicy: Always - supplementalGroups: - - 1000 - - - it: should pass with podSecurityContext changed from default - documentIndex: *daemonsetDoc - set: - controllers: - main: - type: DaemonSet - podSecurityContext: - fsGroup: 0 - fsGroupChangePolicy: Always - supplementalGroups: - - 1000 - asserts: - - equal: - path: spec.template.spec.securityContext - value: - fsGroup: 0 - fsGroupChangePolicy: Always - supplementalGroups: - - 1000 - - - it: should pass with podSecurityContext changed from default - documentIndex: *daemonsetDoc - set: - controllers: - main: - type: DaemonSet - pod: - containers: - main: - securityContext: - runAsUser: 1000 - runAsGroup: 1000 - capabilities: - add: - - something - asserts: - - equal: - path: spec.template.spec.containers[0].securityContext - value: - allowPrivilegeEscalation: false - privileged: false - readOnlyRootFilesystem: true - runAsNonRoot: true - runAsUser: 1000 - runAsGroup: 1000 - capabilities: - add: - - something - drop: - - ALL - - - it: should pass with podSecurityContext changed - documentIndex: *daemonsetDoc - set: - controllers: - main: - type: DaemonSet - securityContext: - runAsUser: 1000 - runAsGroup: 1000 - capabilities: - add: - - something - asserts: - - equal: - path: spec.template.spec.containers[0].securityContext - value: - allowPrivilegeEscalation: false - privileged: false - readOnlyRootFilesystem: true - runAsNonRoot: true - runAsUser: 1000 - runAsGroup: 1000 - capabilities: - add: - - something - drop: - - ALL - - - it: should pass with multiple envs defined via tpl - documentIndex: *daemonsetDoc - set: - controllers: - main: - type: DaemonSet - pod: - containers: - main: - env: - ENVVAR: "{{ .Values.some_string }}" - ENVVAR2: "{{ .Values.some_int }}" - ENVVAR3: "{{ .Values.some_bool }}" - some_string: a_string - some_int: 123 - some_bool: false - asserts: - - equal: - path: spec.template.spec.containers[0].env - value: - - name: TZ - value: "UTC" - - name: UMASK - value: "002" - - name: UMASK_SET - value: "002" - - name: NVIDIA_VISIBLE_DEVICES - value: "void" - - name: S6_READ_ONLY_ROOT - value: "1" - - name: ENVVAR - value: "a_string" - - name: ENVVAR2 - value: "123" - - name: ENVVAR3 - value: "false" - - - it: should pass with image defined in init containers - documentIndex: *daemonsetDoc - set: - controllers: - main: - type: DaemonSet - image: - repository: some-repo - tag: some-tag - pullPolicy: Always - someImage: - repository: some-other-repo - tag: some-other-tag - pullPolicy: Never - additionalContainers: - some-name: - imageSelector: someImage - pullPolicy: Never - initContainers: - some-name: - imageSelector: someImage - pullPolicy: Never - systemContainers: - some-name: - imageSelector: someImage - pullPolicy: Never - installContainers: - some-name: - imageSelector: someImage - pullPolicy: Never - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - image: some-repo:some-tag - imagePullPolicy: Always - - lengthEqual: - path: spec.template.spec.containers - count: 2 - - lengthEqual: - path: spec.template.spec.initContainers - count: 3 - - - it: should pass with added persistence - documentIndex: *daemonsetDoc - set: - controllers: - main: - type: DaemonSet - persistence: - volume0: - type: pvc - enabled: true - mountPath: /pvc/path - volume1: - enabled: true - type: nfs - server: some.server.local - path: /nfs/path - mountPath: /nfs - volume2: - enabled: true - type: ixVolume - datasetName: ix-app - mountPath: /ixVol - volume3: - enabled: true - type: hostPath - hostPath: /mnt/pool/test - mountPath: /some/path - volume4: - enabled: true - type: emptyDir - medium: Memory - sizeLimit: 1Gi - mountPath: /temp-path - volume5: - type: secret - enabled: true - objectName: some_object_name - defaultMode: "0777" - mountPath: /secret-path - volume6: - type: configMap - enabled: true - objectName: some_object_name - defaultMode: "0777" - mountPath: /configmap-path - ixVolumes: - - /mnt/pool/ix-applications/ix-app - asserts: - - hasDocuments: - count: 4 - - contains: - path: spec.template.spec.volumes - content: - name: volume0 - persistentVolumeClaim: - claimName: RELEASE-NAME-common-test-volume0 - - contains: - path: spec.template.spec.volumes - content: - name: volume1 - nfs: - path: /nfs/path - server: some.server.local - - contains: - path: spec.template.spec.volumes - content: - name: volume2 - hostPath: - path: /mnt/pool/ix-applications/ix-app - - contains: - path: spec.template.spec.volumes - content: - name: volume3 - hostPath: - path: /mnt/pool/test - - contains: - path: spec.template.spec.volumes - content: - name: volume4 - emptyDir: - medium: Memory - sizeLimit: 1Gi - - contains: - path: spec.template.spec.volumes - content: - name: volume5 - secret: - defaultMode: 511 - secretName: some_object_name - - contains: - path: spec.template.spec.volumes - content: - name: volume6 - configMap: - defaultMode: 511 - name: some_object_name diff --git a/.to_be_deleted/common-test/tests/daemonset/label_test.yaml b/.to_be_deleted/common-test/tests/daemonset/label_test.yaml deleted file mode 100644 index 1c8bb71a18..0000000000 --- a/.to_be_deleted/common-test/tests/daemonset/label_test.yaml +++ /dev/null @@ -1,85 +0,0 @@ -suite: daemonset label test -templates: - - common.yaml -chart: - appVersion: &appVer v1.2.3 -tests: - - it: should pass with default values - documentIndex: &daemonsetDoc 0 - set: - controllers: - main: - type: DaemonSet - asserts: - - hasDocuments: - count: 3 - - isKind: - of: DaemonSet - - equal: - path: metadata.labels - value: - app: common-test - app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: common-test - app.kubernetes.io/version: *appVer - helm-revision: "0" - helm.sh/chart: common-test-1.0.0 - release: RELEASE-NAME - - equal: - path: spec.selector.matchLabels - value: - app: common-test - app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/name: common-test - release: RELEASE-NAME - - - it: should pass with controller and global labels - documentIndex: *daemonsetDoc - set: - some_key: some_value - controllers: - main: - type: DaemonSet - labels: - controller_key: controller_value - controller_key2: "{{ .Values.some_key }}" - global: - labels: - global_key: global_value - global_key2: "{{ .Values.some_key }}" - asserts: - - equal: - path: metadata.labels - value: - controller_key: controller_value - controller_key2: some_value - global_key: global_value - global_key2: some_value - app: common-test - app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: common-test - app.kubernetes.io/version: *appVer - helm-revision: "0" - helm.sh/chart: common-test-1.0.0 - release: RELEASE-NAME - - - it: should pass with podLabels set - documentIndex: *daemonsetDoc - set: - some_key: some_value2 - controllers: - main: - type: DaemonSet - pod: - labels: - test: some_value - test2: "{{ .Values.some_key }}" - asserts: - - equal: - path: spec.template.metadata.labels.test2 - value: some_value2 - - equal: - path: spec.template.metadata.labels.test - value: some_value diff --git a/.to_be_deleted/common-test/tests/daemonset/names_test.yaml b/.to_be_deleted/common-test/tests/daemonset/names_test.yaml deleted file mode 100644 index c12f284f99..0000000000 --- a/.to_be_deleted/common-test/tests/daemonset/names_test.yaml +++ /dev/null @@ -1,44 +0,0 @@ -suite: daemonset name test -templates: - - common.yaml -tests: - - it: should pass with default values - documentIndex: &daemonsetDoc 0 - set: - controllers: - main: - type: DaemonSet - asserts: - - hasDocuments: - count: 3 - - isKind: - of: DaemonSet - - equal: - path: metadata.name - value: RELEASE-NAME-common-test - - - it: should pass with nameOverride - documentIndex: *daemonsetDoc - set: - controllers: - main: - type: DaemonSet - nameOverride: overrodename - asserts: - - equal: - path: metadata.name - value: RELEASE-NAME-overrodename - - - it: should pass with global.nameOverride - documentIndex: *daemonsetDoc - set: - controllers: - main: - type: DaemonSet - nameOverride: overrodename - global: - nameOverride: globaloverrodename - asserts: - - equal: - path: metadata.name - value: RELEASE-NAME-globaloverrodename diff --git a/.to_be_deleted/common-test/tests/deployment/annotation_test.yaml b/.to_be_deleted/common-test/tests/deployment/annotation_test.yaml deleted file mode 100644 index d790584f86..0000000000 --- a/.to_be_deleted/common-test/tests/deployment/annotation_test.yaml +++ /dev/null @@ -1,60 +0,0 @@ -suite: deployment annotation test -templates: - - common.yaml -tests: - - it: should pass with default values - documentIndex: &deploymentDoc 0 - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Deployment - - isNull: - path: metadata.annotations - - matchRegex: - path: spec.template.metadata.annotations.rollme - pattern: "^[a-zA-Z0-9]{5}$" - - - it: should pass with controller and global annotations - documentIndex: *deploymentDoc - set: - some_key: some_value - controllers: - main: - annotations: - controller_key: controller_value - controller_key2: "{{ .Values.some_key }}" - global: - annotations: - global_key: global_value - global_key2: "{{ .Values.some_key }}" - asserts: - - equal: - path: metadata.annotations - value: - controller_key: controller_value - controller_key2: some_value - global_key: global_value - global_key2: some_value - - isNull: - path: metadata.annotations.rollme - - matchRegex: - path: spec.template.metadata.annotations.rollme - pattern: "^[a-zA-Z0-9]{5}$" - - - it: should pass with podAnnotations set - documentIndex: *deploymentDoc - set: - some_key: some_value2 - controllers: - main: - pod: - annotations: - test: some_value - test2: "{{ .Values.some_key }}" - asserts: - - isSubset: - path: spec.template.metadata.annotations - content: - test2: some_value2 - test: some_value diff --git a/.to_be_deleted/common-test/tests/deployment/controller_test.yaml b/.to_be_deleted/common-test/tests/deployment/controller_test.yaml deleted file mode 100644 index 3ba948a06a..0000000000 --- a/.to_be_deleted/common-test/tests/deployment/controller_test.yaml +++ /dev/null @@ -1,107 +0,0 @@ -suite: deployment controller test -templates: - - common.yaml -tests: - - it: should pass with default values - documentIndex: &deploymentDoc 0 - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Deployment - - equal: - path: apiVersion - value: apps/v1 - - equal: - path: spec.revisionHistoryLimit - value: 3 - - equal: - path: spec.replicas - value: 1 - - equal: - path: spec.strategy.type - value: Recreate - - isNull: - path: spec.strategy.rollingUpdate - - - it: should pass with controller disabled - documentIndex: *deploymentDoc - set: - controllers: - main: - enabled: false - asserts: - - hasDocuments: - count: 2 - - - it: should pass with controller strategy changed and rollingUpdate strategies set - documentIndex: *deploymentDoc - set: - controllers: - main: - strategy: RollingUpdate - rollingUpdate: - unavailable: 2 - surge: 3 - asserts: - - equal: - path: spec.strategy.type - value: RollingUpdate - - equal: - path: spec.strategy.rollingUpdate - value: - maxUnavailable: 2 - maxSurge: 3 - - - it: should pass with controller strategy changed - documentIndex: *deploymentDoc - set: - controllers: - main: - strategy: RollingUpdate - asserts: - - equal: - path: spec.strategy.type - value: RollingUpdate - - isNull: - path: spec.strategy.rollingUpdate - - - it: should fail with wrong controller - set: - controllers: - main: - type: not_valid_controller - asserts: - - failedTemplate: - errorMessage: Not a valid controller.type (not_valid_controller). Valid options are Deployment, DaemonSet, StatefulSet, Job, CronJob - - - it: should fail with wrong strategy - set: - controllers: - main: - strategy: not_valid_strategy - asserts: - - failedTemplate: - errorMessage: Not a valid strategy type for Deployment (not_valid_strategy) - - - it: should pass with revisionHistoryLimit changed - documentIndex: *deploymentDoc - set: - controllers: - main: - revisionHistoryLimit: 1 - asserts: - - equal: - path: spec.revisionHistoryLimit - value: 1 - - - it: should pass with replicas changed - documentIndex: *deploymentDoc - set: - controllers: - main: - replicas: 6 - asserts: - - equal: - path: spec.replicas - value: 6 diff --git a/.to_be_deleted/common-test/tests/deployment/default_test.yaml b/.to_be_deleted/common-test/tests/deployment/default_test.yaml deleted file mode 100644 index c436ba0fa3..0000000000 --- a/.to_be_deleted/common-test/tests/deployment/default_test.yaml +++ /dev/null @@ -1,121 +0,0 @@ -suite: deployment default test -templates: - - common.yaml -tests: - - it: should pass with default values - documentIndex: &deploymentDoc 0 - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Deployment - - isAPIVersion: - of: apps/v1 - - equal: - path: spec.revisionHistoryLimit - value: 3 - - equal: - path: spec.replicas - value: 1 - - equal: - path: spec.strategy.type - value: Recreate - - equal: - path: spec.template.spec.serviceAccountName - value: default - - equal: - path: spec.template.spec.hostNetwork - value: false - - equal: - path: spec.template.spec.terminationGracePeriodSeconds - value: 10 - - equal: - path: spec.template.spec.enableServiceLinks - value: false - - equal: - path: spec.template.spec.terminationGracePeriodSeconds - value: 10 - - isNull: - path: spec.template.spec.hostname - - equal: - path: spec.template.spec.dnsPolicy - value: ClusterFirst - - isNull: - path: spec.template.spec.dnsConfig - - isNull: - path: spec.template.spec.priorityClassName - - isNull: - path: spec.template.spec.schedulerName - - isNull: - path: spec.template.spec.hostAliases - - isNull: - path: spec.template.spec.nodeSelector - - isNull: - path: spec.template.spec.tolerations - - isNull: - path: spec.template.spec.imagePullSecrets - - isNull: - path: spec.template.spec.runtimeClassName - - equal: - path: spec.template.spec.containers[0].name - value: RELEASE-NAME-common-test - - equal: - path: spec.template.spec.containers[0].image - value: repo:tag - - isNull: - path: spec.template.spec.containers[0].command - - isNull: - path: spec.template.spec.containers[0].args - - equal: - path: spec.template.spec.containers[0].tty - value: false - - equal: - path: spec.template.spec.containers[0].stdin - value: false - - isNull: - path: spec.template.spec.containers[0].lifecycle - - isNull: - path: spec.template.spec.containers[0].terminationMessagePath - - isNull: - path: spec.template.spec.containers[0].terminationMessagePolicy - - equal: - path: spec.template.spec.securityContext - value: - fsGroup: 568 - fsGroupChangePolicy: OnRootMismatch - supplementalGroups: [] - - equal: - path: spec.template.spec.containers[0].securityContext - value: - allowPrivilegeEscalation: false - privileged: false - readOnlyRootFilesystem: true - runAsNonRoot: true - runAsUser: 568 - runAsGroup: 568 - capabilities: - add: [] - drop: - - ALL - - equal: - path: spec.template.spec.containers[0].env - value: - - name: TZ - value: UTC - - name: UMASK - value: "002" - - name: UMASK_SET - value: "002" - - name: NVIDIA_VISIBLE_DEVICES - value: void - - name: S6_READ_ONLY_ROOT - value: "1" - - equal: - path: spec.template.spec.containers[0].volumeMounts - value: - - mountPath: /shared - name: shared - - mountPath: /tmp - name: tmp - - mountPath: /var/logs - name: varlogs diff --git a/.to_be_deleted/common-test/tests/deployment/dns-network_test.yaml b/.to_be_deleted/common-test/tests/deployment/dns-network_test.yaml deleted file mode 100644 index 2b6c1dbc7a..0000000000 --- a/.to_be_deleted/common-test/tests/deployment/dns-network_test.yaml +++ /dev/null @@ -1,401 +0,0 @@ - -suite: deployment dns-network test -templates: - - common.yaml -tests: - - it: should pass with default values - documentIndex: &deploymentDoc 0 - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Deployment - - - it: should pass with hostNetwork set from default - documentIndex: *deploymentDoc - set: - hostNetwork: true - asserts: - - equal: - path: spec.template.spec.hostNetwork - value: true - - - it: should pass with hostNetwork set - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - hostNetwork: true - asserts: - - equal: - path: spec.template.spec.hostNetwork - value: true - - - it: should pass with hostname set - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - hostname: some_hostname - asserts: - - equal: - path: spec.template.spec.hostname - value: some_hostname - - - it: should pass with hostname set from tpl - documentIndex: *deploymentDoc - set: - name: some_hostname - controllers: - main: - pod: - hostname: "{{ .Values.name }}" - asserts: - - equal: - path: spec.template.spec.hostname - value: some_hostname - - - it: should pass with enableServiceLinks set - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - enableServiceLinks: true - asserts: - - equal: - path: spec.template.spec.enableServiceLinks - value: true - - - it: should fail with invalid dnsPolicy - set: - dnsPolicy: invalid - asserts: - - failedTemplate: - errorMessage: Not valid dnsPolicy (invalid). Valid options are ClusterFirst, Default, ClusterFirstWithHostNet, None - - - it: should pass with changed dnsPolicy from default - documentIndex: *deploymentDoc - set: - dnsPolicy: Default - asserts: - - equal: - path: spec.template.spec.dnsPolicy - value: Default - - - it: should pass with changed dnsPolicy - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - dnsPolicy: Default - asserts: - - equal: - path: spec.template.spec.dnsPolicy - value: Default - - - it: should pass with hostNet dnsPolicy - documentIndex: *deploymentDoc - set: - hostNetwork: true - asserts: - - equal: - path: spec.template.spec.dnsPolicy - value: ClusterFirstWithHostNet - - - it: should pass with hostNet and changed dnsPolicy - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - dnsPolicy: Default - hostNetwork: true - asserts: - - equal: - path: spec.template.spec.dnsPolicy - value: Default - - - it: should fail with more than 3 nameservers - set: - dnsConfig: - nameservers: - - ns1 - - ns2 - - ns3 - - ns4 - asserts: - - failedTemplate: - errorMessage: There can be at most 3 nameservers specified in dnsConfig - - - it: should fail with more than 6 domain searches - set: - dnsConfig: - searches: - - domain_search_1 - - domain_search_2 - - domain_search_3 - - domain_search_4 - - domain_search_5 - - domain_search_6 - - domain_search_7 - asserts: - - failedTemplate: - errorMessage: There can be at most 6 search domains specified in dnsConfig - - - it: should fail with no nameservers and dnsPolicy set to None - set: - dnsPolicy: None - asserts: - - failedTemplate: - errorMessage: With dnsPolicy set to None, you must specify at least 1 nameservers on dnsConfig - - - it: should pass with dnsConfig defined from default - documentIndex: *deploymentDoc - set: - dnsConfig: - nameservers: - - ns1 - - ns2 - searches: - - domain_search_1 - - domain_search_2 - options: - - name: ndots - value: 2 - - name: edns0 - asserts: - - equal: - path: spec.template.spec.dnsConfig - value: - nameservers: - - ns1 - - ns2 - searches: - - domain_search_1 - - domain_search_2 - options: - - name: ndots - value: "2" - - name: edns0 - - - it: should pass with dnsConfig defined - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - dnsConfig: - nameservers: - - ns1 - - ns2 - searches: - - domain_search_1 - - domain_search_2 - options: - - name: ndots - value: 2 - - name: edns0 - asserts: - - equal: - path: spec.template.spec.dnsConfig - value: - nameservers: - - ns1 - - ns2 - searches: - - domain_search_1 - - domain_search_2 - options: - - name: ndots - value: "2" - - name: edns0 - - - it: should pass with dnsConfig nameservers only - documentIndex: *deploymentDoc - set: - dnsConfig: - nameservers: - - ns1 - - ns2 - - 1.1.1.1 - asserts: - - equal: - path: spec.template.spec.dnsConfig - value: - nameservers: - - ns1 - - ns2 - - 1.1.1.1 - - - it: should pass with dnsConfig searches only - documentIndex: *deploymentDoc - set: - dnsConfig: - searches: - - domain_search_1 - - domain_search_2 - asserts: - - equal: - path: spec.template.spec.dnsConfig - value: - searches: - - domain_search_1 - - domain_search_2 - - - it: should pass with dnsConfig options only - documentIndex: *deploymentDoc - set: - dnsConfig: - options: - - name: ndots - value: 2 - - name: edns0 - asserts: - - equal: - path: spec.template.spec.dnsConfig - value: - options: - - name: ndots - value: "2" - - name: edns0 - - - it: should pass with dnsConfig nameservers only from tpl - documentIndex: *deploymentDoc - set: - ns1: ns1 - dnsConfig: - nameservers: - - "{{ .Values.ns1 }}" - - ns2 - asserts: - - equal: - path: spec.template.spec.dnsConfig - value: - nameservers: - - ns1 - - ns2 - - - it: should pass with dnsConfig searches only from tpl - documentIndex: *deploymentDoc - set: - ds: domain_search_1 - dnsConfig: - searches: - - "{{ .Values.ds }}" - - domain_search_2 - asserts: - - equal: - path: spec.template.spec.dnsConfig - value: - searches: - - domain_search_1 - - domain_search_2 - - - it: should pass with dnsConfig options only from tpl - documentIndex: *deploymentDoc - set: - opt1_name: ndots - opt1_value: 2 - opt2_name: edns0 - dnsConfig: - options: - - name: "{{ .Values.opt1_name }}" - value: "{{ .Values.opt1_value }}" - - name: "{{ .Values.opt2_name }}" - asserts: - - equal: - path: spec.template.spec.dnsConfig - value: - options: - - name: ndots - value: "2" - - name: edns0 - - - it: should fail without ip in hostAliases - set: - controllers: - main: - pod: - hostAliases: - - hostnames: - - hostname1 - asserts: - - failedTemplate: - errorMessage: field is required in hostAliases - - - it: should fail without hostnames in hostAliases - set: - controllers: - main: - pod: - hostAliases: - - ip: 1.1.1.1 - asserts: - - failedTemplate: - errorMessage: At least one is required in hostAliases - - - it: should pass with hostAliases defined - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - hostAliases: - - ip: 1.1.1.1 - hostnames: - - hostname1 - - hostname2 - - ip: 8.8.8.8 - hostnames: - - hostname3 - - hostname4 - asserts: - - equal: - path: spec.template.spec.hostAliases - value: - - ip: 1.1.1.1 - hostnames: - - hostname1 - - hostname2 - - ip: 8.8.8.8 - hostnames: - - hostname3 - - hostname4 - - - it: should pass with hostAliases defined from tpl - documentIndex: *deploymentDoc - set: - ip1: 1.1.1.1 - ip2: 8.8.8.8 - host1: hostname1 - host2: hostname2 - host3: hostname3 - host4: hostname4 - controllers: - main: - pod: - hostAliases: - - ip: "{{ .Values.ip1 }}" - hostnames: - - "{{ .Values.host1 }}" - - "{{ .Values.host2 }}" - - ip: "{{ .Values.ip2 }}" - hostnames: - - "{{ .Values.host3 }}" - - "{{ .Values.host4 }}" - asserts: - - equal: - path: spec.template.spec.hostAliases - value: - - ip: 1.1.1.1 - hostnames: - - hostname1 - - hostname2 - - ip: 8.8.8.8 - hostnames: - - hostname3 - - hostname4 diff --git a/.to_be_deleted/common-test/tests/deployment/label_test.yaml b/.to_be_deleted/common-test/tests/deployment/label_test.yaml deleted file mode 100644 index 05bc4e69e5..0000000000 --- a/.to_be_deleted/common-test/tests/deployment/label_test.yaml +++ /dev/null @@ -1,79 +0,0 @@ -suite: deployment label test -templates: - - common.yaml -chart: - appVersion: &appVer v1.2.3 -tests: - - it: should pass with default values - documentIndex: &deploymentDoc 0 - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Deployment - - equal: - path: metadata.labels - value: - app: common-test - app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: common-test - app.kubernetes.io/version: *appVer - helm-revision: "0" - helm.sh/chart: common-test-1.0.0 - release: RELEASE-NAME - - equal: - path: spec.selector.matchLabels - value: - app: common-test - app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/name: common-test - release: RELEASE-NAME - - - it: should pass with controller and global labels - documentIndex: *deploymentDoc - set: - some_key: some_value - controllers: - main: - labels: - controller_key: controller_value - controller_key2: "{{ .Values.some_key }}" - global: - labels: - global_key: global_value - global_key2: "{{ .Values.some_key }}" - asserts: - - equal: - path: metadata.labels - value: - controller_key: controller_value - controller_key2: some_value - global_key: global_value - global_key2: some_value - app: common-test - app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: common-test - app.kubernetes.io/version: *appVer - helm-revision: "0" - helm.sh/chart: common-test-1.0.0 - release: RELEASE-NAME - - - it: should pass with podLabels set - documentIndex: *deploymentDoc - set: - some_key: some_value2 - controllers: - main: - pod: - labels: - test: some_value - test2: "{{ .Values.some_key }}" - asserts: - - equal: - path: spec.template.metadata.labels.test2 - value: some_value2 - - equal: - path: spec.template.metadata.labels.test - value: some_value diff --git a/.to_be_deleted/common-test/tests/deployment/names_test.yaml b/.to_be_deleted/common-test/tests/deployment/names_test.yaml deleted file mode 100644 index 696345ea7a..0000000000 --- a/.to_be_deleted/common-test/tests/deployment/names_test.yaml +++ /dev/null @@ -1,38 +0,0 @@ -suite: deployment name test -templates: - - common.yaml -tests: - - it: should pass with default values - documentIndex: &deploymentDoc 0 - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Deployment - - equal: - path: metadata.name - value: RELEASE-NAME-common-test - - - it: should pass with nameOverride - documentIndex: *deploymentDoc - set: - controllers: - main: - nameOverride: overrodename - asserts: - - equal: - path: metadata.name - value: RELEASE-NAME-overrodename - - - it: should pass with global.nameOverride - documentIndex: *deploymentDoc - set: - controllers: - main: - nameOverride: overrodename - global: - nameOverride: globaloverrodename - asserts: - - equal: - path: metadata.name - value: RELEASE-NAME-globaloverrodename diff --git a/.to_be_deleted/common-test/tests/deployment/podSecurityContext_test.yaml b/.to_be_deleted/common-test/tests/deployment/podSecurityContext_test.yaml deleted file mode 100644 index 0385269100..0000000000 --- a/.to_be_deleted/common-test/tests/deployment/podSecurityContext_test.yaml +++ /dev/null @@ -1,109 +0,0 @@ -suite: deployment podSecurityContext test -templates: - - common.yaml -tests: - - it: should pass with default values - documentIndex: &deploymentDoc 0 - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Deployment - - equal: - path: spec.template.spec.securityContext - value: - fsGroup: 568 - fsGroupChangePolicy: OnRootMismatch - supplementalGroups: [] - - - it: should pass with changed podSecurity values from default - documentIndex: *deploymentDoc - set: - podSecurityContext: - fsGroup: 999 - fsGroupChangePolicy: Always - supplementalGroups: - - 1000 - asserts: - - equal: - path: spec.template.spec.securityContext - value: - fsGroup: 999 - fsGroupChangePolicy: Always - supplementalGroups: - - 1000 - - - it: should pass with changed podSecurity values - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - securityContext: - fsGroup: 999 - fsGroupChangePolicy: Always - supplementalGroups: - - 1000 - asserts: - - equal: - path: spec.template.spec.securityContext - value: - fsGroup: 999 - fsGroupChangePolicy: Always - supplementalGroups: - - 1000 - - - it: should fail with invalid fsGroupChangePolicy - set: - controllers: - main: - pod: - securityContext: - fsGroupChangePolicy: invalid_policy - asserts: - - failedTemplate: - errorMessage: Invalid option for fsGroupChangePolicy. Valid options are and . - - - it: should fail with empty fsGroupChangePolicy - set: - controllers: - main: - pod: - securityContext: - fsGroupChangePolicy: - asserts: - - failedTemplate: - errorMessage: key cannot be empty. Set a value or remove the key for the default (OnRootMismatch) to take effect. - - - it: should fail with empty fsGroup - set: - controllers: - main: - pod: - securityContext: - fsGroup: - asserts: - - failedTemplate: - errorMessage: key cannot be empty. Set a value or remove the key for the default (568) to take effect. - - - it: should fail with non-int fsGroup - set: - controllers: - main: - pod: - securityContext: - fsGroup: "1000" - asserts: - - failedTemplate: - errorMessage: key has value of ("1000"). But must be an int. - - - it: should fail with empty supplementalGroups - set: - controllers: - main: - pod: - securityContext: - supplementalGroups: - asserts: - - failedTemplate: - errorMessage: key has a value (). But it must be a list. Set a list value or remove the key for the default ([]) to take effect. diff --git a/.to_be_deleted/common-test/tests/deployment/runtimeClass_test.yaml b/.to_be_deleted/common-test/tests/deployment/runtimeClass_test.yaml deleted file mode 100644 index cc242bed9f..0000000000 --- a/.to_be_deleted/common-test/tests/deployment/runtimeClass_test.yaml +++ /dev/null @@ -1,95 +0,0 @@ -suite: deployment runtimeClassName test -templates: - - common.yaml -tests: - - it: should pass with default values - documentIndex: &deploymentDoc 0 - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Deployment - - isNull: - path: spec.template.spec.runtimeClassName - - - it: should pass with addNvidiaRuntimeClass and nvidiaRuntimeClassName set - documentIndex: *deploymentDoc - set: - scaleGPU: - something: blabla - global: - ixChartContext: - addNvidiaRuntimeClass: true - nvidiaRuntimeClassName: something - asserts: - - equal: - path: spec.template.spec.runtimeClassName - value: something - - - it: should pass with addNvidiaRuntimeClass and nvidiaRuntimeClassName set and gpu on initContainers - documentIndex: *deploymentDoc - set: - initContainers: - some-name: - scaleGPU: - something: blabla - global: - ixChartContext: - addNvidiaRuntimeClass: true - nvidiaRuntimeClassName: something - asserts: - - equal: - path: spec.template.spec.runtimeClassName - value: something - - - it: should pass overriding global and per pod runtime - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - runtimeClassName: perpod - scaleGPU: - something: blabla - globalDefaults: - runtimeClassName: global - global: - ixChartContext: - addNvidiaRuntimeClass: true - nvidiaRuntimeClassName: something - asserts: - - equal: - path: spec.template.spec.runtimeClassName - value: something - - - it: should pass with nvidiaRuntimeClassName set but not addNvidiaRuntimeClassName - documentIndex: *deploymentDoc - set: - global: - ixChartContext: - nvidiaRuntimeClassName: something - asserts: - - isNull: - path: spec.template.spec.runtimeClassName - - - it: should pass with global runtime set - documentIndex: *deploymentDoc - set: - globalDefaults: - runtimeClassName: something - asserts: - - equal: - path: spec.template.spec.runtimeClassName - value: something - - - it: should pass with pod runtime set - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - runtimeClassName: something - asserts: - - equal: - path: spec.template.spec.runtimeClassName - value: something diff --git a/.to_be_deleted/common-test/tests/deployment/serviceAccountName_test.yaml b/.to_be_deleted/common-test/tests/deployment/serviceAccountName_test.yaml deleted file mode 100644 index e201e4878a..0000000000 --- a/.to_be_deleted/common-test/tests/deployment/serviceAccountName_test.yaml +++ /dev/null @@ -1,51 +0,0 @@ - -suite: deployment serviceAccountName -templates: - - common.yaml -tests: - - it: should pass with default values - documentIndex: &deploymentDoc 0 - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Deployment - - - it: should pass (have correct serviceAccountName) with service account enabled - documentIndex: &deploymentDoc 1 - set: - serviceAccount: - main: - enabled: true - asserts: - - equal: - path: spec.template.spec.serviceAccountName - value: RELEASE-NAME-common-test - - - it: should pass (have correct serviceAccountName) with primary service account enabled and nameOverride defined - documentIndex: *deploymentDoc - set: - serviceAccount: - main: - enabled: true - nameOverride: some-name - asserts: - - equal: - path: spec.template.spec.serviceAccountName - value: RELEASE-NAME-common-test-some-name - - - it: should pass (have correct serviceAccountName) with non-primary service account enabled and nameOverride defined - documentIndex: &deploymentDoc 2 - set: - serviceAccount: - main: - enabled: true - primary: true - other: - enabled: true - primary: false - nameOverride: some-name - asserts: - - equal: - path: spec.template.spec.serviceAccountName - value: RELEASE-NAME-common-test diff --git a/.to_be_deleted/common-test/tests/deployment/various_options_test.yaml b/.to_be_deleted/common-test/tests/deployment/various_options_test.yaml deleted file mode 100644 index dd09b56ca6..0000000000 --- a/.to_be_deleted/common-test/tests/deployment/various_options_test.yaml +++ /dev/null @@ -1,470 +0,0 @@ -suite: deployment various options test -templates: - - common.yaml -tests: - - it: should pass with default values - documentIndex: &deploymentDoc 0 - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Deployment - - isNull: - path: spec.template.spec.runtimeClassName - - - it: should pass with terminationGracePeriodSeconds set - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - terminationGracePeriodSeconds: 25 - asserts: - - equal: - path: spec.template.spec.terminationGracePeriodSeconds - value: 25 - - - it: should pass with schedulerName set - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - schedulerName: some_scheduler - asserts: - - equal: - path: spec.template.spec.schedulerName - value: some_scheduler - - - it: should pass with schedulerName set from tpl - documentIndex: *deploymentDoc - set: - name: some_scheduler - controllers: - main: - pod: - schedulerName: "{{ .Values.name }}" - asserts: - - equal: - path: spec.template.spec.schedulerName - value: some_scheduler - - - it: should pass with schedulerName set - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - priorityClassName: some_priority_class_name - asserts: - - equal: - path: spec.template.spec.priorityClassName - value: some_priority_class_name - - - it: should pass with schedulerName set from tpl - documentIndex: *deploymentDoc - set: - name: some_priority_class_name - controllers: - main: - pod: - priorityClassName: "{{ .Values.name }}" - asserts: - - equal: - path: spec.template.spec.priorityClassName - value: some_priority_class_name - - - it: should pass with not set restartPolicy (default will be used) - documentIndex: *deploymentDoc - asserts: - - equal: - path: spec.template.spec.restartPolicy - value: Always - - - it: should pass with set restartPolicy - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - restartPolicy: Always - asserts: - - equal: - path: spec.template.spec.restartPolicy - value: Always - - - it: should fail with invalid restartPolicy - set: - controllers: - main: - pod: - restartPolicy: invalid - asserts: - - failedTemplate: - errorMessage: Invalid (invalid). Valid options are Always, Never, OnFailure - - - it: should fail with invalid restartPolicy on Deployment - set: - controllers: - main: - type: Deployment - pod: - restartPolicy: OnFailure - asserts: - - failedTemplate: - errorMessage: Invalid - - - it: should pass with nodeSelector set - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - nodeSelector: - diskType: ssd - cpuType: intel - asserts: - - equal: - path: spec.template.spec.nodeSelector - value: - diskType: ssd - cpuType: intel - - - it: should pass with nodeSelector set from tpl - documentIndex: *deploymentDoc - set: - some_key: ssd - some_other_key: intel - controllers: - main: - pod: - nodeSelector: - diskType: "{{ .Values.some_key }}" - cpuType: "{{ .Values.some_other_key }}" - asserts: - - equal: - path: spec.template.spec.nodeSelector - value: - diskType: ssd - cpuType: intel - - - it: should fail with invalid operator in tolerations - set: - controllers: - main: - pod: - tolerations: - - operator: invalid_op - asserts: - - failedTemplate: - errorMessage: Invalid . Valid options are Exists, Equal. - - - it: should fail with invalid effect in tolerations - set: - controllers: - main: - pod: - tolerations: - - effect: invalid_effect - operator: Exists - asserts: - - failedTemplate: - errorMessage: Invalid (invalid_effect). Valid options are NoExecute, NoSchedule, PreferNoSchedule - - - it: should fail with empty key and operator Equal in tolerations - set: - controllers: - main: - pod: - tolerations: - - key: "" - operator: Equal - asserts: - - failedTemplate: - errorMessage: is required when is set to - - - it: should fail with operator Exists and defined value in tolerations - set: - controllers: - main: - pod: - tolerations: - - value: something - operator: Exists - asserts: - - failedTemplate: - errorMessage: When is set to , you cannot define a - - - it: should fail with operator Exists and non-integer tolerationSeconds in tolerations - set: - controllers: - main: - pod: - tolerations: - - tolerationSeconds: not_an_int - operator: Exists - asserts: - - failedTemplate: - errorMessage: must result to an integer. - - - it: should pass with tolerations defined, with tolerationSeconds set - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - tolerations: - - operator: Exists - tolerationSeconds: 6000 - asserts: - - equal: - path: spec.template.spec.tolerations - value: - - operator: Exists - tolerationSeconds: 6000 - - - it: should pass with tolerations defined, with only operator Exists - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - tolerations: - - operator: Exists - asserts: - - equal: - path: spec.template.spec.tolerations - value: - - operator: Exists - - - it: should pass with tolerations defined, with only operator Exists from tpl - documentIndex: *deploymentDoc - set: - op: Exists - controllers: - main: - pod: - tolerations: - - operator: "{{ .Values.op }}" - asserts: - - equal: - path: spec.template.spec.tolerations - value: - - operator: Exists - - - it: should pass with tolerations defined, with only operator Equal and key defined - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - tolerations: - - operator: Equal - key: key1 - asserts: - - equal: - path: spec.template.spec.tolerations - value: - - operator: Equal - key: key1 - - - it: should pass with tolerations defined, with only operator Equal and key defined from tpl - documentIndex: *deploymentDoc - set: - some_key: key1 - controllers: - main: - pod: - tolerations: - - operator: Equal - key: "{{ .Values.some_key }}" - asserts: - - equal: - path: spec.template.spec.tolerations - value: - - operator: Equal - key: key1 - - - it: should pass with tolerations defined, with operator Exists and effect defined - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - tolerations: - - operator: Exists - effect: NoExecute - asserts: - - equal: - path: spec.template.spec.tolerations - value: - - operator: Exists - effect: NoExecute - - - it: should pass with tolerations defined, with operator Exists and effect defined from tpl - documentIndex: *deploymentDoc - set: - ef1: NoExecute - controllers: - main: - pod: - tolerations: - - operator: Exists - effect: "{{ .Values.ef1 }}" - asserts: - - equal: - path: spec.template.spec.tolerations - value: - - operator: Exists - effect: NoExecute - - - it: should pass with tolerations defined, with operator Equal and value defined - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - tolerations: - - operator: Equal - value: some_value - key: key1 - asserts: - - equal: - path: spec.template.spec.tolerations - value: - - operator: Equal - value: some_value - key: key1 - - - it: should pass with tolerations defined, with operator Equal and value defined from tpl - documentIndex: *deploymentDoc - set: - val: some_value - controllers: - main: - pod: - tolerations: - - operator: Equal - value: "{{ .Values.val }}" - key: key1 - asserts: - - equal: - path: spec.template.spec.tolerations - value: - - operator: Equal - value: some_value - key: key1 - - - it: should pass with tolerations defined, with operator Equal and value defined from tpl - documentIndex: *deploymentDoc - set: - val: some_value - controllers: - main: - pod: - tolerations: - - operator: Equal - value: "{{ .Values.val }}" - key: key1 - asserts: - - equal: - path: spec.template.spec.tolerations - value: - - operator: Equal - value: some_value - key: key1 - - - it: should pass with tolerations defined, with everything set, multiple entries - documentIndex: *deploymentDoc - set: - controllers: - main: - pod: - tolerations: - - operator: Equal - value: some_value - key: key1 - effect: NoExecute - tolerationSeconds: 6000 - asserts: - - equal: - path: spec.template.spec.tolerations - value: - - operator: Equal - value: some_value - key: key1 - effect: NoExecute - tolerationSeconds: 6000 - - - it: should pass with tolerations defined, with everything set from tpl, multiple entries - documentIndex: *deploymentDoc - set: - op1: Equal - val1: some_value1 - k1: key1 - ef1: NoExecute - op2: Equal - val2: some_value2 - k2: key2 - ef2: NoSchedule - controllers: - main: - pod: - tolerations: - - operator: "{{ .Values.op1 }}" - value: "{{ .Values.val1 }}" - key: "{{ .Values.k1 }}" - effect: "{{ .Values.ef1 }}" - tolerationSeconds: 6000 - - operator: "{{ .Values.op2 }}" - value: "{{ .Values.val2 }}" - key: "{{ .Values.k2 }}" - effect: "{{ .Values.ef2 }}" - tolerationSeconds: 6000 - asserts: - - equal: - path: spec.template.spec.tolerations - value: - - operator: Equal - value: some_value1 - key: key1 - effect: NoExecute - tolerationSeconds: 6000 - - operator: Equal - value: some_value2 - key: key2 - effect: NoSchedule - tolerationSeconds: 6000 diff --git a/.to_be_deleted/common-test/tests/deployment/volume_configMap_test.yaml b/.to_be_deleted/common-test/tests/deployment/volume_configMap_test.yaml deleted file mode 100644 index 83e87891da..0000000000 --- a/.to_be_deleted/common-test/tests/deployment/volume_configMap_test.yaml +++ /dev/null @@ -1,207 +0,0 @@ -suite: deployment configMap volume test -templates: - - common.yaml -tests: - - it: should pass with default values - documentIndex: &deploymentDoc 0 - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Deployment - - isNull: - path: spec.template.spec.volume - - - it: should fail with not set objectName on configMap - set: - persistence: - some_volume: - type: configMap - enabled: true - noMount: true - asserts: - - failedTemplate: - errorMessage: objectName not set for persistence item some_volume - - - it: should fail with not set objectName on configmap - set: - persistence: - some_volume: - type: configMap - enabled: true - noMount: true - asserts: - - failedTemplate: - errorMessage: objectName not set for persistence item some_volume - - - it: should fail with not set objectName on configMap - set: - persistence: - some_volume: - type: configMap - enabled: true - noMount: true - asserts: - - failedTemplate: - errorMessage: objectName not set for persistence item some_volume - - - it: should pass with added configMap - documentIndex: *deploymentDoc - set: - persistence: - some_volume: - type: configMap - enabled: true - objectName: some_object_name - noMount: true - asserts: - - contains: - path: spec.template.spec.volumes - content: - name: some_volume - configMap: - name: some_object_name - - - it: should fail with added configMap and defaultMode as int - documentIndex: *deploymentDoc - set: - persistence: - some_volume: - type: configMap - enabled: true - objectName: some_object_name - defaultMode: 0777 - noMount: true - asserts: - - failedTemplate: - errorMessage: (511, converted to octal) is not valid format. Valid format is string with 4 digits <0777>. - - - it: should pass with added configMap and defaultMode as string - documentIndex: *deploymentDoc - set: - persistence: - some_volume: - type: configMap - enabled: true - objectName: some_object_name - defaultMode: "0777" - noMount: true - asserts: - - contains: - path: spec.template.spec.volumes - content: - name: some_volume - configMap: - name: some_object_name - defaultMode: 0777 - - - it: should fail with added configMap and defaultMode as int from tpl - documentIndex: *deploymentDoc - set: - mode: 644 - persistence: - some_volume: - type: configMap - enabled: true - objectName: some_object_name - defaultMode: "{{ .Values.mode }}" - noMount: true - asserts: - - failedTemplate: - errorMessage: (644, converted to octal) is not valid format. Valid format is string with 4 digits <0777>. - - - it: should pass with added configMap and defaultMode as string from tpl - documentIndex: *deploymentDoc - set: - mode: "0644" - persistence: - some_volume: - type: configMap - enabled: true - objectName: some_object_name - defaultMode: "{{ .Values.mode }}" - noMount: true - asserts: - - contains: - path: spec.template.spec.volumes - content: - name: some_volume - configMap: - name: some_object_name - defaultMode: 0644 - - - it: should pass with added configMap and items - documentIndex: *deploymentDoc - set: - persistence: - some_volume: - type: configMap - enabled: true - objectName: some_object_name - items: - - key: some_key - path: some_path - noMount: true - asserts: - - contains: - path: spec.template.spec.volumes - content: - name: some_volume - configMap: - name: some_object_name - items: - - key: some_key - path: some_path - - - it: should fail with added configMap and no key on items - set: - persistence: - some_volume: - type: configMap - enabled: true - objectName: some_object_name - items: - - path: some_path - noMount: true - asserts: - - failedTemplate: - errorMessage: No key was given for persistence item some_volume - - - it: should fail with added configMap and no path on items - set: - persistence: - some_volume: - type: configMap - enabled: true - objectName: some_object_name - items: - - key: some_key - noMount: true - asserts: - - failedTemplate: - errorMessage: No path was given for persistence item some_volume - - - it: should pass with added configMap and items from tpl - documentIndex: *deploymentDoc - set: - key: some_key - path: some_path - persistence: - some_volume: - type: configMap - enabled: true - objectName: some_object_name - items: - - key: "{{ .Values.key }}" - path: "{{ .Values.path }}" - noMount: true - asserts: - - contains: - path: spec.template.spec.volumes - content: - name: some_volume - configMap: - name: some_object_name - items: - - key: some_key - path: some_path diff --git a/.to_be_deleted/common-test/tests/deployment/volume_custom_test.yaml b/.to_be_deleted/common-test/tests/deployment/volume_custom_test.yaml deleted file mode 100644 index 5c790378c4..0000000000 --- a/.to_be_deleted/common-test/tests/deployment/volume_custom_test.yaml +++ /dev/null @@ -1,112 +0,0 @@ -suite: deployment custom volume test -templates: - - common.yaml -tests: - - it: should pass with default values - documentIndex: &deploymentDoc 0 - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Deployment - - isNull: - path: spec.template.spec.volume - - - it: should fail with custom type but empty volumeSpec - set: - persistence: - some_volume: - type: custom - enabled: true - mountPath: /container - volumeSpec: {} - asserts: - - failedTemplate: - errorMessage: You have defined custom persistence type but no was given on item (some_volume) - - - it: should pass with custom type volume from tpl - documentIndex: *deploymentDoc - set: - k1: value1 - name: some_name - persistence: - some_volume: - type: custom - enabled: true - mountPath: /container - volumeSpec: - arbitraryKey: value - someDict: - k1: "{{ .Values.k1 }}" - k2: value2 - someList: - - name: "{{ .Values.name }}" - something: test - asserts: - - contains: - path: spec.template.spec.volumes - content: - name: some_volume - arbitraryKey: value - someDict: - k1: value1 - k2: value2 - someList: - - name: some_name - something: test - - - it: should pass with multiple custom type volume from tpl - documentIndex: *deploymentDoc - set: - v1: value1 - v2: value2 - name1: some_name1 - name2: some_name2 - persistence: - some_volume: - type: custom - enabled: true - mountPath: /container - volumeSpec: - arbitraryKey: value - someDict: - k1: "{{ .Values.v1 }}" - k2: value - someList: - - name: "{{ .Values.name1 }}" - something: test - some_volume2: - type: custom - enabled: true - mountPath: /container - volumeSpec: - arbitraryKey: value - someDict: - k1: "{{ .Values.v2 }}" - k2: value - someList: - - name: "{{ .Values.name2 }}" - something: test - asserts: - - contains: - path: spec.template.spec.volumes - content: - name: some_volume - arbitraryKey: value - someDict: - k1: value1 - k2: value - someList: - - name: some_name1 - something: test - - contains: - path: spec.template.spec.volumes - content: - name: some_volume2 - arbitraryKey: value - someDict: - k1: value2 - k2: value - someList: - - name: some_name2 - something: test diff --git a/.to_be_deleted/common-test/tests/deployment/volume_emptyDir_test.yaml b/.to_be_deleted/common-test/tests/deployment/volume_emptyDir_test.yaml deleted file mode 100644 index 9da6408850..0000000000 --- a/.to_be_deleted/common-test/tests/deployment/volume_emptyDir_test.yaml +++ /dev/null @@ -1,114 +0,0 @@ -suite: deployment emptyDir volume test -templates: - - common.yaml -tests: - - it: should pass with default values - documentIndex: &deploymentDoc 0 - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Deployment - - isNull: - path: spec.template.spec.volume - - - it: should pass with added emptyDir volume - documentIndex: *deploymentDoc - set: - persistence: - volume1: - enabled: true - type: emptyDir - sizeLimit: 1Gi - noMount: true - asserts: - - contains: - path: spec.template.spec.volumes - content: - name: volume1 - emptyDir: - sizeLimit: 1Gi - - - it: should pass with added emptyDir volume and no sizeLimit - documentIndex: *deploymentDoc - set: - persistence: - volume1: - enabled: true - type: emptyDir - noMount: true - asserts: - - contains: - path: spec.template.spec.volumes - content: - name: volume1 - emptyDir: {} - - - it: should pass with added emptyDir volume memory backed with sizeLimit - documentIndex: *deploymentDoc - set: - persistence: - volume1: - enabled: true - type: emptyDir - medium: Memory - sizeLimit: 1Gi - noMount: true - asserts: - - contains: - path: spec.template.spec.volumes - content: - name: volume1 - emptyDir: - medium: Memory - sizeLimit: 1Gi - - - it: should pass with added emptyDir volume memory backed with sizeLimit via tpl - documentIndex: *deploymentDoc - set: - some_medium: Memory - some_size: 1Gi - persistence: - volume1: - enabled: true - type: emptyDir - medium: "{{ .Values.some_medium }}" - sizeLimit: "{{ .Values.some_size }}" - noMount: true - asserts: - - contains: - path: spec.template.spec.volumes - content: - name: volume1 - emptyDir: - medium: Memory - sizeLimit: 1Gi - - - it: should pass with added emptyDir volume memory backed and no sizeLimit - documentIndex: *deploymentDoc - set: - persistence: - volume1: - enabled: true - type: emptyDir - medium: Memory - noMount: true - asserts: - - contains: - path: spec.template.spec.volumes - content: - name: volume1 - emptyDir: - medium: Memory - - - it: should fail with added emptyDir and non Memory medium - set: - persistence: - volume1: - enabled: true - type: emptyDir - medium: not_memory - noMount: true - asserts: - - failedTemplate: - errorMessage: You can only set as Memory on item (volume1) diff --git a/.to_be_deleted/common-test/tests/deployment/volume_hostPath_test.yaml b/.to_be_deleted/common-test/tests/deployment/volume_hostPath_test.yaml deleted file mode 100644 index 4da5a3d2f3..0000000000 --- a/.to_be_deleted/common-test/tests/deployment/volume_hostPath_test.yaml +++ /dev/null @@ -1,280 +0,0 @@ -suite: deployment hostPath volume test -templates: - - common.yaml -tests: - - it: should pass with default values - documentIndex: &deploymentDoc 0 - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Deployment - - isNull: - path: spec.template.spec.volume - - - it: should fail with not set path on hostPath - set: - persistence: - some_volume: - type: hostPath - enabled: true - noMount: true - asserts: - - failedTemplate: - errorMessage: hostPath not set on item (some_volume) - - - it: should fail with hostPath not starting with / - set: - persistence: - some_volume: - type: hostPath - enabled: true - mountPath: /some/path - hostPath: some/relative/path - asserts: - - failedTemplate: - errorMessage: Host path (some/relative/path) on item (some_volume) must start with a forward slash -> / <- - - - it: should fail with ValidateHostPath globally set on and invalid hostPath (/mnt/pool) - set: - globalDefaults: - validateHostPath: true - persistence: - some_volume: - type: hostPath - enabled: true - noMount: true - hostPath: /mnt/pool - asserts: - - failedTemplate: - errorMessage: Invalid hostPath (/mnt/pool). Allowed hostPaths are valid paths under a given pool. e.g. /mnt/POOL/DATASET, /mnt/POOL/DATASET/DIRECTORY - - - it: should fail with ValidateHostPath globally set on and invalid hostPath (/cluster/ctdb_shared_vol) - set: - globalDefaults: - validateHostPath: true - persistence: - some_volume: - type: hostPath - enabled: true - noMount: true - hostPath: /cluster/ctdb_shared_vol - asserts: - - failedTemplate: - errorMessage: Invalid hostPath (/cluster/ctdb_shared_vol). Allowed hostPaths are valid paths under a given pool. e.g. /mnt/POOL/DATASET, /mnt/POOL/DATASET/DIRECTORY - - - it: should fail with ValidateHostPath globally set on and invalid hostPath (/not_allowed_path) - set: - globalDefaults: - validateHostPath: true - persistence: - some_volume: - type: hostPath - enabled: true - noMount: true - hostPath: /not_allowed_path - asserts: - - failedTemplate: - errorMessage: Invalid hostPath (/not_allowed_path). Allowed hostPaths are valid paths under a given pool. e.g. /mnt/POOL/DATASET, /mnt/POOL/DATASET/DIRECTORY - - - it: should fail with ValidateHostPath set on the persistence item and invalid hostPath (/mnt/pool) - set: - persistence: - some_volume: - type: hostPath - enabled: true - noMount: true - hostPath: /mnt/pool - validateHostPath: true - asserts: - - failedTemplate: - errorMessage: Invalid hostPath (/mnt/pool). Allowed hostPaths are valid paths under a given pool. e.g. /mnt/POOL/DATASET, /mnt/POOL/DATASET/DIRECTORY - - - it: should fail with ValidateHostPath set on the persistence item and invalid hostPath (/cluster/ctdb_shared_vol) - set: - persistence: - some_volume: - type: hostPath - enabled: true - noMount: true - hostPath: /cluster/ctdb_shared_vol - validateHostPath: true - asserts: - - failedTemplate: - errorMessage: Invalid hostPath (/cluster/ctdb_shared_vol). Allowed hostPaths are valid paths under a given pool. e.g. /mnt/POOL/DATASET, /mnt/POOL/DATASET/DIRECTORY - - - it: should fail with ValidateHostPath set on the persistence item and invalid hostPath (/not_allowed_path) - set: - persistence: - some_volume: - type: hostPath - enabled: true - noMount: true - hostPath: /not_allowed_path - validateHostPath: true - asserts: - - failedTemplate: - errorMessage: Invalid hostPath (/not_allowed_path). Allowed hostPaths are valid paths under a given pool. e.g. /mnt/POOL/DATASET, /mnt/POOL/DATASET/DIRECTORY - - - it: should fail with ValidateHostPath globally disabled but enabled on the item and invalid hostPath (/not_allowed_path) - set: - globalDefaults: - validateHostPath: false - persistence: - some_volume: - type: hostPath - enabled: true - noMount: true - hostPath: /not_allowed_path - validateHostPath: true - asserts: - - failedTemplate: - errorMessage: Invalid hostPath (/not_allowed_path). Allowed hostPaths are valid paths under a given pool. e.g. /mnt/POOL/DATASET, /mnt/POOL/DATASET/DIRECTORY - - - it: should fail with added hostPath and invalid hostPathType set - documentIndex: *deploymentDoc - set: - hostType: invalid - persistence: - volume1: - enabled: true - type: hostPath - hostPath: /some_path - hostPathType: "{{ .Values.hostType }}" - noMount: true - asserts: - - failedTemplate: - errorMessage: Invalid option (invalid) on item (volume1). Valid options are DirectoryOrCreate, Directory, FileOrCreate, File, Socket, CharDevice and BlockDevice - - - it: should pass with ValidateHostPath globally enabled but disabled on the item and not allowed path for hostPath (/not_allowed_path) - documentIndex: *deploymentDoc - set: - globalDefaults: - validateHostPath: true - persistence: - some_volume: - type: hostPath - enabled: true - noMount: true - hostPath: /not_allowed_path - validateHostPath: false - asserts: - - contains: - path: spec.template.spec.volumes - content: - name: some_volume - hostPath: - path: /not_allowed_path - - - it: should pass with added hostPath and validation globally enabled (/mnt/pool/dataset) - documentIndex: *deploymentDoc - set: - globalDefaults: - validateHostPath: true - persistence: - volume1: - enabled: true - type: hostPath - hostPath: /mnt/pool/test - noMount: true - asserts: - - contains: - path: spec.template.spec.volumes - content: - name: volume1 - hostPath: - path: /mnt/pool/test - - - it: should pass with added hostPath and validation globally enabled (/cluster/something) - documentIndex: *deploymentDoc - set: - globalDefaults: - validateHostPath: true - persistence: - volume1: - enabled: true - type: hostPath - hostPath: /cluster/something - noMount: true - asserts: - - contains: - path: spec.template.spec.volumes - content: - name: volume1 - hostPath: - path: /cluster/something - - - it: should pass with added hostPath and validation globally enabled (/sys) - documentIndex: *deploymentDoc - set: - globalDefaults: - validateHostPath: true - persistence: - volume1: - enabled: true - type: hostPath - hostPath: /sys - noMount: true - asserts: - - contains: - path: spec.template.spec.volumes - content: - name: volume1 - hostPath: - path: /sys - - - it: should pass with added hostPath and validation globally enabled (/dev) - documentIndex: *deploymentDoc - set: - globalDefaults: - validateHostPath: true - persistence: - volume1: - enabled: true - type: hostPath - hostPath: /dev - noMount: true - asserts: - - contains: - path: spec.template.spec.volumes - content: - name: volume1 - hostPath: - path: /dev - - - it: should pass with added hostPath - documentIndex: *deploymentDoc - set: - persistence: - volume1: - enabled: true - type: hostPath - hostPath: /mnt/pool/test - noMount: true - asserts: - - contains: - path: spec.template.spec.volumes - content: - name: volume1 - hostPath: - path: /mnt/pool/test - - - it: should pass with added hostPath and hostPathType set via tpl - documentIndex: *deploymentDoc - set: - some_key: Directory - persistence: - volume1: - enabled: true - type: hostPath - hostPathType: "{{ .Values.some_key }}" - hostPath: /mnt/pool/test - noMount: true - asserts: - - contains: - path: spec.template.spec.volumes - content: - name: volume1 - hostPath: - path: /mnt/pool/test - type: Directory diff --git a/.to_be_deleted/common-test/tests/deployment/volume_ixVols_test.yaml b/.to_be_deleted/common-test/tests/deployment/volume_ixVols_test.yaml deleted file mode 100644 index 8d350c74cb..0000000000 --- a/.to_be_deleted/common-test/tests/deployment/volume_ixVols_test.yaml +++ /dev/null @@ -1,145 +0,0 @@ -suite: deployment ixVolumes volume test -templates: - - common.yaml -tests: - - it: should pass with default values - documentIndex: &deploymentDoc 0 - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Deployment - - isNull: - path: spec.template.spec.volume - - - it: should fail without set datasetName on ixVolume type - set: - persistence: - some_volume: - type: ixVolume - enabled: true - noMount: true - asserts: - - failedTemplate: - errorMessage: Item (some_volume) is set as ixVolume type, but has no defined - - - it: should fail with set datasetName on ixVolume type but empty ixVolumes - set: - persistence: - some_volume: - type: ixVolume - datasetName: ix-app - enabled: true - noMount: true - ixVolumes: [] - asserts: - - failedTemplate: - errorMessage: Key is empty. But persistence volumes of type ixVolumes is defined. - - - it: should fail on ixVolume type with datasetName set but missing path in ixVolumes - set: - ixVolumes: - - /mnt/pool/ix-applications/ix-other-app - persistence: - some_volume: - type: ixVolume - datasetName: ix-app - enabled: true - noMount: true - asserts: - - failedTemplate: - errorMessage: Dataset Name (ix-app) on item (some_volume) does not exist in ixVolumes list - - - it: should fail on ixVolume type with hostPath set - set: - ixVolumes: - - /mnt/pool/ix-applications/ix-app - persistence: - some_volume: - type: ixVolume - datasetName: ix-app - hostPath: /mnt/pool/test - enabled: true - noMount: true - asserts: - - failedTemplate: - errorMessage: Item (some_volume), is set as ixVolume but has hostPath defined. This is automatically calculated. - - - it: should fail with added ixVolume and invalid hostPathType set - documentIndex: *deploymentDoc - set: - hostType: invalid - ixVolumes: - - /mnt/pool/ix-applications/ix-app - persistence: - volume1: - enabled: true - type: ixVolume - datasetName: ix-app - hostPathType: "{{ .Values.hostType }}" - noMount: true - asserts: - - failedTemplate: - errorMessage: Invalid option (invalid) on item (volume1). Valid options are DirectoryOrCreate, Directory, FileOrCreate, File, Socket, CharDevice and BlockDevice - - - it: should pass with added ixVolume - documentIndex: *deploymentDoc - set: - ixVolumes: - - /mnt/pool/ix-applications/ix-app - persistence: - volume1: - enabled: true - type: ixVolume - datasetName: ix-app - noMount: true - asserts: - - contains: - path: spec.template.spec.volumes - content: - name: volume1 - hostPath: - path: /mnt/pool/ix-applications/ix-app - - - it: should pass with added ixVolume and hostPathType set - documentIndex: *deploymentDoc - set: - ixVolumes: - - /mnt/pool/ix-applications/ix-app - persistence: - volume1: - enabled: true - type: ixVolume - datasetName: ix-app - hostPathType: Directory - noMount: true - asserts: - - contains: - path: spec.template.spec.volumes - content: - name: volume1 - hostPath: - path: /mnt/pool/ix-applications/ix-app - type: Directory - - - it: should pass with added ixVolume and hostPathType set from tpl - documentIndex: *deploymentDoc - set: - hostType: Directory - ixVolumes: - - /mnt/pool/ix-applications/ix-app - persistence: - volume1: - enabled: true - type: ixVolume - datasetName: ix-app - hostPathType: "{{ .Values.hostType }}" - noMount: true - asserts: - - contains: - path: spec.template.spec.volumes - content: - name: volume1 - hostPath: - path: /mnt/pool/ix-applications/ix-app - type: Directory diff --git a/.to_be_deleted/common-test/tests/deployment/volume_nfs_test.yaml b/.to_be_deleted/common-test/tests/deployment/volume_nfs_test.yaml deleted file mode 100644 index 9011cbe139..0000000000 --- a/.to_be_deleted/common-test/tests/deployment/volume_nfs_test.yaml +++ /dev/null @@ -1,68 +0,0 @@ -suite: deployment nfs volume test -templates: - - common.yaml -tests: - - it: should pass with default values - documentIndex: &deploymentDoc 0 - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Deployment - - isNull: - path: spec.template.spec.volume - - - it: should pass with added nfs - documentIndex: *deploymentDoc - set: - persistence: - volume1: - enabled: true - type: nfs - server: some.server.local - path: /nfs/path - noMount: true - asserts: - - contains: - path: spec.template.spec.volumes - content: - name: volume1 - nfs: - server: some.server.local - path: /nfs/path - - - it: should fail with not set server on nfs - set: - persistence: - some_volume: - type: nfs - enabled: true - path: /some_path - noMount: true - asserts: - - failedTemplate: - errorMessage: NFS Server not set on item some_volume - - - it: should fail with path not starting with / - set: - persistence: - some_volume: - type: nfs - enabled: true - path: some/relative/path - noMount: true - asserts: - - failedTemplate: - errorMessage: NFS path (some/relative/path) on (some_volume) must start with a forward slash -> / <- - - - it: should fail with not set path on nfs - set: - persistence: - some_volume: - type: nfs - enabled: true - server: some_server - noMount: true - asserts: - - failedTemplate: - errorMessage: NFS Path not set on item some_volume diff --git a/.to_be_deleted/common-test/tests/deployment/volume_pvc_test.yaml b/.to_be_deleted/common-test/tests/deployment/volume_pvc_test.yaml deleted file mode 100644 index c5039077f3..0000000000 --- a/.to_be_deleted/common-test/tests/deployment/volume_pvc_test.yaml +++ /dev/null @@ -1,134 +0,0 @@ -suite: deployment pvc volume test -templates: - - common.yaml -tests: - - it: should pass with default values - documentIndex: &deploymentDoc 0 - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Deployment - - isNull: - path: spec.template.spec.volume - - - it: should pass with added PVC - documentIndex: *deploymentDoc - set: - persistence: - some_volume: - type: pvc - enabled: true - noMount: true - asserts: - - contains: - path: spec.template.spec.volumes - content: - name: some_volume - persistentVolumeClaim: - claimName: RELEASE-NAME-common-test-some_volume - - - it: should pass with added PVC and existingClaim - documentIndex: *deploymentDoc - set: - persistence: - some_volume: - type: pvc - enabled: true - existingClaim: some_existing_claim - noMount: true - asserts: - - contains: - path: spec.template.spec.volumes - content: - name: some_volume - persistentVolumeClaim: - claimName: some_existing_claim - - - it: should pass with added PVC and existingClaim from tpl - documentIndex: *deploymentDoc - set: - claim: some_existing_claim - persistence: - some_volume: - type: pvc - enabled: true - existingClaim: "{{ .Values.claim }}" - noMount: true - asserts: - - contains: - path: spec.template.spec.volumes - content: - name: some_volume - persistentVolumeClaim: - claimName: some_existing_claim - - - it: should pass with added PVC and nameOverride - documentIndex: *deploymentDoc - set: - persistence: - some_volume: - type: pvc - enabled: true - nameOverride: some_claim - noMount: true - asserts: - - contains: - path: spec.template.spec.volumes - content: - name: some_volume - persistentVolumeClaim: - claimName: RELEASE-NAME-common-test-some_claim - - - it: should pass with added PVC and nameOverride from tpl - documentIndex: *deploymentDoc - set: - claim: some_claim - persistence: - some_volume: - type: pvc - enabled: true - nameOverride: "{{ .Values.claim }}" - noMount: true - asserts: - - contains: - path: spec.template.spec.volumes - content: - name: some_volume - persistentVolumeClaim: - claimName: RELEASE-NAME-common-test-some_claim - - - it: should pass with added PVC and forceName - documentIndex: *deploymentDoc - set: - persistence: - some_volume: - type: pvc - enabled: true - forceName: forced_name - noMount: true - asserts: - - contains: - path: spec.template.spec.volumes - content: - name: some_volume - persistentVolumeClaim: - claimName: forced_name - - - it: should pass with added PVC and forceName from tpl - documentIndex: *deploymentDoc - set: - claim: forced_name - persistence: - some_volume: - type: pvc - enabled: true - forceName: "{{ .Values.claim }}" - noMount: true - asserts: - - contains: - path: spec.template.spec.volumes - content: - name: some_volume - persistentVolumeClaim: - claimName: forced_name diff --git a/.to_be_deleted/common-test/tests/deployment/volume_secret_test.yaml b/.to_be_deleted/common-test/tests/deployment/volume_secret_test.yaml deleted file mode 100644 index fbabca3f67..0000000000 --- a/.to_be_deleted/common-test/tests/deployment/volume_secret_test.yaml +++ /dev/null @@ -1,197 +0,0 @@ -suite: deployment secret volume test -templates: - - common.yaml -tests: - - it: should pass with default values - documentIndex: &deploymentDoc 0 - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Deployment - - isNull: - path: spec.template.spec.volume - - - it: should fail with not set objectName on secret - set: - persistence: - some_volume: - type: secret - enabled: true - noMount: true - asserts: - - failedTemplate: - errorMessage: objectName not set for persistence item some_volume - - - it: should fail with not set objectName on secret - set: - persistence: - some_volume: - type: secret - enabled: true - noMount: true - asserts: - - failedTemplate: - errorMessage: objectName not set for persistence item some_volume - - - it: should pass with added secret - documentIndex: *deploymentDoc - set: - persistence: - some_volume: - type: secret - enabled: true - objectName: some_object_name - noMount: true - asserts: - - contains: - documentIndex: *deploymentDoc - path: spec.template.spec.volumes - content: - name: some_volume - secret: - secretName: some_object_name - - - it: should fail with added secret and defaultMode as int - documentIndex: *deploymentDoc - set: - persistence: - some_volume: - type: secret - enabled: true - objectName: some_object_name - defaultMode: 0777 - noMount: true - asserts: - - failedTemplate: - errorMessage: (511, converted to octal) is not valid format. Valid format is string with 4 digits <0777>. - - - it: should pass with added secret and defaultMode as string - documentIndex: *deploymentDoc - set: - persistence: - some_volume: - type: secret - enabled: true - objectName: some_object_name - defaultMode: "0777" - noMount: true - asserts: - - contains: - path: spec.template.spec.volumes - content: - name: some_volume - secret: - secretName: some_object_name - defaultMode: 0777 - - - it: should fail with added secret and defaultMode as int from tpl - documentIndex: *deploymentDoc - set: - mode: 644 - persistence: - some_volume: - type: secret - enabled: true - objectName: some_object_name - defaultMode: "{{ .Values.mode }}" - noMount: true - asserts: - - failedTemplate: - errorMessage: (644, converted to octal) is not valid format. Valid format is string with 4 digits <0777>. - - - it: should pass with added secret and defaultMode as string from tpl - documentIndex: *deploymentDoc - set: - mode: "0644" - persistence: - some_volume: - type: secret - enabled: true - objectName: some_object_name - defaultMode: "{{ .Values.mode }}" - noMount: true - asserts: - - contains: - path: spec.template.spec.volumes - content: - name: some_volume - secret: - secretName: some_object_name - defaultMode: 0644 - - - it: should fail with added secret and no key on items - set: - persistence: - some_volume: - type: secret - enabled: true - objectName: some_object_name - items: - - path: some_path - noMount: true - asserts: - - failedTemplate: - errorMessage: No key was given for persistence item some_volume - - - it: should fail with added secret and no path on items - set: - persistence: - some_volume: - type: secret - enabled: true - objectName: some_object_name - items: - - key: some_key - noMount: true - asserts: - - failedTemplate: - errorMessage: No path was given for persistence item some_volume - - - it: should pass with added secret and items - documentIndex: *deploymentDoc - set: - persistence: - some_volume: - type: secret - enabled: true - objectName: some_object_name - items: - - key: some_key - path: some_path - noMount: true - asserts: - - contains: - path: spec.template.spec.volumes - content: - name: some_volume - secret: - secretName: some_object_name - items: - - key: some_key - path: some_path - - - it: should pass with added secret and items from tpl - documentIndex: *deploymentDoc - set: - key: some_key - path: some_path - persistence: - some_volume: - type: secret - enabled: true - objectName: some_object_name - items: - - key: "{{ .Values.key }}" - path: "{{ .Values.path }}" - noMount: true - asserts: - - contains: - path: spec.template.spec.volumes - content: - name: some_volume - secret: - secretName: some_object_name - items: - - key: some_key - path: some_path diff --git a/.to_be_deleted/common-test/tests/deployment/volume_test.yaml b/.to_be_deleted/common-test/tests/deployment/volume_test.yaml deleted file mode 100644 index 34c3316bb6..0000000000 --- a/.to_be_deleted/common-test/tests/deployment/volume_test.yaml +++ /dev/null @@ -1,24 +0,0 @@ -suite: deployment volume test -templates: - - common.yaml -tests: - - it: should pass with default values - documentIndex: &deploymentDoc 0 - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Deployment - - isNull: - path: spec.template.spec.volume - - - it: should fail with wrong persistence type - set: - persistence: - some_volume: - type: not_valid_persistence - enabled: true - noMount: true - asserts: - - failedTemplate: - errorMessage: Not a valid persistence.type (not_valid_persistence) diff --git a/.to_be_deleted/common-test/tests/externalInterfaces/externalInterfaces_test.yaml b/.to_be_deleted/common-test/tests/externalInterfaces/externalInterfaces_test.yaml deleted file mode 100644 index ce78f71f3d..0000000000 --- a/.to_be_deleted/common-test/tests/externalInterfaces/externalInterfaces_test.yaml +++ /dev/null @@ -1,405 +0,0 @@ -suite: external interfaces test -templates: - - common.yaml -chart: - appVersion: &appVer v1.2.3 -tests: - - it: should pass with default values - documentIndex: &deploymentDoc 0 - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Deployment - - - it: should fail without hostInterface - set: - externalInterfaces: - - hostInterface: "" - asserts: - - failedTemplate: - errorMessage: is required when configuring External Interfaces. - - - it: should fail without ipam type - set: - externalInterfaces: - - hostInterface: ens3s0 - ipam: {} - asserts: - - failedTemplate: - errorMessage: is required. Interface (ens3s0) - - - it: should fail with invalid ipam type - set: - externalInterfaces: - - hostInterface: ens3s0 - ipam: - type: invalid_type - asserts: - - failedTemplate: - errorMessage: Invalid option for (invalid_type). Valid options are static and dhcp. Interface (ens3s0) - - - it: should fail with dhcp ipam and staticIPConfigurations - set: - externalInterfaces: - - hostInterface: ens3s0 - ipam: - type: dhcp - staticIPConfigurations: - - 1.1.1.1 - asserts: - - failedTemplate: - errorMessage: and cannot be used with of (dhcp). Interface (ens3s0) - - - it: should fail with dhcp ipam and staticRoutes - set: - externalInterfaces: - - hostInterface: ens3s0 - ipam: - type: dhcp - staticRoutes: - - gateway: 1.1.1.1 - destination: 1.1.1.1 - asserts: - - failedTemplate: - errorMessage: and cannot be used with of (dhcp). Interface (ens3s0) - - - it: should fail with static ipam and no staticIPConfigurations - set: - externalInterfaces: - - hostInterface: ens3s0 - ipam: - type: static - staticIPConfigurations: [] - asserts: - - failedTemplate: - errorMessage: Static IP is required when is static. Interface (ens3s0) - - - it: should fail with static ipam and no staticRoutes.gateway - set: - externalInterfaces: - - hostInterface: ens3s0 - ipam: - type: static - staticIPConfigurations: - - 1.1.1.1 - staticRoutes: - - gateway: "" - asserts: - - failedTemplate: - errorMessage: and are required when are defined. Interface (ens3s0) - - - it: should fail with static ipam and no staticRoutes.destination - set: - externalInterfaces: - - hostInterface: ens3s0 - ipam: - type: static - staticIPConfigurations: - - 1.1.1.1 - staticRoutes: - - gateway: 1.1.1.1 - destination: "" - asserts: - - failedTemplate: - errorMessage: and are required when are defined. Interface (ens3s0) - - - it: should fail with ixExternalInterfacesConfiguration empty - documentIndex: &externalInterfaceDoc 0 - set: - # Only to pass validation - externalInterfaces: - - hostInterface: ens3s0 - ipam: - type: dhcp - # Simulate the ix Injected values - ixExternalInterfacesConfiguration: - - '{"cniVersion": "0.3.1", "name": "ix-RELEASE-NAME-0", "type": "macvlan", "master": "ens3s0", "ipam": {"type": "dhcp"}}' - asserts: - - failedTemplate: - errorMessage: There are externalInterfaces defined, but key is empty. - - - it: should pass with externalInterface defined - documentIndex: &externalInterfaceDoc 0 - set: - # Only to pass validation - externalInterfaces: - - hostInterface: ens3s0 - ipam: - type: dhcp - # Simulate the ix Injected values - ixExternalInterfacesConfiguration: - - '{"cniVersion": "0.3.1", "name": "ix-RELEASE-NAME-0", "type": "macvlan", "master": "ens3s0", "ipam": {"type": "dhcp"}}' - ixExternalInterfacesConfigurationNames: - - ix-RELEASE-NAME-0 - asserts: - - hasDocuments: - count: 4 - - isKind: - of: NetworkAttachmentDefinition - - isAPIVersion: - of: k8s.cni.cncf.io/v1 - - equal: - path: spec - value: - config: '{"cniVersion": "0.3.1", "name": "ix-RELEASE-NAME-0", "type": "macvlan", "master": "ens3s0", "ipam": {"type": "dhcp"}}' - - equal: - path: metadata.name - value: ix-RELEASE-NAME-0 - - - it: should pass with externalInterface defined (annotation check) - documentIndex: &deploymentDoc 1 - set: - # Only to pass validation - externalInterfaces: - - hostInterface: ens3s0 - ipam: - type: dhcp - # Simulate the ix Injected values - ixExternalInterfacesConfiguration: - - '{"cniVersion": "0.3.1", "name": "ix-RELEASE-NAME-0", "type": "macvlan", "master": "ens3s0", "ipam": {"type": "dhcp"}}' - ixExternalInterfacesConfigurationNames: - - ix-RELEASE-NAME-0 - asserts: - - hasDocuments: - count: 4 - - isKind: - of: Deployment - - isNull: - path: metadata.annotations - - isSubset: - path: spec.template.metadata.annotations - content: - k8s.v1.cni.cncf.io/networks: ix-RELEASE-NAME-0 - - matchRegex: - path: spec.template.metadata.annotations.rollme - pattern: "^[a-zA-Z0-9]{5}$" - - - it: should pass with externalInterface defined, multiple entries (First Doc) - documentIndex: *externalInterfaceDoc - set: - # Only to pass validation - externalInterfaces: - - hostInterface: ens3s0 - ipam: - type: dhcp - # Simulate the ix Injected values - ixExternalInterfacesConfiguration: - - '{"cniVersion": "0.3.1", "name": "ix-RELEASE-NAME-0", "type": "macvlan", "master": "ens3s0", "ipam": {"type": "dhcp"}}' - - '{"cniVersion": "0.3.1", "name": "ix-RELEASE-NAME-1", "type": "macvlan", "master": "ens5s0", "ipam": {"type": "dhcp"}}' - ixExternalInterfacesConfigurationNames: - - ix-RELEASE-NAME-0 - asserts: - - hasDocuments: - count: 5 - - isKind: - of: NetworkAttachmentDefinition - - isAPIVersion: - of: k8s.cni.cncf.io/v1 - - equal: - path: spec - value: - config: '{"cniVersion": "0.3.1", "name": "ix-RELEASE-NAME-0", "type": "macvlan", "master": "ens3s0", "ipam": {"type": "dhcp"}}' - - equal: - path: metadata.name - value: ix-RELEASE-NAME-0 - - - it: should pass with externalInterface defined, multiple entries (Second Doc) - documentIndex: &otherExternalInterfaceDoc 1 - set: - # Only to pass validation - externalInterfaces: - - hostInterface: ens3s0 - ipam: - type: dhcp - # Simulate the ix Injected values - ixExternalInterfacesConfiguration: - - '{"cniVersion": "0.3.1", "name": "ix-RELEASE-NAME-0", "type": "macvlan", "master": "ens3s0", "ipam": {"type": "dhcp"}}' - - '{"cniVersion": "0.3.1", "name": "ix-RELEASE-NAME-1", "type": "macvlan", "master": "ens5s0", "ipam": {"type": "dhcp"}}' - ixExternalInterfacesConfigurationNames: - - ix-RELEASE-NAME-0 - - ix-RELEASE-NAME-1 - asserts: - - hasDocuments: - count: 5 - - isKind: - of: NetworkAttachmentDefinition - - isAPIVersion: - of: k8s.cni.cncf.io/v1 - - equal: - path: spec - value: - config: '{"cniVersion": "0.3.1", "name": "ix-RELEASE-NAME-1", "type": "macvlan", "master": "ens5s0", "ipam": {"type": "dhcp"}}' - - equal: - path: metadata.name - value: ix-RELEASE-NAME-1 - - - it: should pass with externalInterface defined, multiple entries (annotation check) - documentIndex: &deploymentDoc 2 - set: - # Only to pass validation - externalInterfaces: - - hostInterface: ens3s0 - ipam: - type: dhcp - # Simulate the ix Injected values - ixExternalInterfacesConfiguration: - - '{"cniVersion": "0.3.1", "name": "ix-RELEASE-NAME-0", "type": "macvlan", "master": "ens3s0", "ipam": {"type": "dhcp"}}' - - '{"cniVersion": "0.3.1", "name": "ix-RELEASE-NAME-1", "type": "macvlan", "master": "ens5s0", "ipam": {"type": "dhcp"}}' - ixExternalInterfacesConfigurationNames: - - ix-RELEASE-NAME-0 - - ix-RELEASE-NAME-1 - asserts: - - hasDocuments: - count: 5 - - isKind: - of: Deployment - - isNull: - path: metadata.annotations - - isSubset: - path: spec.template.metadata.annotations - content: - k8s.v1.cni.cncf.io/networks: ix-RELEASE-NAME-0, ix-RELEASE-NAME-1 - - matchRegex: - path: spec.template.metadata.annotations.rollme - pattern: "^[a-zA-Z0-9]{5}$" - - - it: should pass with externalInterface defined and global annotations, multiple entries - documentIndex: &externalInterfaceDoc 0 - set: - global: - annotations: - key1: value1 - key2: value2 - # Only to pass validation - externalInterfaces: - - hostInterface: ens3s0 - ipam: - type: dhcp - # Simulate the ix Injected values - ixExternalInterfacesConfiguration: - - '{"cniVersion": "0.3.1", "name": "ix-RELEASE-NAME-0", "type": "macvlan", "master": "ens3s0", "ipam": {"type": "dhcp"}}' - ixExternalInterfacesConfigurationNames: - - ix-RELEASE-NAME-0 - asserts: - - hasDocuments: - count: 4 - - isKind: - of: NetworkAttachmentDefinition - - isAPIVersion: - of: k8s.cni.cncf.io/v1 - - equal: - path: metadata.annotations - value: - key1: value1 - key2: value2 - - - it: should pass with externalInterface defined and global annotations from tpl, multiple entries - documentIndex: &externalInterfaceDoc 0 - set: - k1: value1 - k2: value2 - global: - annotations: - key1: "{{ .Values.k1 }}" - key2: "{{ .Values.k2 }}" - # Only to pass validation - externalInterfaces: - - hostInterface: ens3s0 - ipam: - type: dhcp - # Simulate the ix Injected values - ixExternalInterfacesConfiguration: - - '{"cniVersion": "0.3.1", "name": "ix-RELEASE-NAME-0", "type": "macvlan", "master": "ens3s0", "ipam": {"type": "dhcp"}}' - ixExternalInterfacesConfigurationNames: - - ix-RELEASE-NAME-0 - asserts: - - hasDocuments: - count: 4 - - isKind: - of: NetworkAttachmentDefinition - - isAPIVersion: - of: k8s.cni.cncf.io/v1 - - equal: - path: metadata.annotations - value: - key1: value1 - key2: value2 - - - it: should pass with externalInterface defined and global labels, multiple entries - documentIndex: &externalInterfaceDoc 0 - set: - global: - labels: - key1: value1 - key2: value2 - # Only to pass validation - externalInterfaces: - - hostInterface: ens3s0 - ipam: - type: dhcp - # Simulate the ix Injected values - ixExternalInterfacesConfiguration: - - '{"cniVersion": "0.3.1", "name": "ix-RELEASE-NAME-0", "type": "macvlan", "master": "ens3s0", "ipam": {"type": "dhcp"}}' - ixExternalInterfacesConfigurationNames: - - ix-RELEASE-NAME-0 - asserts: - - hasDocuments: - count: 4 - - isKind: - of: NetworkAttachmentDefinition - - isAPIVersion: - of: k8s.cni.cncf.io/v1 - - equal: - path: metadata.labels - value: - app: common-test - app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: common-test - app.kubernetes.io/version: *appVer - helm-revision: "0" - helm.sh/chart: common-test-1.0.0 - key1: value1 - key2: value2 - release: RELEASE-NAME - - - it: should pass with externalInterface defined and global labels from tpl, multiple entries - documentIndex: &externalInterfaceDoc 0 - set: - k1: value1 - k2: value2 - global: - labels: - key1: "{{ .Values.k1 }}" - key2: "{{ .Values.k2 }}" - # Only to pass validation - externalInterfaces: - - hostInterface: ens3s0 - ipam: - type: dhcp - # Simulate the ix Injected values - ixExternalInterfacesConfiguration: - - '{"cniVersion": "0.3.1", "name": "ix-RELEASE-NAME-0", "type": "macvlan", "master": "ens3s0", "ipam": {"type": "dhcp"}}' - ixExternalInterfacesConfigurationNames: - - ix-RELEASE-NAME-0 - asserts: - - hasDocuments: - count: 4 - - isKind: - of: NetworkAttachmentDefinition - - isAPIVersion: - of: k8s.cni.cncf.io/v1 - - equal: - path: metadata.labels - value: - app: common-test - app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: common-test - app.kubernetes.io/version: *appVer - helm-revision: "0" - helm.sh/chart: common-test-1.0.0 - key1: value1 - key2: value2 - release: RELEASE-NAME diff --git a/.to_be_deleted/common-test/tests/image_pull_secrets/image_pull_secrets_test.yaml b/.to_be_deleted/common-test/tests/image_pull_secrets/image_pull_secrets_test.yaml deleted file mode 100644 index fee8d5706a..0000000000 --- a/.to_be_deleted/common-test/tests/image_pull_secrets/image_pull_secrets_test.yaml +++ /dev/null @@ -1,416 +0,0 @@ -suite: image pull secrets test -templates: - - common.yaml -chart: - appVersion: &appVer v1.2.3 -tests: - - it: should pass with default values - documentIndex: &deploymentDoc 0 - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Deployment - - - it: should fail without name in imagePullCredentials - set: - imagePullCredentials: - - enabled: true - content: - registry: quay.io - username: some_name - password: some_password - email: someone@example.com - asserts: - - failedTemplate: - errorMessage: is required for Image Pull Secrets Credentials - - - it: should fail without content in imagePullCredentials - set: - imagePullCredentials: - - name: registry-creds - enabled: true - asserts: - - failedTemplate: - errorMessage: is not defined in Image Pull Secrets Credential (registry-creds) - - - it: should fail without registry in imagePullCredentials - set: - imagePullCredentials: - - name: registry-creds - enabled: true - content: - username: some_name - password: some_password - email: someone@example.com - asserts: - - failedTemplate: - errorMessage: is not defined in Image Pull Secrets Credential (registry-creds) - - - it: should fail without email in imagePullCredentials - set: - imagePullCredentials: - - name: registry-creds - enabled: true - content: - username: some_name - password: some_password - registry: quay.io - asserts: - - failedTemplate: - errorMessage: is not defined in Image Pull Secrets Credential (registry-creds) - - - it: should fail without username in imagePullCredentials - set: - imagePullCredentials: - - name: registry-creds - enabled: true - content: - password: some_password - registry: quay.io - email: someone@example.com - asserts: - - failedTemplate: - errorMessage: is not defined in Image Pull Secrets Credential (registry-creds) - - - it: should fail without password in imagePullCredentials - set: - imagePullCredentials: - - name: registry-creds - enabled: true - content: - username: some_name - registry: quay.io - email: someone@example.com - asserts: - - failedTemplate: - errorMessage: is not defined in Image Pull Secrets Credential (registry-creds) - - - it: should fail with special characters in name in imagePullCredentials - set: - imagePullCredentials: - - name: registry-creds!!! - enabled: true - content: - username: some_name - registry: quay.io - email: someone@example.com - asserts: - - failedTemplate: - errorMessage: (registry-creds!!!) can only container this alphanumerical characters (- a-z A-Z 0-9) - - - it: should pass with imagePullCredentials defined and super long name - documentIndex: &secretDoc 0 - set: - imagePullCredentials: - - name: thisNameIsSuperLong-1111111111111111111111111-ItsStillGoing22222222222222-SOMEMORE - enabled: true - content: - registry: quay.io - username: some_name - password: some_password - email: someone@example.com - asserts: - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-thisnameissuperlong-111111111111111111 - - - it: should pass with imagePullCredentials defined (Secret) - documentIndex: *secretDoc - set: - imagePullCredentials: - - name: registry-creds - enabled: true - content: - registry: quay.io - username: some_name - password: some_password - email: someone@example.com - asserts: - - hasDocuments: - count: 4 - - isKind: - of: Secret - - isAPIVersion: - of: v1 - - equal: - path: type - value: kubernetes.io/dockerconfigjson - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-registry-creds - - isNotEmpty: - path: data.\.dockerconfigjson - - isNull: - path: metadata.annotations - - equal: - path: metadata.labels - value: - app: common-test - app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: common-test - app.kubernetes.io/version: *appVer - helm-revision: "0" - helm.sh/chart: common-test-1.0.0 - release: RELEASE-NAME - - - it: should pass with imagePullCredentials defined (Deployment) - documentIndex: &deploymentDoc 1 - set: - imagePullCredentials: - - name: registry-creds - enabled: true - content: - registry: quay.io - username: some_name - password: some_password - email: someone@example.com - asserts: - - isKind: - of: Deployment - - equal: - path: spec.template.spec.imagePullSecrets - value: - - name: RELEASE-NAME-common-test-registry-creds - - - it: should pass with multiple imagePullCredentials defined (Secret 1/2) - documentIndex: *secretDoc - set: - imagePullCredentials: - - name: registry-creds - enabled: true - content: - registry: quay.io - username: some_name - password: some_password - email: someone@example.com - - name: registry-creds2 - enabled: true - content: - registry: quay.io2 - username: some_name2 - password: some_password2 - email: someone@example.com2 - asserts: - - hasDocuments: - count: 5 - - isKind: - of: Secret - - isAPIVersion: - of: v1 - - equal: - path: type - value: kubernetes.io/dockerconfigjson - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-registry-creds - - isNotEmpty: - path: data.\.dockerconfigjson - - isNull: - path: metadata.annotations - - equal: - path: metadata.labels - value: - app: common-test - app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: common-test - app.kubernetes.io/version: *appVer - helm-revision: "0" - helm.sh/chart: common-test-1.0.0 - release: RELEASE-NAME - - - it: should pass with multiple imagePullCredentials defined (Secret 2/2) - documentIndex: &secondSecretDoc 1 - set: - imagePullCredentials: - - name: registry-creds - enabled: true - content: - registry: quay.io - username: some_name - password: some_password - email: someone@example.com - - name: registry-creds2 - enabled: true - content: - registry: quay.io2 - username: some_name2 - password: some_password2 - email: someone@example.com2 - asserts: - - hasDocuments: - count: 5 - - isKind: - of: Secret - - isAPIVersion: - of: v1 - - equal: - path: type - value: kubernetes.io/dockerconfigjson - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-registry-creds2 - - isNotEmpty: - path: data.\.dockerconfigjson - - isNull: - path: metadata.annotations - - equal: - path: metadata.labels - value: - app: common-test - app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: common-test - app.kubernetes.io/version: *appVer - helm-revision: "0" - helm.sh/chart: common-test-1.0.0 - release: RELEASE-NAME - - - it: should pass with imagePullCredentials defined (Deployment) - documentIndex: &deploymentDoc 2 - set: - imagePullCredentials: - - name: registry-creds - enabled: true - content: - registry: quay.io - username: some_name - password: some_password - email: someone@example.com - - name: registry-creds2 - enabled: true - content: - registry: quay.io2 - username: some_name2 - password: some_password2 - email: someone@example.com2 - asserts: - - isKind: - of: Deployment - - equal: - path: spec.template.spec.imagePullSecrets - value: - - name: RELEASE-NAME-common-test-registry-creds - - name: RELEASE-NAME-common-test-registry-creds2 - - - it: should pass with imagePullCredentials defined and global annotations - documentIndex: *secretDoc - set: - global: - annotations: - key1: value1 - key2: value2 - imagePullCredentials: - - name: registry-creds - enabled: true - content: - registry: quay.io - username: some_name - password: some_password - email: someone@example.com - asserts: - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-registry-creds - - equal: - path: metadata.annotations - value: - key1: value1 - key2: value2 - - - it: should pass with imagePullCredentials defined and global annotations from tpl - documentIndex: *secretDoc - set: - k1: value1 - k2: value2 - global: - annotations: - key1: "{{ .Values.k1 }}" - key2: "{{ .Values.k2 }}" - imagePullCredentials: - - name: registry-creds - enabled: true - content: - registry: quay.io - username: some_name - password: some_password - email: someone@example.com - asserts: - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-registry-creds - - equal: - path: metadata.annotations - value: - key1: value1 - key2: value2 - - - it: should pass with imagePullCredentials defined and global labels - documentIndex: *secretDoc - set: - global: - labels: - key1: value1 - key2: value2 - imagePullCredentials: - - name: registry-creds - enabled: true - content: - registry: quay.io - username: some_name - password: some_password - email: someone@example.com - asserts: - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-registry-creds - - equal: - path: metadata.labels - value: - app: common-test - app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: common-test - app.kubernetes.io/version: *appVer - helm-revision: "0" - helm.sh/chart: common-test-1.0.0 - release: RELEASE-NAME - key1: value1 - key2: value2 - - - it: should pass with imagePullCredentials defined and global labels from tpl - documentIndex: *secretDoc - set: - k1: value1 - k2: value2 - global: - labels: - key1: "{{ .Values.k1 }}" - key2: "{{ .Values.k2 }}" - imagePullCredentials: - - name: registry-creds - enabled: true - content: - registry: quay.io - username: some_name - password: some_password - email: someone@example.com - asserts: - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-registry-creds - - equal: - path: metadata.labels - value: - app: common-test - app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: common-test - app.kubernetes.io/version: *appVer - helm-revision: "0" - helm.sh/chart: common-test-1.0.0 - release: RELEASE-NAME - key1: value1 - key2: value2 diff --git a/.to_be_deleted/common-test/tests/initcontainers_in_deployment/additional_containers_in_deployment_test.yaml b/.to_be_deleted/common-test/tests/initcontainers_in_deployment/additional_containers_in_deployment_test.yaml deleted file mode 100644 index 659c822710..0000000000 --- a/.to_be_deleted/common-test/tests/initcontainers_in_deployment/additional_containers_in_deployment_test.yaml +++ /dev/null @@ -1,1326 +0,0 @@ -suite: additionalContainer in deployment test -templates: - - common.yaml -tests: - - it: should pass with default values - documentIndex: &deploymentDoc 0 - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Deployment - - - it: should pass with image defined in additional container - documentIndex: *deploymentDoc - set: - image: - repository: some-repo - tag: some-tag - pullPolicy: Always - additionalImage: - repository: some-repo-additional - tag: some-tag-additional - pullPolicy: Never - additionalContainers: - some-name: - imageSelector: additionalImage - pullPolicy: Never - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - image: some-repo:some-tag - imagePullPolicy: Always - - isSubset: - path: spec.template.spec.containers[1] - content: - image: some-repo-additional:some-tag-additional - imagePullPolicy: Never - - - it: should pass with image defined in multiple additional container - documentIndex: *deploymentDoc - set: - image: - repository: some-repo - tag: some-tag - pullPolicy: Always - additionalImage: - repository: some-repo-additional - tag: some-tag-additional - pullPolicy: Never - additionalImage2: - repository: some-repo-additional2 - tag: some-tag-additional2 - pullPolicy: IfNotPresent - additionalContainers: - some-name: - imageSelector: additionalImage - pullPolicy: Never - some-name2: - imageSelector: additionalImage2 - pullPolicy: Never - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - image: some-repo:some-tag - imagePullPolicy: Always - - isSubset: - path: spec.template.spec.containers[1] - content: - image: some-repo-additional:some-tag-additional - imagePullPolicy: Never - - isSubset: - path: spec.template.spec.containers[2] - content: - image: some-repo-additional2:some-tag-additional2 - imagePullPolicy: IfNotPresent - - - it: should pass with enabled false from tpl defined in additional container - documentIndex: *deploymentDoc - set: - flag: false - additionalContainers: - some-name: - enabled: "{{ .Values.flag }}" - tty: true - stdin: true - asserts: - - isNotNull: - path: spec.template.spec.containers[0] - - isNull: - path: spec.template.spec.containers[1] - - - it: should pass with enabled true from tpl defined in additional container - documentIndex: *deploymentDoc - set: - flag: true - additionalContainers: - some-name: - enabled: "{{ .Values.flag }}" - tty: true - stdin: true - asserts: - - isNotNull: - path: spec.template.spec.containers[0] - - isNotNull: - path: spec.template.spec.containers[1] - - - it: should pass with tty and stdin defined in additional container - documentIndex: *deploymentDoc - set: - additionalContainers: - some-name: - tty: true - stdin: true - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - tty: false - stdin: false - - isSubset: - path: spec.template.spec.containers[1] - content: - tty: true - stdin: true - - - it: should pass with command and args defined in additional container - documentIndex: *deploymentDoc - set: - port: 8080 - entrypoint: ./run.sh - additionalContainers: - some-name: - command: - - /bin/sh - - -c - - | - {{ .Values.entrypoint }} - args: - - --port - - "{{ .Values.port }}" - extraArgs: - - --data_dir - - /data - asserts: - - isNotSubset: - path: spec.template.spec.containers[0] - content: - command: - - /bin/sh - - -c - - | - ./run.sh - args: - - --port - - "8080" - - --data_dir - - /data - - isSubset: - path: spec.template.spec.containers[1] - content: - command: - - /bin/sh - - -c - - | - ./run.sh - args: - - --port - - "8080" - - --data_dir - - /data - - - it: should pass with termination defined in additional container - documentIndex: *deploymentDoc - set: - additionalContainers: - some-name: - termination: - messagePath: somePath - messagePolicy: File - asserts: - - isNotSubset: - path: spec.template.spec.containers[0] - content: - terminationMessagePath: somePath - terminationMessagePolicy: File - - isSubset: - path: spec.template.spec.containers[1] - content: - terminationMessagePath: somePath - terminationMessagePolicy: File - - - it: should pass with resources inherited from main container and modified in additional container - documentIndex: *deploymentDoc - set: - resources: - requests: - cpu: 25m - memory: 80Mi - additionalContainers: - some-name: - resources: - inherit: true - limits: - cpu: 1000m - memory: 1Gi - requests: - memory: 120Mi - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - resources: - limits: - cpu: 4000m - memory: 8Gi - requests: - cpu: 25m - memory: 80Mi - - isSubset: - path: spec.template.spec.containers[1] - content: - resources: - limits: - cpu: 1000m - memory: 1Gi - requests: - cpu: 25m - memory: 120Mi - - - it: should pass with resources defined in additional container - documentIndex: *deploymentDoc - set: - additionalContainers: - some-name: - nvidiaCaps: - - compute - scaleGPU: - gpu.intel.com/i915: "1" - resources: - limits: - cpu: 3000m - memory: 4Gi - requests: - cpu: 20m - memory: 100Mi - asserts: - - equal: - path: spec.template.spec.securityContext - value: - fsGroup: 568 - fsGroupChangePolicy: OnRootMismatch - supplementalGroups: - - 44 - - isSubset: - path: spec.template.spec.containers[0] - content: - resources: - limits: - cpu: 4000m - memory: 8Gi - requests: - cpu: 10m - memory: 50Mi - - isSubset: - path: spec.template.spec.containers[1] - content: - resources: - limits: - cpu: 3000m - memory: 4Gi - gpu.intel.com/i915: "1" - requests: - cpu: 20m - memory: 100Mi - - notContains: - path: spec.template.spec.containers[0].env - content: - name: NVIDIA_DRIVER_CAPABILITIES - value: all - - contains: - path: spec.template.spec.containers[1].env - content: - name: NVIDIA_DRIVER_CAPABILITIES - value: compute - - - it: should pass with envFrom defined in additional container - documentIndex: *deploymentDoc - set: - some_name: a_name - some_name2: a_name2 - additionalContainers: - some-name: - envFrom: - - configMapRef: - name: "{{ .Values.some_name }}" - - configMapRef: - name: "{{ .Values.some_name2 }}" - asserts: - - isNotSubset: - path: spec.template.spec.containers[0] - content: - envFrom: - - configMapRef: - name: a_name - - configMapRef: - name: a_name2 - - isSubset: - path: spec.template.spec.containers[1] - content: - envFrom: - - configMapRef: - name: a_name - - configMapRef: - name: a_name2 - - - it: should pass with env and envList defined in additional container - documentIndex: *deploymentDoc - set: - some_value: value - some_value2: value2 - some_value3: value3 - some_value4: value4 - additionalContainers: - some-name: - env: - var1: "{{ .Values.some_value }}" - var2: "{{ .Values.some_value2 }}" - var5: - secretKeyRef: - key: key - name: name - envList: - - name: var3 - value: "{{ .Values.some_value3 }}" - - name: var4 - value: "{{ .Values.some_value4 }}" - asserts: - - isNotSubset: - path: spec.template.spec.containers[0] - content: - env: - - name: var1 - value: value - - name: var2 - value: value2 - - name: var3 - value: value3 - - name: var4 - value: value4 - - isSubset: - path: spec.template.spec.containers[1] - content: - env: - - name: TZ - value: UTC - - name: UMASK - value: "002" - - name: UMASK_SET - value: "002" - - name: NVIDIA_VISIBLE_DEVICES - value: void - - name: S6_READ_ONLY_ROOT - value: "1" - - name: var1 - value: value - - name: var2 - value: value2 - - name: var5 - valueFrom: - secretKeyRef: - name: name - key: key - - name: var3 - value: value3 - - name: var4 - value: value4 - - - it: should pass with changed PUID/UMASK - documentIndex: *deploymentDoc - set: - additionalContainers: - some-name: - securityContext: - runAsUser: 0 - runAsNonRoot: false - UMASK: "003" - PUID: 1000 - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - env: - - name: TZ - value: UTC - - name: UMASK - value: "002" - - name: UMASK_SET - value: "002" - - name: NVIDIA_VISIBLE_DEVICES - value: void - - name: S6_READ_ONLY_ROOT - value: "1" - - isSubset: - path: spec.template.spec.containers[1] - content: - env: - - name: TZ - value: UTC - - name: UMASK - value: "003" - - name: UMASK_SET - value: "003" - - name: NVIDIA_VISIBLE_DEVICES - value: void - - name: PUID - value: "1000" - - name: USER_ID - value: "1000" - - name: UID - value: "1000" - - name: PGID - value: "568" - - name: GROUP_ID - value: "568" - - name: GID - value: "568" - - name: S6_READ_ONLY_ROOT - value: "1" - - - it: should pass with disabled injectFixedEnvs - documentIndex: *deploymentDoc - set: - additionalContainers: - some-name: - securityContext: - runAsUser: 0 - runAsNonRoot: false - injectFixedEnvs: false - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - env: - - name: TZ - value: UTC - - name: UMASK - value: "002" - - name: UMASK_SET - value: "002" - - name: NVIDIA_VISIBLE_DEVICES - value: void - - name: S6_READ_ONLY_ROOT - value: "1" - - isNull: - path: spec.template.spec.containers[0].e1v - - - it: should pass with lifecycle defined in additional container - documentIndex: *deploymentDoc - set: - additionalContainers: - some-name: - lifecycle: - postStart: - command: - - /bin/bash - - test1 - preStop: - command: - - /bin/bash - - test2 - asserts: - - isNull: - path: spec.template.spec.containers[0].lifecycle - - isSubset: - path: spec.template.spec.containers[1] - content: - lifecycle: - postStart: - exec: - command: - - /bin/bash - - test1 - preStop: - exec: - command: - - /bin/bash - - test2 - - - it: should fail with env trying to override fixedEnvs in additional container - set: - additionalContainers: - some-name: - env: - TZ: something - asserts: - - failedTemplate: - errorMessage: Environment Variable (TZ) on container (RELEASE-NAME-common-test-additional-some-name) is set more than once. [to (UTC) on (fixedEnv)] and [to (something) on (env)] - - - it: should fail with env trying to override configmap in additional container - set: - configmap: - some-confmap: - enabled: true - parseAsEnv: true - content: - TZ: something - additionalContainers: - some-name: - envFrom: - - configMapRef: - name: '{{ include "ix.v1.common.names.fullname" . }}-some-confmap' - asserts: - - failedTemplate: - errorMessage: Environment Variable (TZ) on container (RELEASE-NAME-common-test-additional-some-name) is set more than once. [to (UTC) on (fixedEnv)] and [to (something) on (configmap-RELEASE-NAME-common-test-some-confmap)] - - - it: should fail with env trying to override secret in additional container - set: - secret: - some-secret: - enabled: true - parseAsEnv: true - content: - TZ: something - additionalContainers: - some-name: - envFrom: - - secretRef: - name: '{{ include "ix.v1.common.names.fullname" . }}-some-secret' - asserts: - - failedTemplate: - errorMessage: Environment Variable (TZ) on container (RELEASE-NAME-common-test-additional-some-name) is set more than once. [to (UTC) on (fixedEnv)] and [to (something) on (secret-RELEASE-NAME-common-test-some-secret)] - - - it: should pass with securityContext inherited - documentIndex: *deploymentDoc - set: - securityContext: - runAsUser: 0 - runAsGroup: 0 - runAsNonRoot: false - readOnlyRootFilesystem: false - privileged: true - allowPrivilegeEscalation: true - capabilities: - add: - - Something - drop: - - Something_Else - additionalContainers: - some_container: - imageSelector: image - securityContext: - inherit: true - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - securityContext: - runAsUser: 0 - runAsGroup: 0 - runAsNonRoot: false - readOnlyRootFilesystem: false - privileged: true - allowPrivilegeEscalation: true - capabilities: - add: - - Something - drop: - - Something_Else - - isSubset: - path: spec.template.spec.containers[1] - content: - securityContext: - allowPrivilegeEscalation: true - capabilities: - add: - - Something - drop: - - Something_Else - privileged: true - readOnlyRootFilesystem: false - runAsGroup: 0 - runAsNonRoot: false - runAsUser: 0 - - - it: should pass with securityContext default - documentIndex: *deploymentDoc - set: - additionalContainers: - some_container: - imageSelector: image - securityContext: - inherit: true - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - securityContext: - allowPrivilegeEscalation: false - capabilities: - add: [] - drop: - - ALL - privileged: false - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - isSubset: - path: spec.template.spec.containers[1] - content: - securityContext: - allowPrivilegeEscalation: false - capabilities: - add: [] - drop: - - ALL - privileged: false - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - - it: should pass with port <=1024 defined in additional container - documentIndex: *deploymentDoc - set: - additionalContainers: - some_container: - ports: - - name: http - containerPort: 80 - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - securityContext: - allowPrivilegeEscalation: false - capabilities: - add: [] - drop: - - ALL - privileged: false - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - isSubset: - path: spec.template.spec.containers[1] - content: - securityContext: - allowPrivilegeEscalation: false - capabilities: - add: - - NET_BIND_SERVICE - drop: - - ALL - privileged: false - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - - it: should pass with deviceList defined in additionalContainer - documentIndex: *deploymentDoc - set: - additionalContainers: - some_container: - deviceList: - - enabled: true - mountPath: /host/dev/usb - hostPath: /dev/usb - securityContext: - inherit: true - asserts: - - equal: - path: spec.template.spec.securityContext - value: - fsGroup: 568 - fsGroupChangePolicy: OnRootMismatch - supplementalGroups: - - 5 - - 10 - - 20 - - 24 - - isSubset: - path: spec.template.spec.containers[0] - content: - securityContext: - allowPrivilegeEscalation: false - capabilities: - add: [] - drop: - - ALL - privileged: false - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - isSubset: - path: spec.template.spec.containers[1] - content: - securityContext: - allowPrivilegeEscalation: true - capabilities: - add: [] - drop: - - ALL - privileged: true - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - - it: should pass with deviceList and scaleGPU defined in additionalContainer - documentIndex: *deploymentDoc - set: - additionalContainers: - some_container: - scaleGPU: - nvidia: something - deviceList: - - enabled: true - mountPath: /host/dev/usb - hostPath: /dev/usb - securityContext: - inherit: true - asserts: - - equal: - path: spec.template.spec.securityContext - value: - fsGroup: 568 - fsGroupChangePolicy: OnRootMismatch - supplementalGroups: - - 5 - - 10 - - 20 - - 24 - - 44 - - isSubset: - path: spec.template.spec.containers[0] - content: - securityContext: - allowPrivilegeEscalation: false - capabilities: - add: [] - drop: - - ALL - privileged: false - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - isSubset: - path: spec.template.spec.containers[1] - content: - securityContext: - allowPrivilegeEscalation: true - capabilities: - add: [] - drop: - - ALL - privileged: true - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - - it: should pass with securityContext changed - documentIndex: *deploymentDoc - set: - additionalContainers: - some_container: - imageSelector: image - securityContext: - runAsUser: 0 - runAsGroup: 0 - runAsNonRoot: false - readOnlyRootFilesystem: false - privileged: true - allowPrivilegeEscalation: true - capabilities: - add: - - Something - drop: - - Something_Else - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - securityContext: - allowPrivilegeEscalation: false - capabilities: - add: [] - drop: - - ALL - privileged: false - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - isSubset: - path: spec.template.spec.containers[1] - content: - securityContext: - allowPrivilegeEscalation: true - capabilities: - add: - - Something - drop: - - Something_Else - privileged: true - readOnlyRootFilesystem: false - runAsGroup: 0 - runAsNonRoot: false - runAsUser: 0 - - - it: should pass with securityContext with some values changed - documentIndex: *deploymentDoc - set: - additionalContainers: - some_container: - imageSelector: image - securityContext: - runAsUser: 0 - runAsGroup: 0 - runAsNonRoot: false - capabilities: - add: - - Something - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - securityContext: - allowPrivilegeEscalation: false - capabilities: - add: [] - drop: - - ALL - privileged: false - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - isSubset: - path: spec.template.spec.containers[1] - content: - securityContext: - allowPrivilegeEscalation: false - capabilities: - add: - - Something - drop: - - ALL - privileged: false - readOnlyRootFilesystem: true - runAsGroup: 0 - runAsNonRoot: false - runAsUser: 0 - - - it: should pass with securityContext with inherit and at least one value changed - documentIndex: *deploymentDoc - set: - securityContext: - privileged: true - allowPrivilegeEscalation: true - capabilities: - drop: - - something_else - additionalContainers: - some_container: - imageSelector: image - securityContext: - inherit: true - runAsNonRoot: false - runAsUser: 0 - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - securityContext: - allowPrivilegeEscalation: true - capabilities: - add: [] - drop: - - something_else - privileged: true - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - isSubset: - path: spec.template.spec.containers[1] - content: - securityContext: - allowPrivilegeEscalation: true - capabilities: - add: [] - drop: - - something_else - privileged: true - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: false - runAsUser: 0 - - - it: should fail with probe type set to auto in additional container - set: - additionalContainers: - some-name: - probes: - liveness: - enabled: true - type: auto - asserts: - - failedTemplate: - errorMessage: probe type in probe (liveness) in (RELEASE-NAME-common-test-additional-some-name) container, is only supported for the main container and only if there is at least 1 port enabled - - - it: should pass with probes defined in additional container - documentIndex: *deploymentDoc - set: - additionalContainers: - some-name: - probes: - liveness: - enabled: true - type: tcp - port: 3000 - readiness: - enabled: true - type: http - port: 3000 - path: / - startup: - enabled: true - type: exec - command: - - /bin/bash - - -c - - | - echo "start!" - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - livenessProbe: - httpGet: - path: / - scheme: HTTP - port: 65535 - initialDelaySeconds: 10 - failureThreshold: 5 - timeoutSeconds: 5 - periodSeconds: 10 - readinessProbe: - httpGet: - path: / - scheme: HTTP - port: 65535 - initialDelaySeconds: 10 - failureThreshold: 5 - timeoutSeconds: 5 - periodSeconds: 10 - startupProbe: - httpGet: - path: / - scheme: HTTP - port: 65535 - initialDelaySeconds: 10 - failureThreshold: 60 - timeoutSeconds: 2 - periodSeconds: 5 - - isSubset: - path: spec.template.spec.containers[1] - content: - livenessProbe: - tcpSocket: - port: 3000 - initialDelaySeconds: 10 - failureThreshold: 5 - timeoutSeconds: 5 - periodSeconds: 10 - readinessProbe: - httpGet: - path: / - scheme: HTTP - port: 3000 - initialDelaySeconds: 10 - failureThreshold: 5 - timeoutSeconds: 5 - periodSeconds: 10 - startupProbe: - exec: - command: - - /bin/bash - - -c - - | - echo "start!" - initialDelaySeconds: 10 - failureThreshold: 60 - timeoutSeconds: 2 - periodSeconds: 5 - - - it: should fail with invalid protocol in ports in additional container - set: - additionalContainers: - some-name: - ports: - - containerPort: 5678 - protocol: invalid-proto - name: tcp-port - asserts: - - failedTemplate: - errorMessage: Invalid (invalid-proto) in port (tcp-port) in (RELEASE-NAME-common-test-additional-some-name) container. Valid protocols are TCP and UDP. - - - it: should fail without name in ports in additional container - set: - additionalContainers: - some-name: - ports: - - containerPort: 5678 - protocol: TCP - name: "" - asserts: - - failedTemplate: - errorMessage: is required in all in (RELEASE-NAME-common-test-additional-some-name) container. - - - it: should fail without containerPort in ports in additional container - set: - additionalContainers: - some-name: - ports: - - containerPort: "" - name: tcp-port - asserts: - - failedTemplate: - errorMessage: is required in port (tcp-port) in (RELEASE-NAME-common-test-additional-some-name) container. - - - it: should fail with non-int containerPort in ports in additional container - set: - additionalContainers: - some-name: - ports: - - containerPort: not-int - name: tcp-port - asserts: - - failedTemplate: - errorMessage: Invalid (not-int) in port (tcp-port) in (RELEASE-NAME-common-test-additional-some-name) container. Must be an int. - - - it: should fail with non-int hostPort in ports in additional container - set: - additionalContainers: - some-name: - ports: - - containerPort: 1234 - hostPort: not-int - name: tcp-port - asserts: - - failedTemplate: - errorMessage: Invalid (not-int) in port (tcp-port) in (RELEASE-NAME-common-test-additional-some-name) container. Must be an int. - - - it: should pass without protocol in ports in additional container - documentIndex: *deploymentDoc - set: - additionalContainers: - some-name: - ports: - - containerPort: 5678 - name: tcp-port - asserts: - - isSubset: - path: spec.template.spec.containers[1] - content: - ports: - - containerPort: 5678 - protocol: TCP - name: tcp-port - - - it: should pass with ports defined in additional container - documentIndex: *deploymentDoc - set: - additionalContainers: - some-name: - ports: - - containerPort: 5678 - protocol: TCP - name: tcp-port - - containerPort: 1234 - protocol: UDP - name: udp-port - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - ports: - - containerPort: 65535 - protocol: TCP - name: main - - isSubset: - path: spec.template.spec.containers[1] - content: - ports: - - containerPort: 5678 - protocol: TCP - name: tcp-port - - containerPort: 1234 - protocol: UDP - name: udp-port - - - it: should fail without trying to mount a non existent volume in volumeMounts defined in additional container - set: - additionalContainers: - some-name: - volumeMounts: - - name: some-volume - mountPath: /some/path - asserts: - - failedTemplate: - errorMessage: You are trying to mount a volume that does not exist (some-volume). Please define the volume in . - - - it: should fail without name in volumeMounts defined in additional container - set: - additionalContainers: - some-name: - volumeMounts: - - name: - mountPath: /some/path - readOnly: false - subPath: /some/sub/path - asserts: - - failedTemplate: - errorMessage: is required in volumeMounts in init/system/install/upgrade/additional containers. - - - it: should pass with volumeMounts defined in additional container - documentIndex: *deploymentDoc - set: - persistence: - some-volume: - enabled: true - noMount: true - type: emptyDir - some-other-volume: - enabled: true - noMount: true - type: emptyDir - additionalContainers: - some-name: - volumeMounts: - - name: some-volume - mountPath: /some/path - readOnly: false - subPath: /some/sub/path - - name: some-other-volume - mountPath: /some/other/path - readOnly: false - subPath: /some/other/sub/path - asserts: - - notContains: - path: spec.template.spec.containers[0].volumeMounts - content: - name: some-volume - - notContains: - path: spec.template.spec.containers[0].volumeMounts - content: - name: some-other-volume - - contains: - path: spec.template.spec.containers[1].volumeMounts - content: - name: some-volume - mountPath: /some/path - readOnly: false - subPath: /some/sub/path - - contains: - path: spec.template.spec.containers[1].volumeMounts - content: - name: some-other-volume - mountPath: /some/other/path - readOnly: false - subPath: /some/other/sub/path - - - it: should pass with volumeMounts inherit all in additional container - documentIndex: *deploymentDoc - set: - persistence: - some-volume: - enabled: true - noMount: true - mountPath: /some/path - type: emptyDir - some-other-volume: - enabled: true - noMount: true - mountPath: /some/other/path - type: emptyDir - additionalContainers: - some-name: - volumeMounts: - - inherit: all - asserts: - - notContains: - path: spec.template.spec.containers[0].volumeMounts - content: - name: some-volume - - notContains: - path: spec.template.spec.containers[0].volumeMounts - content: - name: some-other-volume - - contains: - path: spec.template.spec.containers[1].volumeMounts - content: - name: some-other-volume - mountPath: /some/other/path - - contains: - path: spec.template.spec.containers[1].volumeMounts - content: - name: some-volume - mountPath: /some/path - - - it: should pass with volumeMounts inherit skipNoMount in additional container - documentIndex: *deploymentDoc - set: - persistence: - some-volume: - enabled: true - noMount: true - mountPath: /some/path - type: emptyDir - some-other-volume: - enabled: true - type: emptyDir - mountPath: /some/other/path - additionalContainers: - some-name: - volumeMounts: - - inherit: skipNoMount - asserts: - - contains: - path: spec.template.spec.containers[0].volumeMounts - content: - mountPath: /some/other/path - name: some-other-volume - - contains: - path: spec.template.spec.containers[1].volumeMounts - content: - name: some-other-volume - mountPath: /some/other/path - - - it: should pass with deviceList and volumeMounts defined in additional container - documentIndex: *deploymentDoc - set: - deviceList: - - enabled: true - type: hostPath - mountPath: /host/dev/something - hostPath: /dev/something - persistence: - some-volume: - enabled: true - noMount: true - type: emptyDir - some-other-volume: - enabled: true - noMount: true - type: emptyDir - additionalContainers: - some-name: - deviceList: - - enabled: true - type: hostPath - mountPath: /host/dev/usb - hostPath: /dev/usb - - enabled: true - type: hostPath - mountPath: /host/dev/serial - hostPath: /dev/serial - volumeMounts: - - name: some-volume - mountPath: /some/path - readOnly: false - subPath: /some/sub/path - - name: some-other-volume - mountPath: /some/other/path - readOnly: false - subPath: /some/other/sub/path - asserts: - - contains: - path: spec.template.spec.containers[0].volumeMounts - content: - name: device-0 - mountPath: /host/dev/something - - contains: - path: spec.template.spec.containers[1].volumeMounts - content: - name: some-volume - mountPath: /some/path - readOnly: false - subPath: /some/sub/path - - contains: - path: spec.template.spec.containers[1].volumeMounts - content: - name: some-other-volume - mountPath: /some/other/path - readOnly: false - subPath: /some/other/sub/path - - contains: - path: spec.template.spec.containers[1].volumeMounts - content: - name: device-some-name-0 - mountPath: /host/dev/usb - - contains: - path: spec.template.spec.containers[1].volumeMounts - content: - name: device-some-name-1 - mountPath: /host/dev/serial - - - it: should pass with disabled additional container from tpl - documentIndex: *deploymentDoc - set: - flag: false - additionalContainers: - some-name: - enabled: "{{ .Values.flag }}" - asserts: - - isNull: - path: spec.template.spec.initContainers diff --git a/.to_be_deleted/common-test/tests/initcontainers_in_deployment/init_containers_in_deployment_install_test.yaml b/.to_be_deleted/common-test/tests/initcontainers_in_deployment/init_containers_in_deployment_install_test.yaml deleted file mode 100644 index 37dda2c5ae..0000000000 --- a/.to_be_deleted/common-test/tests/initcontainers_in_deployment/init_containers_in_deployment_install_test.yaml +++ /dev/null @@ -1,1225 +0,0 @@ -suite: initContainer in deployment test (onInstall) -templates: - - common.yaml -tests: - - it: should pass with default values - documentIndex: &deploymentDoc 0 - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Deployment - - - it: should pass with image defined in init container - documentIndex: *deploymentDoc - set: - image: - repository: some-repo - tag: some-tag - pullPolicy: Always - initImage: - repository: some-repo-init - tag: some-tag-init - pullPolicy: Never - initContainers: - some-name: - imageSelector: initImage - pullPolicy: Never - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - image: some-repo:some-tag - imagePullPolicy: Always - - isSubset: - path: spec.template.spec.initContainers[0] - content: - image: some-repo-init:some-tag-init - imagePullPolicy: Never - - - it: should pass with image defined in multiple init container - documentIndex: *deploymentDoc - set: - image: - repository: some-repo - tag: some-tag - pullPolicy: Always - initImage: - repository: some-repo-init - tag: some-tag-init - pullPolicy: Never - initImage2: - repository: some-repo-init2 - tag: some-tag-init2 - pullPolicy: IfNotPresent - initContainers: - some-name: - imageSelector: initImage - pullPolicy: Never - some-name2: - imageSelector: initImage2 - pullPolicy: Never - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - image: some-repo:some-tag - imagePullPolicy: Always - - isSubset: - path: spec.template.spec.initContainers[0] - content: - image: some-repo-init:some-tag-init - imagePullPolicy: Never - - isSubset: - path: spec.template.spec.initContainers[1] - content: - image: some-repo-init2:some-tag-init2 - imagePullPolicy: IfNotPresent - - - it: should pass with tty and stdin defined in init container - documentIndex: *deploymentDoc - set: - initContainers: - some-name: - tty: true - stdin: true - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - tty: false - stdin: false - - isSubset: - path: spec.template.spec.initContainers[0] - content: - tty: true - stdin: true - - - it: should pass with enabled false from tpl defined in init container - documentIndex: *deploymentDoc - set: - flag: false - initContainers: - some-name: - enabled: "{{ .Values.flag }}" - tty: true - stdin: true - asserts: - - isNotNull: - path: spec.template.spec.containers[0] - - isNull: - path: spec.template.spec.initContainers - - - it: should pass with enabled true from tpl defined in init container - documentIndex: *deploymentDoc - set: - flag: true - initContainers: - some-name: - enabled: "{{ .Values.flag }}" - tty: true - stdin: true - asserts: - - isNotNull: - path: spec.template.spec.containers[0] - - isNotNull: - path: spec.template.spec.initContainers - - - it: should pass with command and args defined in init container - documentIndex: *deploymentDoc - set: - port: 8080 - entrypoint: ./run.sh - initContainers: - some-name: - command: - - /bin/sh - - -c - - | - {{ .Values.entrypoint }} - args: - - --port - - "{{ .Values.port }}" - extraArgs: - - --data_dir - - /data - asserts: - - isNotSubset: - path: spec.template.spec.containers[0] - content: - command: - - /bin/sh - - -c - - | - ./run.sh - args: - - --port - - "8080" - - --data_dir - - /data - - isSubset: - path: spec.template.spec.initContainers[0] - content: - command: - - /bin/sh - - -c - - | - ./run.sh - args: - - --port - - "8080" - - --data_dir - - /data - - - it: should pass with termination defined in init container - documentIndex: *deploymentDoc - set: - initContainers: - some-name: - termination: - messagePath: somePath - messagePolicy: File - asserts: - - isNotSubset: - path: spec.template.spec.containers[0] - content: - terminationMessagePath: somePath - terminationMessagePolicy: File - - isSubset: - path: spec.template.spec.initContainers[0] - content: - terminationMessagePath: somePath - terminationMessagePolicy: File - - - it: should pass with resources inherited from main container and modified in init container - documentIndex: *deploymentDoc - set: - resources: - requests: - cpu: 25m - memory: 80Mi - initContainers: - some-name: - resources: - inherit: true - limits: - cpu: 1000m - memory: 1Gi - requests: - memory: 120Mi - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - resources: - limits: - cpu: 4000m - memory: 8Gi - requests: - cpu: 25m - memory: 80Mi - - isSubset: - path: spec.template.spec.initContainers[0] - content: - resources: - limits: - cpu: 1000m - memory: 1Gi - requests: - cpu: 25m - memory: 120Mi - - - it: should pass with resources defined in init container - documentIndex: *deploymentDoc - set: - initContainers: - some-name: - nvidiaCaps: - - compute - scaleGPU: - gpu.intel.com/i915: "1" - resources: - limits: - cpu: 3000m - memory: 4Gi - requests: - cpu: 20m - memory: 100Mi - asserts: - - equal: - path: spec.template.spec.securityContext - value: - fsGroup: 568 - fsGroupChangePolicy: OnRootMismatch - supplementalGroups: - - 44 - - isSubset: - path: spec.template.spec.containers[0] - content: - resources: - limits: - cpu: 4000m - memory: 8Gi - requests: - cpu: 10m - memory: 50Mi - - isSubset: - path: spec.template.spec.initContainers[0] - content: - resources: - limits: - cpu: 3000m - memory: 4Gi - gpu.intel.com/i915: "1" - requests: - cpu: 20m - memory: 100Mi - - notContains: - path: spec.template.spec.containers[0].env - content: - name: NVIDIA_DRIVER_CAPABILITIES - value: all - - contains: - path: spec.template.spec.initContainers[0].env - content: - name: NVIDIA_DRIVER_CAPABILITIES - value: compute - - - it: should pass with envFrom defined in init container - documentIndex: *deploymentDoc - set: - some_name: a_name - some_name2: a_name2 - initContainers: - some-name: - envFrom: - - configMapRef: - name: "{{ .Values.some_name }}" - - configMapRef: - name: "{{ .Values.some_name2 }}" - asserts: - - isNotSubset: - path: spec.template.spec.containers[0] - content: - envFrom: - - configMapRef: - name: a_name - - configMapRef: - name: a_name2 - - isSubset: - path: spec.template.spec.initContainers[0] - content: - envFrom: - - configMapRef: - name: a_name - - configMapRef: - name: a_name2 - - - it: should pass with env and envList defined in init container - documentIndex: *deploymentDoc - set: - some_value: value - some_value2: value2 - some_value3: value3 - some_value4: value4 - initContainers: - some-name: - env: - var1: "{{ .Values.some_value }}" - var2: "{{ .Values.some_value2 }}" - var5: - secretKeyRef: - key: key - name: name - envList: - - name: var3 - value: "{{ .Values.some_value3 }}" - - name: var4 - value: "{{ .Values.some_value4 }}" - asserts: - - isNotSubset: - path: spec.template.spec.containers[0] - content: - env: - - name: var1 - value: value - - name: var2 - value: value2 - - name: var3 - value: value3 - - name: var4 - value: value4 - - isSubset: - path: spec.template.spec.initContainers[0] - content: - env: - - name: TZ - value: UTC - - name: UMASK - value: "002" - - name: UMASK_SET - value: "002" - - name: NVIDIA_VISIBLE_DEVICES - value: void - - name: S6_READ_ONLY_ROOT - value: "1" - - name: var1 - value: value - - name: var2 - value: value2 - - name: var5 - valueFrom: - secretKeyRef: - name: name - key: key - - name: var3 - value: value3 - - name: var4 - value: value4 - - - it: should pass with changed PUID/UMASK - documentIndex: *deploymentDoc - set: - initContainers: - some-name: - securityContext: - runAsUser: 0 - runAsNonRoot: false - UMASK: "003" - PUID: 1000 - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - env: - - name: TZ - value: UTC - - name: UMASK - value: "002" - - name: UMASK_SET - value: "002" - - name: NVIDIA_VISIBLE_DEVICES - value: void - - name: S6_READ_ONLY_ROOT - value: "1" - - isSubset: - path: spec.template.spec.initContainers[0] - content: - env: - - name: TZ - value: UTC - - name: UMASK - value: "003" - - name: UMASK_SET - value: "003" - - name: NVIDIA_VISIBLE_DEVICES - value: void - - name: PUID - value: "1000" - - name: USER_ID - value: "1000" - - name: UID - value: "1000" - - name: PGID - value: "568" - - name: GROUP_ID - value: "568" - - name: GID - value: "568" - - name: S6_READ_ONLY_ROOT - value: "1" - - - it: should pass with disabled injectFixedEnvs - documentIndex: *deploymentDoc - set: - initContainers: - some-name: - securityContext: - runAsUser: 0 - runAsNonRoot: false - injectFixedEnvs: false - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - env: - - name: TZ - value: UTC - - name: UMASK - value: "002" - - name: UMASK_SET - value: "002" - - name: NVIDIA_VISIBLE_DEVICES - value: void - - name: S6_READ_ONLY_ROOT - value: "1" - - isNull: - path: spec.template.spec.initContainers[0].env - - - it: should fail with lifecycle defined in init container - set: - initContainers: - some-name: - lifecycle: - asserts: - - failedTemplate: - errorMessage: Init/System/Install/Upgrade/(Cron)Job Container (RELEASE-NAME-common-test-init-some-name) do not support lifecycle hooks - - - it: should fail with env trying to override fixedEnvs in init container - set: - initContainers: - some-name: - env: - TZ: something - asserts: - - failedTemplate: - errorMessage: Environment Variable (TZ) on container (RELEASE-NAME-common-test-init-some-name) is set more than once. [to (UTC) on (fixedEnv)] and [to (something) on (env)] - - - it: should fail with env trying to override configmap in init container - set: - configmap: - some-confmap: - enabled: true - parseAsEnv: true - content: - TZ: something - initContainers: - some-name: - envFrom: - - configMapRef: - name: '{{ include "ix.v1.common.names.fullname" . }}-some-confmap' - asserts: - - failedTemplate: - errorMessage: Environment Variable (TZ) on container (RELEASE-NAME-common-test-init-some-name) is set more than once. [to (UTC) on (fixedEnv)] and [to (something) on (configmap-RELEASE-NAME-common-test-some-confmap)] - - - it: should fail with env trying to override secret in init container - set: - secret: - some-secret: - enabled: true - parseAsEnv: true - content: - TZ: something - initContainers: - some-name: - envFrom: - - secretRef: - name: '{{ include "ix.v1.common.names.fullname" . }}-some-secret' - asserts: - - failedTemplate: - errorMessage: Environment Variable (TZ) on container (RELEASE-NAME-common-test-init-some-name) is set more than once. [to (UTC) on (fixedEnv)] and [to (something) on (secret-RELEASE-NAME-common-test-some-secret)] - - - it: should pass with securityContext inherited - documentIndex: *deploymentDoc - set: - securityContext: - runAsUser: 0 - runAsGroup: 0 - runAsNonRoot: false - readOnlyRootFilesystem: false - privileged: true - allowPrivilegeEscalation: true - capabilities: - add: - - Something - drop: - - Something_Else - initContainers: - some_container: - imageSelector: image - securityContext: - inherit: true - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - securityContext: - runAsUser: 0 - runAsGroup: 0 - runAsNonRoot: false - readOnlyRootFilesystem: false - privileged: true - allowPrivilegeEscalation: true - capabilities: - add: - - Something - drop: - - Something_Else - - isSubset: - path: spec.template.spec.initContainers[0] - content: - securityContext: - allowPrivilegeEscalation: true - capabilities: - add: - - Something - drop: - - Something_Else - privileged: true - readOnlyRootFilesystem: false - runAsGroup: 0 - runAsNonRoot: false - runAsUser: 0 - - - it: should pass with deviceList defined in init container - documentIndex: *deploymentDoc - set: - initContainers: - some_container: - deviceList: - - enabled: true - mountPath: /host/dev/usb - hostPath: /dev/usb - securityContext: - inherit: true - asserts: - - equal: - path: spec.template.spec.securityContext - value: - fsGroup: 568 - fsGroupChangePolicy: OnRootMismatch - supplementalGroups: - - 5 - - 10 - - 20 - - 24 - - isSubset: - path: spec.template.spec.containers[0] - content: - securityContext: - allowPrivilegeEscalation: false - capabilities: - add: [] - drop: - - ALL - privileged: false - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - isSubset: - path: spec.template.spec.initContainers[0] - content: - securityContext: - allowPrivilegeEscalation: true - capabilities: - add: [] - drop: - - ALL - privileged: true - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - - it: should pass with deviceList and scaleGPU defined in init container - documentIndex: *deploymentDoc - set: - initContainers: - some_container: - scaleGPU: - nvidia: something - deviceList: - - enabled: true - mountPath: /host/dev/usb - hostPath: /dev/usb - securityContext: - inherit: true - asserts: - - equal: - path: spec.template.spec.securityContext - value: - fsGroup: 568 - fsGroupChangePolicy: OnRootMismatch - supplementalGroups: - - 5 - - 10 - - 20 - - 24 - - 44 - - isSubset: - path: spec.template.spec.containers[0] - content: - securityContext: - allowPrivilegeEscalation: false - capabilities: - add: [] - drop: - - ALL - privileged: false - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - isSubset: - path: spec.template.spec.initContainers[0] - content: - securityContext: - allowPrivilegeEscalation: true - capabilities: - add: [] - drop: - - ALL - privileged: true - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - - it: should pass with port <=1024 defined in init container - documentIndex: *deploymentDoc - set: - initContainers: - some_container: - ports: - - name: http - containerPort: 80 - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - securityContext: - allowPrivilegeEscalation: false - capabilities: - add: [] - drop: - - ALL - privileged: false - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - isSubset: - path: spec.template.spec.initContainers[0] - content: - securityContext: - allowPrivilegeEscalation: false - capabilities: - add: - - NET_BIND_SERVICE - drop: - - ALL - privileged: false - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - - it: should pass with securityContext default - documentIndex: *deploymentDoc - set: - initContainers: - some_container: - imageSelector: image - securityContext: - inherit: true - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - securityContext: - allowPrivilegeEscalation: false - capabilities: - add: [] - drop: - - ALL - privileged: false - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - isSubset: - path: spec.template.spec.initContainers[0] - content: - securityContext: - allowPrivilegeEscalation: false - capabilities: - add: [] - drop: - - ALL - privileged: false - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - - it: should pass with securityContext changed - documentIndex: *deploymentDoc - set: - initContainers: - some_container: - imageSelector: image - securityContext: - runAsUser: 0 - runAsGroup: 0 - runAsNonRoot: false - readOnlyRootFilesystem: false - privileged: true - allowPrivilegeEscalation: true - capabilities: - add: - - Something - drop: - - Something_Else - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - securityContext: - allowPrivilegeEscalation: false - capabilities: - add: [] - drop: - - ALL - privileged: false - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - isSubset: - path: spec.template.spec.initContainers[0] - content: - securityContext: - allowPrivilegeEscalation: true - capabilities: - add: - - Something - drop: - - Something_Else - privileged: true - readOnlyRootFilesystem: false - runAsGroup: 0 - runAsNonRoot: false - runAsUser: 0 - - - it: should pass with securityContext with some values changed - documentIndex: *deploymentDoc - set: - initContainers: - some_container: - imageSelector: image - securityContext: - runAsUser: 0 - runAsGroup: 0 - runAsNonRoot: false - capabilities: - add: - - Something - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - securityContext: - allowPrivilegeEscalation: false - capabilities: - add: [] - drop: - - ALL - privileged: false - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - isSubset: - path: spec.template.spec.initContainers[0] - content: - securityContext: - allowPrivilegeEscalation: false - capabilities: - add: - - Something - drop: - - ALL - privileged: false - readOnlyRootFilesystem: true - runAsGroup: 0 - runAsNonRoot: false - runAsUser: 0 - - - it: should pass with securityContext with inherit and at least one value changed - documentIndex: *deploymentDoc - set: - securityContext: - privileged: true - allowPrivilegeEscalation: true - capabilities: - drop: - - something_else - initContainers: - some_container: - imageSelector: image - securityContext: - inherit: true - runAsNonRoot: false - runAsUser: 0 - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - securityContext: - allowPrivilegeEscalation: true - capabilities: - add: [] - drop: - - something_else - privileged: true - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - isSubset: - path: spec.template.spec.initContainers[0] - content: - securityContext: - allowPrivilegeEscalation: true - capabilities: - add: [] - drop: - - something_else - privileged: true - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: false - runAsUser: 0 - - - it: should fail with probes in init container - set: - initContainers: - some-name: - probes: - liveness: - enabled: true - asserts: - - failedTemplate: - errorMessage: Init/System/Install/Upgrade/(Cron)Job Container (RELEASE-NAME-common-test-init-some-name) do not support probes - - - it: should fail with invalid protocol in ports in init container - set: - initContainers: - some-name: - ports: - - containerPort: 5678 - protocol: invalid-proto - name: tcp-port - asserts: - - failedTemplate: - errorMessage: Invalid (invalid-proto) in port (tcp-port) in (RELEASE-NAME-common-test-init-some-name) container. Valid protocols are TCP and UDP. - - - it: should fail without name in ports in init container - set: - initContainers: - some-name: - ports: - - containerPort: 5678 - protocol: TCP - name: "" - asserts: - - failedTemplate: - errorMessage: is required in all in (RELEASE-NAME-common-test-init-some-name) container. - - - it: should fail without containerPort in ports in init container - set: - initContainers: - some-name: - ports: - - containerPort: "" - name: tcp-port - asserts: - - failedTemplate: - errorMessage: is required in port (tcp-port) in (RELEASE-NAME-common-test-init-some-name) container. - - - it: should fail with non-int containerPort in ports in init container - set: - initContainers: - some-name: - ports: - - containerPort: not-int - name: tcp-port - asserts: - - failedTemplate: - errorMessage: Invalid (not-int) in port (tcp-port) in (RELEASE-NAME-common-test-init-some-name) container. Must be an int. - - - it: should fail with non-int hostPort in ports in init container - set: - initContainers: - some-name: - ports: - - containerPort: 1234 - hostPort: not-int - name: tcp-port - asserts: - - failedTemplate: - errorMessage: Invalid (not-int) in port (tcp-port) in (RELEASE-NAME-common-test-init-some-name) container. Must be an int. - - - it: should pass without protocol in ports in init container - documentIndex: *deploymentDoc - set: - initContainers: - some-name: - ports: - - containerPort: 5678 - name: tcp-port - asserts: - - isSubset: - path: spec.template.spec.initContainers[0] - content: - ports: - - containerPort: 5678 - protocol: TCP - name: tcp-port - - - it: should pass with ports defined in init container - documentIndex: *deploymentDoc - set: - initContainers: - some-name: - ports: - - containerPort: 5678 - protocol: TCP - name: tcp-port - - containerPort: 1234 - protocol: UDP - name: udp-port - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - ports: - - containerPort: 65535 - protocol: TCP - name: main - - isSubset: - path: spec.template.spec.initContainers[0] - content: - ports: - - containerPort: 5678 - protocol: TCP - name: tcp-port - - containerPort: 1234 - protocol: UDP - name: udp-port - - - it: should fail without trying to mount a non existent volume in volumeMounts defined in init container - set: - initContainers: - some-name: - volumeMounts: - - name: some-volume - mountPath: /some/path - asserts: - - failedTemplate: - errorMessage: You are trying to mount a volume that does not exist (some-volume). Please define the volume in . - - - it: should fail without name in volumeMounts defined in init container - set: - initContainers: - some-name: - volumeMounts: - - name: - mountPath: /some/path - readOnly: false - subPath: /some/sub/path - asserts: - - failedTemplate: - errorMessage: is required in volumeMounts in init/system/install/upgrade/additional containers. - - - it: should pass with volumeMounts defined in init container - documentIndex: *deploymentDoc - set: - persistence: - some-volume: - enabled: true - noMount: true - type: emptyDir - some-other-volume: - enabled: true - noMount: true - type: emptyDir - initContainers: - some-name: - volumeMounts: - - name: some-volume - mountPath: /some/path - readOnly: false - subPath: /some/sub/path - - name: some-other-volume - mountPath: /some/other/path - readOnly: false - subPath: /some/other/sub/path - asserts: - - notContains: - path: spec.template.spec.containers[0].volumeMounts - content: - name: some-volume - - notContains: - path: spec.template.spec.containers[0].volumeMounts - content: - name: some-other-volume - - contains: - path: spec.template.spec.initContainers[0].volumeMounts - content: - name: some-volume - mountPath: /some/path - readOnly: false - subPath: /some/sub/path - - contains: - path: spec.template.spec.initContainers[0].volumeMounts - content: - name: some-other-volume - mountPath: /some/other/path - readOnly: false - subPath: /some/other/sub/path - - - it: should pass with volumeMounts inherit all in init container - documentIndex: *deploymentDoc - set: - persistence: - some-volume: - enabled: true - noMount: true - mountPath: /some/path - type: emptyDir - some-other-volume: - enabled: true - noMount: true - mountPath: /some/other/path - type: emptyDir - initContainers: - some-name: - volumeMounts: - - inherit: all - asserts: - - notContains: - path: spec.template.spec.containers[0].volumeMounts - content: - name: some-volume - - notContains: - path: spec.template.spec.containers[0].volumeMounts - content: - name: some-other-volume - - contains: - path: spec.template.spec.initContainers[0].volumeMounts - content: - name: some-other-volume - mountPath: /some/other/path - - contains: - path: spec.template.spec.initContainers[0].volumeMounts - content: - name: some-volume - mountPath: /some/path - - - it: should pass with volumeMounts inherit skipNoMount in init container - documentIndex: *deploymentDoc - set: - persistence: - some-volume: - enabled: true - noMount: true - mountPath: /some/path - type: emptyDir - some-other-volume: - enabled: true - type: emptyDir - mountPath: /some/other/path - initContainers: - some-name: - volumeMounts: - - inherit: skipNoMount - asserts: - - contains: - path: spec.template.spec.containers[0].volumeMounts - content: - mountPath: /some/other/path - name: some-other-volume - - contains: - path: spec.template.spec.initContainers[0].volumeMounts - content: - name: some-other-volume - mountPath: /some/other/path - - - it: should pass with deviceList and volumeMounts defined in init container - documentIndex: *deploymentDoc - set: - deviceList: - - enabled: true - type: hostPath - mountPath: /host/dev/something - hostPath: /dev/something - persistence: - some-volume: - enabled: true - noMount: true - type: emptyDir - some-other-volume: - enabled: true - noMount: true - type: emptyDir - initContainers: - some-name: - deviceList: - - enabled: true - type: hostPath - mountPath: /host/dev/usb - hostPath: /dev/usb - - enabled: true - type: hostPath - mountPath: /host/dev/serial - hostPath: /dev/serial - volumeMounts: - - name: some-volume - mountPath: /some/path - readOnly: false - subPath: /some/sub/path - - name: some-other-volume - mountPath: /some/other/path - readOnly: false - subPath: /some/other/sub/path - asserts: - - contains: - path: spec.template.spec.containers[0].volumeMounts - content: - name: device-0 - mountPath: /host/dev/something - - notContains: - path: spec.template.spec.containers[0].volumeMounts - content: - name: some-volume - - notContains: - path: spec.template.spec.containers[0].volumeMounts - content: - name: some-other-volume - - contains: - path: spec.template.spec.initContainers[0].volumeMounts - content: - name: some-volume - mountPath: /some/path - readOnly: false - subPath: /some/sub/path - - contains: - path: spec.template.spec.initContainers[0].volumeMounts - content: - name: some-other-volume - mountPath: /some/other/path - readOnly: false - subPath: /some/other/sub/path - - contains: - path: spec.template.spec.initContainers[0].volumeMounts - content: - name: device-some-name-0 - mountPath: /host/dev/usb - - contains: - path: spec.template.spec.initContainers[0].volumeMounts - content: - name: device-some-name-1 - mountPath: /host/dev/serial - - - it: should pass with disabled init container from tpl - documentIndex: *deploymentDoc - set: - flag: false - initContainers: - some-name: - enabled: "{{ .Values.flag }}" - asserts: - - isNull: - path: spec.template.spec.initContainers diff --git a/.to_be_deleted/common-test/tests/initcontainers_in_deployment/init_containers_in_deployment_upgrade_test.yaml b/.to_be_deleted/common-test/tests/initcontainers_in_deployment/init_containers_in_deployment_upgrade_test.yaml deleted file mode 100644 index 39dc67f0dd..0000000000 --- a/.to_be_deleted/common-test/tests/initcontainers_in_deployment/init_containers_in_deployment_upgrade_test.yaml +++ /dev/null @@ -1,1227 +0,0 @@ -suite: initContainer in deployment test (on Upgrade) -templates: - - common.yaml -release: - upgrade: true -tests: - - it: should pass with default values - documentIndex: &deploymentDoc 0 - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Deployment - - - it: should pass with image defined in init container - documentIndex: *deploymentDoc - set: - image: - repository: some-repo - tag: some-tag - pullPolicy: Always - initImage: - repository: some-repo-init - tag: some-tag-init - pullPolicy: Never - initContainers: - some-name: - imageSelector: initImage - pullPolicy: Never - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - image: some-repo:some-tag - imagePullPolicy: Always - - isSubset: - path: spec.template.spec.initContainers[0] - content: - image: some-repo-init:some-tag-init - imagePullPolicy: Never - - - it: should pass with image defined in multiple init container - documentIndex: *deploymentDoc - set: - image: - repository: some-repo - tag: some-tag - pullPolicy: Always - initImage: - repository: some-repo-init - tag: some-tag-init - pullPolicy: Never - initImage2: - repository: some-repo-init2 - tag: some-tag-init2 - pullPolicy: IfNotPresent - initContainers: - some-name: - imageSelector: initImage - pullPolicy: Never - some-name2: - imageSelector: initImage2 - pullPolicy: Never - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - image: some-repo:some-tag - imagePullPolicy: Always - - isSubset: - path: spec.template.spec.initContainers[0] - content: - image: some-repo-init:some-tag-init - imagePullPolicy: Never - - isSubset: - path: spec.template.spec.initContainers[1] - content: - image: some-repo-init2:some-tag-init2 - imagePullPolicy: IfNotPresent - - - it: should pass with enabled false from tpl defined in init container - documentIndex: *deploymentDoc - set: - flag: false - initContainers: - some-name: - enabled: "{{ .Values.flag }}" - tty: true - stdin: true - asserts: - - isNotNull: - path: spec.template.spec.containers[0] - - isNull: - path: spec.template.spec.initContainers - - - it: should pass with enabled true from tpl defined in init container - documentIndex: *deploymentDoc - set: - flag: true - initContainers: - some-name: - enabled: "{{ .Values.flag }}" - tty: true - stdin: true - asserts: - - isNotNull: - path: spec.template.spec.containers[0] - - isNotNull: - path: spec.template.spec.initContainers - - - it: should pass with tty and stdin defined in init container - documentIndex: *deploymentDoc - set: - initContainers: - some-name: - tty: true - stdin: true - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - tty: false - stdin: false - - isSubset: - path: spec.template.spec.initContainers[0] - content: - tty: true - stdin: true - - - it: should pass with command and args defined in init container - documentIndex: *deploymentDoc - set: - port: 8080 - entrypoint: ./run.sh - initContainers: - some-name: - command: - - /bin/sh - - -c - - | - {{ .Values.entrypoint }} - args: - - --port - - "{{ .Values.port }}" - extraArgs: - - --data_dir - - /data - asserts: - - isNotSubset: - path: spec.template.spec.containers[0] - content: - command: - - /bin/sh - - -c - - | - ./run.sh - args: - - --port - - "8080" - - --data_dir - - /data - - isSubset: - path: spec.template.spec.initContainers[0] - content: - command: - - /bin/sh - - -c - - | - ./run.sh - args: - - --port - - "8080" - - --data_dir - - /data - - - it: should pass with termination defined in init container - documentIndex: *deploymentDoc - set: - initContainers: - some-name: - termination: - messagePath: somePath - messagePolicy: File - asserts: - - isNotSubset: - path: spec.template.spec.containers[0] - content: - terminationMessagePath: somePath - terminationMessagePolicy: File - - isSubset: - path: spec.template.spec.initContainers[0] - content: - terminationMessagePath: somePath - terminationMessagePolicy: File - - - it: should pass with resources inherited from main container and modified in init container - documentIndex: *deploymentDoc - set: - resources: - requests: - cpu: 25m - memory: 80Mi - initContainers: - some-name: - resources: - inherit: true - limits: - cpu: 1000m - memory: 1Gi - requests: - memory: 120Mi - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - resources: - limits: - cpu: 4000m - memory: 8Gi - requests: - cpu: 25m - memory: 80Mi - - isSubset: - path: spec.template.spec.initContainers[0] - content: - resources: - limits: - cpu: 1000m - memory: 1Gi - requests: - cpu: 25m - memory: 120Mi - - - it: should pass with resources defined in init container - documentIndex: *deploymentDoc - set: - initContainers: - some-name: - nvidiaCaps: - - compute - scaleGPU: - gpu.intel.com/i915: "1" - resources: - limits: - cpu: 3000m - memory: 4Gi - requests: - cpu: 20m - memory: 100Mi - asserts: - - equal: - path: spec.template.spec.securityContext - value: - fsGroup: 568 - fsGroupChangePolicy: OnRootMismatch - supplementalGroups: - - 44 - - isSubset: - path: spec.template.spec.containers[0] - content: - resources: - limits: - cpu: 4000m - memory: 8Gi - requests: - cpu: 10m - memory: 50Mi - - isSubset: - path: spec.template.spec.initContainers[0] - content: - resources: - limits: - cpu: 3000m - memory: 4Gi - gpu.intel.com/i915: "1" - requests: - cpu: 20m - memory: 100Mi - - notContains: - path: spec.template.spec.containers[0].env - content: - name: NVIDIA_DRIVER_CAPABILITIES - value: all - - contains: - path: spec.template.spec.initContainers[0].env - content: - name: NVIDIA_DRIVER_CAPABILITIES - value: compute - - - it: should pass with envFrom defined in init container - documentIndex: *deploymentDoc - set: - some_name: a_name - some_name2: a_name2 - initContainers: - some-name: - envFrom: - - configMapRef: - name: "{{ .Values.some_name }}" - - configMapRef: - name: "{{ .Values.some_name2 }}" - asserts: - - isNotSubset: - path: spec.template.spec.containers[0] - content: - envFrom: - - configMapRef: - name: a_name - - configMapRef: - name: a_name2 - - isSubset: - path: spec.template.spec.initContainers[0] - content: - envFrom: - - configMapRef: - name: a_name - - configMapRef: - name: a_name2 - - - it: should pass with env and envList defined in init container - documentIndex: *deploymentDoc - set: - some_value: value - some_value2: value2 - some_value3: value3 - some_value4: value4 - initContainers: - some-name: - env: - var1: "{{ .Values.some_value }}" - var2: "{{ .Values.some_value2 }}" - var5: - secretKeyRef: - key: key - name: name - envList: - - name: var3 - value: "{{ .Values.some_value3 }}" - - name: var4 - value: "{{ .Values.some_value4 }}" - asserts: - - isNotSubset: - path: spec.template.spec.containers[0] - content: - env: - - name: var1 - value: value - - name: var2 - value: value2 - - name: var3 - value: value3 - - name: var4 - value: value4 - - isSubset: - path: spec.template.spec.initContainers[0] - content: - env: - - name: TZ - value: UTC - - name: UMASK - value: "002" - - name: UMASK_SET - value: "002" - - name: NVIDIA_VISIBLE_DEVICES - value: void - - name: S6_READ_ONLY_ROOT - value: "1" - - name: var1 - value: value - - name: var2 - value: value2 - - name: var5 - valueFrom: - secretKeyRef: - name: name - key: key - - name: var3 - value: value3 - - name: var4 - value: value4 - - - it: should pass with changed PUID/UMASK - documentIndex: *deploymentDoc - set: - initContainers: - some-name: - securityContext: - runAsUser: 0 - runAsNonRoot: false - UMASK: "003" - PUID: 1000 - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - env: - - name: TZ - value: UTC - - name: UMASK - value: "002" - - name: UMASK_SET - value: "002" - - name: NVIDIA_VISIBLE_DEVICES - value: void - - name: S6_READ_ONLY_ROOT - value: "1" - - isSubset: - path: spec.template.spec.initContainers[0] - content: - env: - - name: TZ - value: UTC - - name: UMASK - value: "003" - - name: UMASK_SET - value: "003" - - name: NVIDIA_VISIBLE_DEVICES - value: void - - name: PUID - value: "1000" - - name: USER_ID - value: "1000" - - name: UID - value: "1000" - - name: PGID - value: "568" - - name: GROUP_ID - value: "568" - - name: GID - value: "568" - - name: S6_READ_ONLY_ROOT - value: "1" - - - it: should pass with disabled injectFixedEnvs - documentIndex: *deploymentDoc - set: - initContainers: - some-name: - securityContext: - runAsUser: 0 - runAsNonRoot: false - injectFixedEnvs: false - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - env: - - name: TZ - value: UTC - - name: UMASK - value: "002" - - name: UMASK_SET - value: "002" - - name: NVIDIA_VISIBLE_DEVICES - value: void - - name: S6_READ_ONLY_ROOT - value: "1" - - isNull: - path: spec.template.spec.initContainers[0].env - - - it: should fail with lifecycle defined in init container - set: - initContainers: - some-name: - lifecycle: - asserts: - - failedTemplate: - errorMessage: Init/System/Install/Upgrade/(Cron)Job Container (RELEASE-NAME-common-test-init-some-name) do not support lifecycle hooks - - - it: should fail with env trying to override fixedEnvs in init container - set: - initContainers: - some-name: - env: - TZ: something - asserts: - - failedTemplate: - errorMessage: Environment Variable (TZ) on container (RELEASE-NAME-common-test-init-some-name) is set more than once. [to (UTC) on (fixedEnv)] and [to (something) on (env)] - - - it: should fail with env trying to override configmap in init container - set: - configmap: - some-confmap: - enabled: true - parseAsEnv: true - content: - TZ: something - initContainers: - some-name: - envFrom: - - configMapRef: - name: '{{ include "ix.v1.common.names.fullname" . }}-some-confmap' - asserts: - - failedTemplate: - errorMessage: Environment Variable (TZ) on container (RELEASE-NAME-common-test-init-some-name) is set more than once. [to (UTC) on (fixedEnv)] and [to (something) on (configmap-RELEASE-NAME-common-test-some-confmap)] - - - it: should fail with env trying to override secret in init container - set: - secret: - some-secret: - enabled: true - parseAsEnv: true - content: - TZ: something - initContainers: - some-name: - envFrom: - - secretRef: - name: '{{ include "ix.v1.common.names.fullname" . }}-some-secret' - asserts: - - failedTemplate: - errorMessage: Environment Variable (TZ) on container (RELEASE-NAME-common-test-init-some-name) is set more than once. [to (UTC) on (fixedEnv)] and [to (something) on (secret-RELEASE-NAME-common-test-some-secret)] - - - it: should pass with securityContext inherited - documentIndex: *deploymentDoc - set: - securityContext: - runAsUser: 0 - runAsGroup: 0 - runAsNonRoot: false - readOnlyRootFilesystem: false - privileged: true - allowPrivilegeEscalation: true - capabilities: - add: - - Something - drop: - - Something_Else - initContainers: - some_container: - imageSelector: image - securityContext: - inherit: true - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - securityContext: - runAsUser: 0 - runAsGroup: 0 - runAsNonRoot: false - readOnlyRootFilesystem: false - privileged: true - allowPrivilegeEscalation: true - capabilities: - add: - - Something - drop: - - Something_Else - - isSubset: - path: spec.template.spec.initContainers[0] - content: - securityContext: - allowPrivilegeEscalation: true - capabilities: - add: - - Something - drop: - - Something_Else - privileged: true - readOnlyRootFilesystem: false - runAsGroup: 0 - runAsNonRoot: false - runAsUser: 0 - - - it: should pass with deviceList defined in init container - documentIndex: *deploymentDoc - set: - initContainers: - some_container: - deviceList: - - enabled: true - mountPath: /host/dev/usb - hostPath: /dev/usb - securityContext: - inherit: true - asserts: - - equal: - path: spec.template.spec.securityContext - value: - fsGroup: 568 - fsGroupChangePolicy: OnRootMismatch - supplementalGroups: - - 5 - - 10 - - 20 - - 24 - - isSubset: - path: spec.template.spec.containers[0] - content: - securityContext: - allowPrivilegeEscalation: false - capabilities: - add: [] - drop: - - ALL - privileged: false - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - isSubset: - path: spec.template.spec.initContainers[0] - content: - securityContext: - allowPrivilegeEscalation: true - capabilities: - add: [] - drop: - - ALL - privileged: true - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - - it: should pass with deviceList and scaleGPU defined in init container - documentIndex: *deploymentDoc - set: - initContainers: - some_container: - scaleGPU: - nvidia: something - deviceList: - - enabled: true - mountPath: /host/dev/usb - hostPath: /dev/usb - securityContext: - inherit: true - asserts: - - equal: - path: spec.template.spec.securityContext - value: - fsGroup: 568 - fsGroupChangePolicy: OnRootMismatch - supplementalGroups: - - 5 - - 10 - - 20 - - 24 - - 44 - - isSubset: - path: spec.template.spec.containers[0] - content: - securityContext: - allowPrivilegeEscalation: false - capabilities: - add: [] - drop: - - ALL - privileged: false - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - isSubset: - path: spec.template.spec.initContainers[0] - content: - securityContext: - allowPrivilegeEscalation: true - capabilities: - add: [] - drop: - - ALL - privileged: true - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - - it: should pass with port <=1024 defined in init container - documentIndex: *deploymentDoc - set: - initContainers: - some_container: - ports: - - name: http - containerPort: 80 - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - securityContext: - allowPrivilegeEscalation: false - capabilities: - add: [] - drop: - - ALL - privileged: false - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - isSubset: - path: spec.template.spec.initContainers[0] - content: - securityContext: - allowPrivilegeEscalation: false - capabilities: - add: - - NET_BIND_SERVICE - drop: - - ALL - privileged: false - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - - it: should pass with securityContext default - documentIndex: *deploymentDoc - set: - initContainers: - some_container: - imageSelector: image - securityContext: - inherit: true - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - securityContext: - allowPrivilegeEscalation: false - capabilities: - add: [] - drop: - - ALL - privileged: false - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - isSubset: - path: spec.template.spec.initContainers[0] - content: - securityContext: - allowPrivilegeEscalation: false - capabilities: - add: [] - drop: - - ALL - privileged: false - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - - it: should pass with securityContext changed - documentIndex: *deploymentDoc - set: - initContainers: - some_container: - imageSelector: image - securityContext: - runAsUser: 0 - runAsGroup: 0 - runAsNonRoot: false - readOnlyRootFilesystem: false - privileged: true - allowPrivilegeEscalation: true - capabilities: - add: - - Something - drop: - - Something_Else - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - securityContext: - allowPrivilegeEscalation: false - capabilities: - add: [] - drop: - - ALL - privileged: false - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - isSubset: - path: spec.template.spec.initContainers[0] - content: - securityContext: - allowPrivilegeEscalation: true - capabilities: - add: - - Something - drop: - - Something_Else - privileged: true - readOnlyRootFilesystem: false - runAsGroup: 0 - runAsNonRoot: false - runAsUser: 0 - - - it: should pass with securityContext with some values changed - documentIndex: *deploymentDoc - set: - initContainers: - some_container: - imageSelector: image - securityContext: - runAsUser: 0 - runAsGroup: 0 - runAsNonRoot: false - capabilities: - add: - - Something - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - securityContext: - allowPrivilegeEscalation: false - capabilities: - add: [] - drop: - - ALL - privileged: false - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - isSubset: - path: spec.template.spec.initContainers[0] - content: - securityContext: - allowPrivilegeEscalation: false - capabilities: - add: - - Something - drop: - - ALL - privileged: false - readOnlyRootFilesystem: true - runAsGroup: 0 - runAsNonRoot: false - runAsUser: 0 - - - it: should pass with securityContext with inherit and at least one value changed - documentIndex: *deploymentDoc - set: - securityContext: - privileged: true - allowPrivilegeEscalation: true - capabilities: - drop: - - something_else - initContainers: - some_container: - imageSelector: image - securityContext: - inherit: true - runAsNonRoot: false - runAsUser: 0 - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - securityContext: - allowPrivilegeEscalation: true - capabilities: - add: [] - drop: - - something_else - privileged: true - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - isSubset: - path: spec.template.spec.initContainers[0] - content: - securityContext: - allowPrivilegeEscalation: true - capabilities: - add: [] - drop: - - something_else - privileged: true - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: false - runAsUser: 0 - - - it: should fail with probes in init container - set: - initContainers: - some-name: - probes: - liveness: - enabled: true - asserts: - - failedTemplate: - errorMessage: Init/System/Install/Upgrade/(Cron)Job Container (RELEASE-NAME-common-test-init-some-name) do not support probes - - - it: should fail with invalid protocol in ports in init container - set: - initContainers: - some-name: - ports: - - containerPort: 5678 - protocol: invalid-proto - name: tcp-port - asserts: - - failedTemplate: - errorMessage: Invalid (invalid-proto) in port (tcp-port) in (RELEASE-NAME-common-test-init-some-name) container. Valid protocols are TCP and UDP. - - - it: should fail without name in ports in init container - set: - initContainers: - some-name: - ports: - - containerPort: 5678 - protocol: TCP - name: "" - asserts: - - failedTemplate: - errorMessage: is required in all in (RELEASE-NAME-common-test-init-some-name) container. - - - it: should fail without containerPort in ports in init container - set: - initContainers: - some-name: - ports: - - containerPort: "" - name: tcp-port - asserts: - - failedTemplate: - errorMessage: is required in port (tcp-port) in (RELEASE-NAME-common-test-init-some-name) container. - - - it: should fail with non-int containerPort in ports in init container - set: - initContainers: - some-name: - ports: - - containerPort: not-int - name: tcp-port - asserts: - - failedTemplate: - errorMessage: Invalid (not-int) in port (tcp-port) in (RELEASE-NAME-common-test-init-some-name) container. Must be an int. - - - it: should fail with non-int hostPort in ports in init container - set: - initContainers: - some-name: - ports: - - containerPort: 1234 - hostPort: not-int - name: tcp-port - asserts: - - failedTemplate: - errorMessage: Invalid (not-int) in port (tcp-port) in (RELEASE-NAME-common-test-init-some-name) container. Must be an int. - - - it: should pass without protocol in ports in init container - documentIndex: *deploymentDoc - set: - initContainers: - some-name: - ports: - - containerPort: 5678 - name: tcp-port - asserts: - - isSubset: - path: spec.template.spec.initContainers[0] - content: - ports: - - containerPort: 5678 - protocol: TCP - name: tcp-port - - - it: should pass with ports defined in init container - documentIndex: *deploymentDoc - set: - initContainers: - some-name: - ports: - - containerPort: 5678 - protocol: TCP - name: tcp-port - - containerPort: 1234 - protocol: UDP - name: udp-port - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - ports: - - containerPort: 65535 - protocol: TCP - name: main - - isSubset: - path: spec.template.spec.initContainers[0] - content: - ports: - - containerPort: 5678 - protocol: TCP - name: tcp-port - - containerPort: 1234 - protocol: UDP - name: udp-port - - - it: should fail without trying to mount a non existent volume in volumeMounts defined in init container - set: - initContainers: - some-name: - volumeMounts: - - name: some-volume - mountPath: /some/path - asserts: - - failedTemplate: - errorMessage: You are trying to mount a volume that does not exist (some-volume). Please define the volume in . - - - it: should fail without name in volumeMounts defined in init container - set: - initContainers: - some-name: - volumeMounts: - - name: - mountPath: /some/path - readOnly: false - subPath: /some/sub/path - asserts: - - failedTemplate: - errorMessage: is required in volumeMounts in init/system/install/upgrade/additional containers. - - - it: should pass with volumeMounts defined in init container - documentIndex: *deploymentDoc - set: - persistence: - some-volume: - enabled: true - noMount: true - type: emptyDir - some-other-volume: - enabled: true - noMount: true - type: emptyDir - initContainers: - some-name: - volumeMounts: - - name: some-volume - mountPath: /some/path - readOnly: false - subPath: /some/sub/path - - name: some-other-volume - mountPath: /some/other/path - readOnly: false - subPath: /some/other/sub/path - asserts: - - notContains: - path: spec.template.spec.containers[0].volumeMounts - content: - name: some-volume - - notContains: - path: spec.template.spec.containers[0].volumeMounts - content: - name: some-other-volume - - contains: - path: spec.template.spec.initContainers[0].volumeMounts - content: - name: some-volume - mountPath: /some/path - readOnly: false - subPath: /some/sub/path - - contains: - path: spec.template.spec.initContainers[0].volumeMounts - content: - name: some-other-volume - mountPath: /some/other/path - readOnly: false - subPath: /some/other/sub/path - - - it: should pass with volumeMounts inherit all in init container - documentIndex: *deploymentDoc - set: - persistence: - some-volume: - enabled: true - noMount: true - mountPath: /some/path - type: emptyDir - some-other-volume: - enabled: true - noMount: true - mountPath: /some/other/path - type: emptyDir - initContainers: - some-name: - volumeMounts: - - inherit: all - asserts: - - notContains: - path: spec.template.spec.containers[0].volumeMounts - content: - name: some-volume - - notContains: - path: spec.template.spec.containers[0].volumeMounts - content: - name: some-other-volume - - contains: - path: spec.template.spec.initContainers[0].volumeMounts - content: - name: some-other-volume - mountPath: /some/other/path - - contains: - path: spec.template.spec.initContainers[0].volumeMounts - content: - name: some-volume - mountPath: /some/path - - - it: should pass with volumeMounts inherit skipNoMount in init container - documentIndex: *deploymentDoc - set: - persistence: - some-volume: - enabled: true - noMount: true - mountPath: /some/path - type: emptyDir - some-other-volume: - enabled: true - type: emptyDir - mountPath: /some/other/path - initContainers: - some-name: - volumeMounts: - - inherit: skipNoMount - asserts: - - contains: - path: spec.template.spec.containers[0].volumeMounts - content: - mountPath: /some/other/path - name: some-other-volume - - contains: - path: spec.template.spec.initContainers[0].volumeMounts - content: - name: some-other-volume - mountPath: /some/other/path - - - it: should pass with deviceList and volumeMounts defined in init container - documentIndex: *deploymentDoc - set: - deviceList: - - enabled: true - type: hostPath - mountPath: /host/dev/something - hostPath: /dev/something - persistence: - some-volume: - enabled: true - noMount: true - type: emptyDir - some-other-volume: - enabled: true - noMount: true - type: emptyDir - initContainers: - some-name: - deviceList: - - enabled: true - type: hostPath - mountPath: /host/dev/usb - hostPath: /dev/usb - - enabled: true - type: hostPath - mountPath: /host/dev/serial - hostPath: /dev/serial - volumeMounts: - - name: some-volume - mountPath: /some/path - readOnly: false - subPath: /some/sub/path - - name: some-other-volume - mountPath: /some/other/path - readOnly: false - subPath: /some/other/sub/path - asserts: - - contains: - path: spec.template.spec.containers[0].volumeMounts - content: - name: device-0 - mountPath: /host/dev/something - - notContains: - path: spec.template.spec.containers[0].volumeMounts - content: - name: some-volume - - notContains: - path: spec.template.spec.containers[0].volumeMounts - content: - name: some-other-volume - - contains: - path: spec.template.spec.initContainers[0].volumeMounts - content: - name: some-volume - mountPath: /some/path - readOnly: false - subPath: /some/sub/path - - contains: - path: spec.template.spec.initContainers[0].volumeMounts - content: - name: some-other-volume - mountPath: /some/other/path - readOnly: false - subPath: /some/other/sub/path - - contains: - path: spec.template.spec.initContainers[0].volumeMounts - content: - name: device-some-name-0 - mountPath: /host/dev/usb - - contains: - path: spec.template.spec.initContainers[0].volumeMounts - content: - name: device-some-name-1 - mountPath: /host/dev/serial - - - it: should pass with disabled init container from tpl - documentIndex: *deploymentDoc - set: - flag: false - initContainers: - some-name: - enabled: "{{ .Values.flag }}" - asserts: - - isNull: - path: spec.template.spec.initContainers diff --git a/.to_be_deleted/common-test/tests/initcontainers_in_deployment/install_containers_in_deployment_test.yaml b/.to_be_deleted/common-test/tests/initcontainers_in_deployment/install_containers_in_deployment_test.yaml deleted file mode 100644 index 1e2306485e..0000000000 --- a/.to_be_deleted/common-test/tests/initcontainers_in_deployment/install_containers_in_deployment_test.yaml +++ /dev/null @@ -1,1239 +0,0 @@ - -suite: installContainer in deployment test -templates: - - common.yaml -tests: - - it: should pass with default values - documentIndex: &deploymentDoc 0 - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Deployment - - - it: should pass with image defined in install container - documentIndex: *deploymentDoc - set: - image: - repository: some-repo - tag: some-tag - pullPolicy: Always - installImage: - repository: some-repo-install - tag: some-tag-install - pullPolicy: Never - installContainers: - some-name: - imageSelector: installImage - pullPolicy: Never - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - image: some-repo:some-tag - imagePullPolicy: Always - - isSubset: - path: spec.template.spec.initContainers[0] - content: - image: some-repo-install:some-tag-install - imagePullPolicy: Never - - - it: should pass with image defined in multiple install container - documentIndex: *deploymentDoc - set: - image: - repository: some-repo - tag: some-tag - pullPolicy: Always - initImage: - repository: some-repo-init - tag: some-tag-init - pullPolicy: Never - installImage: - repository: some-repo-install - tag: some-tag-install - pullPolicy: Never - installImage2: - repository: some-repo-install2 - tag: some-tag-install2 - pullPolicy: IfNotPresent - installContainers: - some-name: - imageSelector: installImage - pullPolicy: Never - some-name2: - imageSelector: installImage2 - pullPolicy: Never - initContainers: - some-name3: - imageSelector: initImage - pullPolicy: Never - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - image: some-repo:some-tag - imagePullPolicy: Always - - isSubset: - path: spec.template.spec.initContainers[0] - content: - image: some-repo-install:some-tag-install - imagePullPolicy: Never - - isSubset: - path: spec.template.spec.initContainers[1] - content: - image: some-repo-install2:some-tag-install2 - imagePullPolicy: IfNotPresent - - isSubset: - path: spec.template.spec.initContainers[2] - content: - image: some-repo-init:some-tag-init - imagePullPolicy: Never - - - it: should pass with enabled false from tpl defined in install container - documentIndex: *deploymentDoc - set: - flag: false - installContainers: - some-name: - enabled: "{{ .Values.flag }}" - tty: true - stdin: true - asserts: - - isNotNull: - path: spec.template.spec.containers[0] - - isNull: - path: spec.template.spec.initContainers - - - it: should pass with enabled true from tpl defined in install container - documentIndex: *deploymentDoc - set: - flag: true - installContainers: - some-name: - enabled: "{{ .Values.flag }}" - tty: true - stdin: true - asserts: - - isNotNull: - path: spec.template.spec.containers[0] - - isNotNull: - path: spec.template.spec.initContainers - - - it: should pass with tty and stdin defined in install container - documentIndex: *deploymentDoc - set: - installContainers: - some-name: - tty: true - stdin: true - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - tty: false - stdin: false - - isSubset: - path: spec.template.spec.initContainers[0] - content: - tty: true - stdin: true - - - it: should pass with command and args defined in install container - documentIndex: *deploymentDoc - set: - port: 8080 - entrypoint: ./run.sh - installContainers: - some-name: - command: - - /bin/sh - - -c - - | - {{ .Values.entrypoint }} - args: - - --port - - "{{ .Values.port }}" - extraArgs: - - --data_dir - - /data - asserts: - - isNotSubset: - path: spec.template.spec.containers[0] - content: - command: - - /bin/sh - - -c - - | - ./run.sh - args: - - --port - - "8080" - - --data_dir - - /data - - isSubset: - path: spec.template.spec.initContainers[0] - content: - command: - - /bin/sh - - -c - - | - ./run.sh - args: - - --port - - "8080" - - --data_dir - - /data - - - it: should pass with termination defined in install container - documentIndex: *deploymentDoc - set: - installContainers: - some-name: - termination: - messagePath: somePath - messagePolicy: File - asserts: - - isNotSubset: - path: spec.template.spec.containers[0] - content: - terminationMessagePath: somePath - terminationMessagePolicy: File - - isSubset: - path: spec.template.spec.initContainers[0] - content: - terminationMessagePath: somePath - terminationMessagePolicy: File - - - it: should pass with resources inherited from main container and modified in install container - documentIndex: *deploymentDoc - set: - resources: - requests: - cpu: 25m - memory: 80Mi - installContainers: - some-name: - resources: - inherit: true - limits: - cpu: 1000m - memory: 1Gi - requests: - memory: 120Mi - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - resources: - limits: - cpu: 4000m - memory: 8Gi - requests: - cpu: 25m - memory: 80Mi - - isSubset: - path: spec.template.spec.initContainers[0] - content: - resources: - limits: - cpu: 1000m - memory: 1Gi - requests: - cpu: 25m - memory: 120Mi - - - it: should pass with resources defined in install container - documentIndex: *deploymentDoc - set: - installContainers: - some-name: - nvidiaCaps: - - compute - scaleGPU: - gpu.intel.com/i915: "1" - resources: - limits: - cpu: 3000m - memory: 4Gi - requests: - cpu: 20m - memory: 100Mi - asserts: - - equal: - path: spec.template.spec.securityContext - value: - fsGroup: 568 - fsGroupChangePolicy: OnRootMismatch - supplementalGroups: - - 44 - - isSubset: - path: spec.template.spec.containers[0] - content: - resources: - limits: - cpu: 4000m - memory: 8Gi - requests: - cpu: 10m - memory: 50Mi - - isSubset: - path: spec.template.spec.initContainers[0] - content: - resources: - limits: - cpu: 3000m - memory: 4Gi - gpu.intel.com/i915: "1" - requests: - cpu: 20m - memory: 100Mi - - notContains: - path: spec.template.spec.containers[0].env - content: - name: NVIDIA_DRIVER_CAPABILITIES - value: all - - contains: - path: spec.template.spec.initContainers[0].env - content: - name: NVIDIA_DRIVER_CAPABILITIES - value: compute - - - it: should pass with envFrom defined in install container - documentIndex: *deploymentDoc - set: - some_name: a_name - some_name2: a_name2 - installContainers: - some-name: - envFrom: - - configMapRef: - name: "{{ .Values.some_name }}" - - configMapRef: - name: "{{ .Values.some_name2 }}" - asserts: - - isNotSubset: - path: spec.template.spec.containers[0] - content: - envFrom: - - configMapRef: - name: a_name - - configMapRef: - name: a_name2 - - isSubset: - path: spec.template.spec.initContainers[0] - content: - envFrom: - - configMapRef: - name: a_name - - configMapRef: - name: a_name2 - - - it: should pass with env and envList defined in install container - documentIndex: *deploymentDoc - set: - some_value: value - some_value2: value2 - some_value3: value3 - some_value4: value4 - installContainers: - some-name: - env: - var1: "{{ .Values.some_value }}" - var2: "{{ .Values.some_value2 }}" - var5: - secretKeyRef: - key: key - name: name - envList: - - name: var3 - value: "{{ .Values.some_value3 }}" - - name: var4 - value: "{{ .Values.some_value4 }}" - asserts: - - isNotSubset: - path: spec.template.spec.containers[0] - content: - env: - - name: var1 - value: value - - name: var2 - value: value2 - - name: var3 - value: value3 - - name: var4 - value: value4 - - isSubset: - path: spec.template.spec.initContainers[0] - content: - env: - - name: TZ - value: UTC - - name: UMASK - value: "002" - - name: UMASK_SET - value: "002" - - name: NVIDIA_VISIBLE_DEVICES - value: void - - name: S6_READ_ONLY_ROOT - value: "1" - - name: var1 - value: value - - name: var2 - value: value2 - - name: var5 - valueFrom: - secretKeyRef: - name: name - key: key - - name: var3 - value: value3 - - name: var4 - value: value4 - - - it: should pass with changed PUID/UMASK - documentIndex: *deploymentDoc - set: - installContainers: - some-name: - securityContext: - runAsUser: 0 - runAsNonRoot: false - UMASK: "003" - PUID: 1000 - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - env: - - name: TZ - value: UTC - - name: UMASK - value: "002" - - name: UMASK_SET - value: "002" - - name: NVIDIA_VISIBLE_DEVICES - value: void - - name: S6_READ_ONLY_ROOT - value: "1" - - isSubset: - path: spec.template.spec.initContainers[0] - content: - env: - - name: TZ - value: UTC - - name: UMASK - value: "003" - - name: UMASK_SET - value: "003" - - name: NVIDIA_VISIBLE_DEVICES - value: void - - name: PUID - value: "1000" - - name: USER_ID - value: "1000" - - name: UID - value: "1000" - - name: PGID - value: "568" - - name: GROUP_ID - value: "568" - - name: GID - value: "568" - - name: S6_READ_ONLY_ROOT - value: "1" - - - it: should pass with disabled injectFixedEnvs - documentIndex: *deploymentDoc - set: - installContainers: - some-name: - securityContext: - runAsUser: 0 - runAsNonRoot: false - injectFixedEnvs: false - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - env: - - name: TZ - value: UTC - - name: UMASK - value: "002" - - name: UMASK_SET - value: "002" - - name: NVIDIA_VISIBLE_DEVICES - value: void - - name: S6_READ_ONLY_ROOT - value: "1" - - isNull: - path: spec.template.spec.initContainers[0].env - - - it: should fail with lifecycle defined in install container - set: - installContainers: - some-name: - lifecycle: - asserts: - - failedTemplate: - errorMessage: Init/System/Install/Upgrade/(Cron)Job Container (RELEASE-NAME-common-test-install-some-name) do not support lifecycle hooks - - - it: should fail with env trying to override fixedEnvs in install container - set: - installContainers: - some-name: - env: - TZ: something - asserts: - - failedTemplate: - errorMessage: Environment Variable (TZ) on container (RELEASE-NAME-common-test-install-some-name) is set more than once. [to (UTC) on (fixedEnv)] and [to (something) on (env)] - - - it: should fail with env trying to override configmap in install container - set: - configmap: - some-confmap: - enabled: true - parseAsEnv: true - content: - TZ: something - installContainers: - some-name: - envFrom: - - configMapRef: - name: '{{ include "ix.v1.common.names.fullname" . }}-some-confmap' - asserts: - - failedTemplate: - errorMessage: Environment Variable (TZ) on container (RELEASE-NAME-common-test-install-some-name) is set more than once. [to (UTC) on (fixedEnv)] and [to (something) on (configmap-RELEASE-NAME-common-test-some-confmap)] - - - it: should fail with env trying to override secret in install container - set: - secret: - some-secret: - enabled: true - parseAsEnv: true - content: - TZ: something - installContainers: - some-name: - envFrom: - - secretRef: - name: '{{ include "ix.v1.common.names.fullname" . }}-some-secret' - asserts: - - failedTemplate: - errorMessage: Environment Variable (TZ) on container (RELEASE-NAME-common-test-install-some-name) is set more than once. [to (UTC) on (fixedEnv)] and [to (something) on (secret-RELEASE-NAME-common-test-some-secret)] - - - it: should pass with securityContext inherited - documentIndex: *deploymentDoc - set: - securityContext: - runAsUser: 0 - runAsGroup: 0 - runAsNonRoot: false - readOnlyRootFilesystem: false - privileged: true - allowPrivilegeEscalation: true - capabilities: - add: - - Something - drop: - - Something_Else - installContainers: - some_container: - imageSelector: image - securityContext: - inherit: true - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - securityContext: - runAsUser: 0 - runAsGroup: 0 - runAsNonRoot: false - readOnlyRootFilesystem: false - privileged: true - allowPrivilegeEscalation: true - capabilities: - add: - - Something - drop: - - Something_Else - - isSubset: - path: spec.template.spec.initContainers[0] - content: - securityContext: - allowPrivilegeEscalation: true - capabilities: - add: - - Something - drop: - - Something_Else - privileged: true - readOnlyRootFilesystem: false - runAsGroup: 0 - runAsNonRoot: false - runAsUser: 0 - - - it: should pass with deviceList defined in install container - documentIndex: *deploymentDoc - set: - installContainers: - some_container: - deviceList: - - enabled: true - mountPath: /host/dev/usb - hostPath: /dev/usb - securityContext: - inherit: true - asserts: - - equal: - path: spec.template.spec.securityContext - value: - fsGroup: 568 - fsGroupChangePolicy: OnRootMismatch - supplementalGroups: - - 5 - - 10 - - 20 - - 24 - - isSubset: - path: spec.template.spec.containers[0] - content: - securityContext: - allowPrivilegeEscalation: false - capabilities: - add: [] - drop: - - ALL - privileged: false - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - isSubset: - path: spec.template.spec.initContainers[0] - content: - securityContext: - allowPrivilegeEscalation: true - capabilities: - add: [] - drop: - - ALL - privileged: true - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - - it: should pass with deviceList and scaleGPU defined in install container - documentIndex: *deploymentDoc - set: - installContainers: - some_container: - scaleGPU: - nvidia: something - deviceList: - - enabled: true - mountPath: /host/dev/usb - hostPath: /dev/usb - securityContext: - inherit: true - asserts: - - equal: - path: spec.template.spec.securityContext - value: - fsGroup: 568 - fsGroupChangePolicy: OnRootMismatch - supplementalGroups: - - 5 - - 10 - - 20 - - 24 - - 44 - - isSubset: - path: spec.template.spec.containers[0] - content: - securityContext: - allowPrivilegeEscalation: false - capabilities: - add: [] - drop: - - ALL - privileged: false - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - isSubset: - path: spec.template.spec.initContainers[0] - content: - securityContext: - allowPrivilegeEscalation: true - capabilities: - add: [] - drop: - - ALL - privileged: true - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - - it: should pass with port <=1024 defined in install container - documentIndex: *deploymentDoc - set: - installContainers: - some_container: - ports: - - name: http - containerPort: 80 - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - securityContext: - allowPrivilegeEscalation: false - capabilities: - add: [] - drop: - - ALL - privileged: false - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - isSubset: - path: spec.template.spec.initContainers[0] - content: - securityContext: - allowPrivilegeEscalation: false - capabilities: - add: - - NET_BIND_SERVICE - drop: - - ALL - privileged: false - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - - it: should pass with securityContext default - documentIndex: *deploymentDoc - set: - installContainers: - some_container: - imageSelector: image - securityContext: - inherit: true - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - securityContext: - allowPrivilegeEscalation: false - capabilities: - add: [] - drop: - - ALL - privileged: false - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - isSubset: - path: spec.template.spec.initContainers[0] - content: - securityContext: - allowPrivilegeEscalation: false - capabilities: - add: [] - drop: - - ALL - privileged: false - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - - it: should pass with securityContext changed - documentIndex: *deploymentDoc - set: - installContainers: - some_container: - imageSelector: image - securityContext: - runAsUser: 0 - runAsGroup: 0 - runAsNonRoot: false - readOnlyRootFilesystem: false - privileged: true - allowPrivilegeEscalation: true - capabilities: - add: - - Something - drop: - - Something_Else - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - securityContext: - allowPrivilegeEscalation: false - capabilities: - add: [] - drop: - - ALL - privileged: false - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - isSubset: - path: spec.template.spec.initContainers[0] - content: - securityContext: - allowPrivilegeEscalation: true - capabilities: - add: - - Something - drop: - - Something_Else - privileged: true - readOnlyRootFilesystem: false - runAsGroup: 0 - runAsNonRoot: false - runAsUser: 0 - - - it: should pass with securityContext with some values changed - documentIndex: *deploymentDoc - set: - installContainers: - some_container: - imageSelector: image - securityContext: - runAsUser: 0 - runAsGroup: 0 - runAsNonRoot: false - capabilities: - add: - - Something - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - securityContext: - allowPrivilegeEscalation: false - capabilities: - add: [] - drop: - - ALL - privileged: false - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - isSubset: - path: spec.template.spec.initContainers[0] - content: - securityContext: - allowPrivilegeEscalation: false - capabilities: - add: - - Something - drop: - - ALL - privileged: false - readOnlyRootFilesystem: true - runAsGroup: 0 - runAsNonRoot: false - runAsUser: 0 - - - it: should pass with securityContext with inherit and at least one value changed - documentIndex: *deploymentDoc - set: - securityContext: - privileged: true - allowPrivilegeEscalation: true - capabilities: - drop: - - something_else - installContainers: - some_container: - imageSelector: image - securityContext: - inherit: true - runAsNonRoot: false - runAsUser: 0 - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - securityContext: - allowPrivilegeEscalation: true - capabilities: - add: [] - drop: - - something_else - privileged: true - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - isSubset: - path: spec.template.spec.initContainers[0] - content: - securityContext: - allowPrivilegeEscalation: true - capabilities: - add: [] - drop: - - something_else - privileged: true - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: false - runAsUser: 0 - - - it: should fail with probes in install container - set: - installContainers: - some-name: - probes: - liveness: - enabled: true - asserts: - - failedTemplate: - errorMessage: Init/System/Install/Upgrade/(Cron)Job Container (RELEASE-NAME-common-test-install-some-name) do not support probes - - - it: should fail with invalid protocol in ports in install container - set: - installContainers: - some-name: - ports: - - containerPort: 5678 - protocol: invalid-proto - name: tcp-port - asserts: - - failedTemplate: - errorMessage: Invalid (invalid-proto) in port (tcp-port) in (RELEASE-NAME-common-test-install-some-name) container. Valid protocols are TCP and UDP. - - - it: should fail without name in ports in install container - set: - installContainers: - some-name: - ports: - - containerPort: 5678 - protocol: TCP - name: "" - asserts: - - failedTemplate: - errorMessage: is required in all in (RELEASE-NAME-common-test-install-some-name) container. - - - it: should fail without containerPort in ports in install container - set: - installContainers: - some-name: - ports: - - containerPort: "" - name: tcp-port - asserts: - - failedTemplate: - errorMessage: is required in port (tcp-port) in (RELEASE-NAME-common-test-install-some-name) container. - - - it: should fail with non-int containerPort in ports in install container - set: - installContainers: - some-name: - ports: - - containerPort: not-int - name: tcp-port - asserts: - - failedTemplate: - errorMessage: Invalid (not-int) in port (tcp-port) in (RELEASE-NAME-common-test-install-some-name) container. Must be an int. - - - it: should fail with non-int hostPort in ports in install container - set: - installContainers: - some-name: - ports: - - containerPort: 1234 - hostPort: not-int - name: tcp-port - asserts: - - failedTemplate: - errorMessage: Invalid (not-int) in port (tcp-port) in (RELEASE-NAME-common-test-install-some-name) container. Must be an int. - - - it: should pass without protocol in ports in install container - documentIndex: *deploymentDoc - set: - installContainers: - some-name: - ports: - - containerPort: 5678 - name: tcp-port - asserts: - - isSubset: - path: spec.template.spec.initContainers[0] - content: - ports: - - containerPort: 5678 - protocol: TCP - name: tcp-port - - - it: should pass with ports defined in install container - documentIndex: *deploymentDoc - set: - installContainers: - some-name: - ports: - - containerPort: 5678 - protocol: TCP - name: tcp-port - - containerPort: 1234 - protocol: UDP - name: udp-port - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - ports: - - containerPort: 65535 - protocol: TCP - name: main - - isSubset: - path: spec.template.spec.initContainers[0] - content: - ports: - - containerPort: 5678 - protocol: TCP - name: tcp-port - - containerPort: 1234 - protocol: UDP - name: udp-port - - - it: should fail without trying to mount a non existent volume in volumeMounts defined in install container - set: - installContainers: - some-name: - volumeMounts: - - name: some-volume - mountPath: /some/path - asserts: - - failedTemplate: - errorMessage: You are trying to mount a volume that does not exist (some-volume). Please define the volume in . - - - it: should fail without name in volumeMounts defined in install container - set: - installContainers: - some-name: - volumeMounts: - - name: - mountPath: /some/path - readOnly: false - subPath: /some/sub/path - asserts: - - failedTemplate: - errorMessage: is required in volumeMounts in init/system/install/upgrade/additional containers. - - - it: should pass with volumeMounts defined in install container - documentIndex: *deploymentDoc - set: - persistence: - some-volume: - enabled: true - noMount: true - type: emptyDir - some-other-volume: - enabled: true - noMount: true - type: emptyDir - installContainers: - some-name: - volumeMounts: - - name: some-volume - mountPath: /some/path - readOnly: false - subPath: /some/sub/path - - name: some-other-volume - mountPath: /some/other/path - readOnly: false - subPath: /some/other/sub/path - asserts: - - notContains: - path: spec.template.spec.containers[0].volumeMounts - content: - name: some-volume - - notContains: - path: spec.template.spec.containers[0].volumeMounts - content: - name: some-other-volume - - contains: - path: spec.template.spec.initContainers[0].volumeMounts - content: - name: some-volume - mountPath: /some/path - readOnly: false - subPath: /some/sub/path - - contains: - path: spec.template.spec.initContainers[0].volumeMounts - content: - name: some-other-volume - mountPath: /some/other/path - readOnly: false - subPath: /some/other/sub/path - - - it: should pass with volumeMounts inherit all in install container - documentIndex: *deploymentDoc - set: - persistence: - some-volume: - enabled: true - noMount: true - mountPath: /some/path - type: emptyDir - some-other-volume: - enabled: true - noMount: true - mountPath: /some/other/path - type: emptyDir - installContainers: - some-name: - volumeMounts: - - inherit: all - asserts: - - notContains: - path: spec.template.spec.containers[0].volumeMounts - content: - name: some-volume - - notContains: - path: spec.template.spec.containers[0].volumeMounts - content: - name: some-other-volume - - contains: - path: spec.template.spec.initContainers[0].volumeMounts - content: - name: some-other-volume - mountPath: /some/other/path - - contains: - path: spec.template.spec.initContainers[0].volumeMounts - content: - name: some-volume - mountPath: /some/path - - - it: should pass with volumeMounts inherit skipNoMount in install container - documentIndex: *deploymentDoc - set: - persistence: - some-volume: - enabled: true - noMount: true - mountPath: /some/path - type: emptyDir - some-other-volume: - enabled: true - type: emptyDir - mountPath: /some/other/path - installContainers: - some-name: - volumeMounts: - - inherit: skipNoMount - asserts: - - contains: - path: spec.template.spec.containers[0].volumeMounts - content: - mountPath: /some/other/path - name: some-other-volume - - contains: - path: spec.template.spec.initContainers[0].volumeMounts - content: - name: some-other-volume - mountPath: /some/other/path - - - it: should pass with deviceList and volumeMounts defined in install container - documentIndex: *deploymentDoc - set: - deviceList: - - enabled: true - type: hostPath - mountPath: /host/dev/something - hostPath: /dev/something - persistence: - some-volume: - enabled: true - noMount: true - type: emptyDir - some-other-volume: - enabled: true - noMount: true - type: emptyDir - installContainers: - some-name: - deviceList: - - enabled: true - type: hostPath - mountPath: /host/dev/usb - hostPath: /dev/usb - - enabled: true - type: hostPath - mountPath: /host/dev/serial - hostPath: /dev/serial - volumeMounts: - - name: some-volume - mountPath: /some/path - readOnly: false - subPath: /some/sub/path - - name: some-other-volume - mountPath: /some/other/path - readOnly: false - subPath: /some/other/sub/path - asserts: - - contains: - path: spec.template.spec.containers[0].volumeMounts - content: - name: device-0 - mountPath: /host/dev/something - - notContains: - path: spec.template.spec.containers[0].volumeMounts - content: - name: some-volume - - notContains: - path: spec.template.spec.containers[0].volumeMounts - content: - name: some-other-volume - - contains: - path: spec.template.spec.initContainers[0].volumeMounts - content: - name: some-volume - mountPath: /some/path - readOnly: false - subPath: /some/sub/path - - contains: - path: spec.template.spec.initContainers[0].volumeMounts - content: - name: some-other-volume - mountPath: /some/other/path - readOnly: false - subPath: /some/other/sub/path - - contains: - path: spec.template.spec.initContainers[0].volumeMounts - content: - name: device-some-name-0 - mountPath: /host/dev/usb - - contains: - path: spec.template.spec.initContainers[0].volumeMounts - content: - name: device-some-name-1 - mountPath: /host/dev/serial - - - it: should pass with disabled install container from tpl - documentIndex: *deploymentDoc - set: - flag: false - installContainers: - some-name: - enabled: "{{ .Values.flag }}" - asserts: - - isNull: - path: spec.template.spec.initContainers diff --git a/.to_be_deleted/common-test/tests/initcontainers_in_deployment/system_containers_in_deployment_install_copy.yaml b/.to_be_deleted/common-test/tests/initcontainers_in_deployment/system_containers_in_deployment_install_copy.yaml deleted file mode 100644 index e574ff36ea..0000000000 --- a/.to_be_deleted/common-test/tests/initcontainers_in_deployment/system_containers_in_deployment_install_copy.yaml +++ /dev/null @@ -1,1225 +0,0 @@ -suite: systemContainer in deployment test -templates: - - common.yaml -tests: - - it: should pass with default values - documentIndex: &deploymentDoc 0 - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Deployment - - - it: should pass with image defined in system container - documentIndex: *deploymentDoc - set: - image: - repository: some-repo - tag: some-tag - pullPolicy: Always - systemImage: - repository: some-repo-system - tag: some-tag-system - pullPolicy: Never - systemContainers: - some-name: - imageSelector: systemImage - pullPolicy: Never - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - image: some-repo:some-tag - imagePullPolicy: Always - - isSubset: - path: spec.template.spec.initContainers[0] - content: - image: some-repo-system:some-tag-system - imagePullPolicy: Never - - - it: should pass with image defined in multiple system container - documentIndex: *deploymentDoc - set: - image: - repository: some-repo - tag: some-tag - pullPolicy: Always - systemImage: - repository: some-repo-system - tag: some-tag-system - pullPolicy: Never - systemImage2: - repository: some-repo-system2 - tag: some-tag-system2 - pullPolicy: IfNotPresent - systemContainers: - some-name: - imageSelector: systemImage - pullPolicy: Never - some-name2: - imageSelector: systemImage2 - pullPolicy: Never - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - image: some-repo:some-tag - imagePullPolicy: Always - - isSubset: - path: spec.template.spec.initContainers[0] - content: - image: some-repo-system:some-tag-system - imagePullPolicy: Never - - isSubset: - path: spec.template.spec.initContainers[1] - content: - image: some-repo-system2:some-tag-system2 - imagePullPolicy: IfNotPresent - - - it: should pass with enabled false from tpl defined in system container - documentIndex: *deploymentDoc - set: - flag: false - systemContainers: - some-name: - enabled: "{{ .Values.flag }}" - tty: true - stdin: true - asserts: - - isNotNull: - path: spec.template.spec.containers[0] - - isNull: - path: spec.template.spec.initContainers - - - it: should pass with enabled true from tpl defined in system container - documentIndex: *deploymentDoc - set: - flag: true - systemContainers: - some-name: - enabled: "{{ .Values.flag }}" - tty: true - stdin: true - asserts: - - isNotNull: - path: spec.template.spec.containers[0] - - isNotNull: - path: spec.template.spec.initContainers - - - it: should pass with tty and stdin defined in system container - documentIndex: *deploymentDoc - set: - systemContainers: - some-name: - tty: true - stdin: true - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - tty: false - stdin: false - - isSubset: - path: spec.template.spec.initContainers[0] - content: - tty: true - stdin: true - - - it: should pass with command and args defined in system container - documentIndex: *deploymentDoc - set: - port: 8080 - entrypoint: ./run.sh - systemContainers: - some-name: - command: - - /bin/sh - - -c - - | - {{ .Values.entrypoint }} - args: - - --port - - "{{ .Values.port }}" - extraArgs: - - --data_dir - - /data - asserts: - - isNotSubset: - path: spec.template.spec.containers[0] - content: - command: - - /bin/sh - - -c - - | - ./run.sh - args: - - --port - - "8080" - - --data_dir - - /data - - isSubset: - path: spec.template.spec.initContainers[0] - content: - command: - - /bin/sh - - -c - - | - ./run.sh - args: - - --port - - "8080" - - --data_dir - - /data - - - it: should pass with termination defined in system container - documentIndex: *deploymentDoc - set: - systemContainers: - some-name: - termination: - messagePath: somePath - messagePolicy: File - asserts: - - isNotSubset: - path: spec.template.spec.containers[0] - content: - terminationMessagePath: somePath - terminationMessagePolicy: File - - isSubset: - path: spec.template.spec.initContainers[0] - content: - terminationMessagePath: somePath - terminationMessagePolicy: File - - - it: should pass with resources inherited from main container and modified in system container - documentIndex: *deploymentDoc - set: - resources: - requests: - cpu: 25m - memory: 80Mi - systemContainers: - some-name: - resources: - inherit: true - limits: - cpu: 1000m - memory: 1Gi - requests: - memory: 120Mi - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - resources: - limits: - cpu: 4000m - memory: 8Gi - requests: - cpu: 25m - memory: 80Mi - - isSubset: - path: spec.template.spec.initContainers[0] - content: - resources: - limits: - cpu: 1000m - memory: 1Gi - requests: - cpu: 25m - memory: 120Mi - - - it: should pass with resources defined in system container - documentIndex: *deploymentDoc - set: - systemContainers: - some-name: - nvidiaCaps: - - compute - scaleGPU: - gpu.intel.com/i915: "1" - resources: - limits: - cpu: 3000m - memory: 4Gi - requests: - cpu: 20m - memory: 100Mi - asserts: - - equal: - path: spec.template.spec.securityContext - value: - fsGroup: 568 - fsGroupChangePolicy: OnRootMismatch - supplementalGroups: - - 44 - - isSubset: - path: spec.template.spec.containers[0] - content: - resources: - limits: - cpu: 4000m - memory: 8Gi - requests: - cpu: 10m - memory: 50Mi - - isSubset: - path: spec.template.spec.initContainers[0] - content: - resources: - limits: - cpu: 3000m - memory: 4Gi - gpu.intel.com/i915: "1" - requests: - cpu: 20m - memory: 100Mi - - notContains: - path: spec.template.spec.containers[0].env - content: - name: NVIDIA_DRIVER_CAPABILITIES - value: all - - contains: - path: spec.template.spec.initContainers[0].env - content: - name: NVIDIA_DRIVER_CAPABILITIES - value: compute - - - it: should pass with envFrom defined in system container - documentIndex: *deploymentDoc - set: - some_name: a_name - some_name2: a_name2 - systemContainers: - some-name: - envFrom: - - configMapRef: - name: "{{ .Values.some_name }}" - - configMapRef: - name: "{{ .Values.some_name2 }}" - asserts: - - isNotSubset: - path: spec.template.spec.containers[0] - content: - envFrom: - - configMapRef: - name: a_name - - configMapRef: - name: a_name2 - - isSubset: - path: spec.template.spec.initContainers[0] - content: - envFrom: - - configMapRef: - name: a_name - - configMapRef: - name: a_name2 - - - it: should pass with env and envList defined in system container - documentIndex: *deploymentDoc - set: - some_value: value - some_value2: value2 - some_value3: value3 - some_value4: value4 - systemContainers: - some-name: - env: - var1: "{{ .Values.some_value }}" - var2: "{{ .Values.some_value2 }}" - var5: - secretKeyRef: - key: key - name: name - envList: - - name: var3 - value: "{{ .Values.some_value3 }}" - - name: var4 - value: "{{ .Values.some_value4 }}" - asserts: - - isNotSubset: - path: spec.template.spec.containers[0] - content: - env: - - name: var1 - value: value - - name: var2 - value: value2 - - name: var3 - value: value3 - - name: var4 - value: value4 - - isSubset: - path: spec.template.spec.initContainers[0] - content: - env: - - name: TZ - value: UTC - - name: UMASK - value: "002" - - name: UMASK_SET - value: "002" - - name: NVIDIA_VISIBLE_DEVICES - value: void - - name: S6_READ_ONLY_ROOT - value: "1" - - name: var1 - value: value - - name: var2 - value: value2 - - name: var5 - valueFrom: - secretKeyRef: - name: name - key: key - - name: var3 - value: value3 - - name: var4 - value: value4 - - - it: should pass with changed PUID/UMASK - documentIndex: *deploymentDoc - set: - systemContainers: - some-name: - securityContext: - runAsUser: 0 - runAsNonRoot: false - UMASK: "003" - PUID: 1000 - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - env: - - name: TZ - value: UTC - - name: UMASK - value: "002" - - name: UMASK_SET - value: "002" - - name: NVIDIA_VISIBLE_DEVICES - value: void - - name: S6_READ_ONLY_ROOT - value: "1" - - isSubset: - path: spec.template.spec.initContainers[0] - content: - env: - - name: TZ - value: UTC - - name: UMASK - value: "003" - - name: UMASK_SET - value: "003" - - name: NVIDIA_VISIBLE_DEVICES - value: void - - name: PUID - value: "1000" - - name: USER_ID - value: "1000" - - name: UID - value: "1000" - - name: PGID - value: "568" - - name: GROUP_ID - value: "568" - - name: GID - value: "568" - - name: S6_READ_ONLY_ROOT - value: "1" - - - it: should pass with disabled injectFixedEnvs - documentIndex: *deploymentDoc - set: - systemContainers: - some-name: - securityContext: - runAsUser: 0 - runAsNonRoot: false - injectFixedEnvs: false - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - env: - - name: TZ - value: UTC - - name: UMASK - value: "002" - - name: UMASK_SET - value: "002" - - name: NVIDIA_VISIBLE_DEVICES - value: void - - name: S6_READ_ONLY_ROOT - value: "1" - - isNull: - path: spec.template.spec.initContainers[0].env - - - it: should fail with lifecycle defined in system container - set: - systemContainers: - some-name: - lifecycle: - asserts: - - failedTemplate: - errorMessage: Init/System/Install/Upgrade/(Cron)Job Container (RELEASE-NAME-common-test-system-some-name) do not support lifecycle hooks - - - it: should fail with env trying to override fixedEnvs in system container - set: - systemContainers: - some-name: - env: - TZ: something - asserts: - - failedTemplate: - errorMessage: Environment Variable (TZ) on container (RELEASE-NAME-common-test-system-some-name) is set more than once. [to (UTC) on (fixedEnv)] and [to (something) on (env)] - - - it: should fail with env trying to override configmap in system container - set: - configmap: - some-confmap: - enabled: true - parseAsEnv: true - content: - TZ: something - systemContainers: - some-name: - envFrom: - - configMapRef: - name: '{{ include "ix.v1.common.names.fullname" . }}-some-confmap' - asserts: - - failedTemplate: - errorMessage: Environment Variable (TZ) on container (RELEASE-NAME-common-test-system-some-name) is set more than once. [to (UTC) on (fixedEnv)] and [to (something) on (configmap-RELEASE-NAME-common-test-some-confmap)] - - - it: should fail with env trying to override secret in system container - set: - secret: - some-secret: - enabled: true - parseAsEnv: true - content: - TZ: something - systemContainers: - some-name: - envFrom: - - secretRef: - name: '{{ include "ix.v1.common.names.fullname" . }}-some-secret' - asserts: - - failedTemplate: - errorMessage: Environment Variable (TZ) on container (RELEASE-NAME-common-test-system-some-name) is set more than once. [to (UTC) on (fixedEnv)] and [to (something) on (secret-RELEASE-NAME-common-test-some-secret)] - - - it: should pass with securityContext inherited - documentIndex: *deploymentDoc - set: - securityContext: - runAsUser: 0 - runAsGroup: 0 - runAsNonRoot: false - readOnlyRootFilesystem: false - privileged: true - allowPrivilegeEscalation: true - capabilities: - add: - - Something - drop: - - Something_Else - systemContainers: - some_container: - imageSelector: image - securityContext: - inherit: true - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - securityContext: - runAsUser: 0 - runAsGroup: 0 - runAsNonRoot: false - readOnlyRootFilesystem: false - privileged: true - allowPrivilegeEscalation: true - capabilities: - add: - - Something - drop: - - Something_Else - - isSubset: - path: spec.template.spec.initContainers[0] - content: - securityContext: - allowPrivilegeEscalation: true - capabilities: - add: - - Something - drop: - - Something_Else - privileged: true - readOnlyRootFilesystem: false - runAsGroup: 0 - runAsNonRoot: false - runAsUser: 0 - - - it: should pass with deviceList defined in system container - documentIndex: *deploymentDoc - set: - systemContainers: - some_container: - deviceList: - - enabled: true - mountPath: /host/dev/usb - hostPath: /dev/usb - securityContext: - inherit: true - asserts: - - equal: - path: spec.template.spec.securityContext - value: - fsGroup: 568 - fsGroupChangePolicy: OnRootMismatch - supplementalGroups: - - 5 - - 10 - - 20 - - 24 - - isSubset: - path: spec.template.spec.containers[0] - content: - securityContext: - allowPrivilegeEscalation: false - capabilities: - add: [] - drop: - - ALL - privileged: false - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - isSubset: - path: spec.template.spec.initContainers[0] - content: - securityContext: - allowPrivilegeEscalation: true - capabilities: - add: [] - drop: - - ALL - privileged: true - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - - it: should pass with deviceList and scaleGPU defined in system container - documentIndex: *deploymentDoc - set: - systemContainers: - some_container: - scaleGPU: - nvidia: something - deviceList: - - enabled: true - mountPath: /host/dev/usb - hostPath: /dev/usb - securityContext: - inherit: true - asserts: - - equal: - path: spec.template.spec.securityContext - value: - fsGroup: 568 - fsGroupChangePolicy: OnRootMismatch - supplementalGroups: - - 5 - - 10 - - 20 - - 24 - - 44 - - isSubset: - path: spec.template.spec.containers[0] - content: - securityContext: - allowPrivilegeEscalation: false - capabilities: - add: [] - drop: - - ALL - privileged: false - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - isSubset: - path: spec.template.spec.initContainers[0] - content: - securityContext: - allowPrivilegeEscalation: true - capabilities: - add: [] - drop: - - ALL - privileged: true - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - - it: should pass with port <=1024 defined in system container - documentIndex: *deploymentDoc - set: - systemContainers: - some_container: - ports: - - name: http - containerPort: 80 - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - securityContext: - allowPrivilegeEscalation: false - capabilities: - add: [] - drop: - - ALL - privileged: false - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - isSubset: - path: spec.template.spec.initContainers[0] - content: - securityContext: - allowPrivilegeEscalation: false - capabilities: - add: - - NET_BIND_SERVICE - drop: - - ALL - privileged: false - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - - it: should pass with securityContext default - documentIndex: *deploymentDoc - set: - systemContainers: - some_container: - imageSelector: image - securityContext: - inherit: true - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - securityContext: - allowPrivilegeEscalation: false - capabilities: - add: [] - drop: - - ALL - privileged: false - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - isSubset: - path: spec.template.spec.initContainers[0] - content: - securityContext: - allowPrivilegeEscalation: false - capabilities: - add: [] - drop: - - ALL - privileged: false - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - - it: should pass with securityContext changed - documentIndex: *deploymentDoc - set: - systemContainers: - some_container: - imageSelector: image - securityContext: - runAsUser: 0 - runAsGroup: 0 - runAsNonRoot: false - readOnlyRootFilesystem: false - privileged: true - allowPrivilegeEscalation: true - capabilities: - add: - - Something - drop: - - Something_Else - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - securityContext: - allowPrivilegeEscalation: false - capabilities: - add: [] - drop: - - ALL - privileged: false - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - isSubset: - path: spec.template.spec.initContainers[0] - content: - securityContext: - allowPrivilegeEscalation: true - capabilities: - add: - - Something - drop: - - Something_Else - privileged: true - readOnlyRootFilesystem: false - runAsGroup: 0 - runAsNonRoot: false - runAsUser: 0 - - - it: should pass with securityContext with some values changed - documentIndex: *deploymentDoc - set: - systemContainers: - some_container: - imageSelector: image - securityContext: - runAsUser: 0 - runAsGroup: 0 - runAsNonRoot: false - capabilities: - add: - - Something - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - securityContext: - allowPrivilegeEscalation: false - capabilities: - add: [] - drop: - - ALL - privileged: false - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - isSubset: - path: spec.template.spec.initContainers[0] - content: - securityContext: - allowPrivilegeEscalation: false - capabilities: - add: - - Something - drop: - - ALL - privileged: false - readOnlyRootFilesystem: true - runAsGroup: 0 - runAsNonRoot: false - runAsUser: 0 - - - it: should pass with securityContext with inherit and at least one value changed - documentIndex: *deploymentDoc - set: - securityContext: - privileged: true - allowPrivilegeEscalation: true - capabilities: - drop: - - something_else - systemContainers: - some_container: - imageSelector: image - securityContext: - inherit: true - runAsNonRoot: false - runAsUser: 0 - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - securityContext: - allowPrivilegeEscalation: true - capabilities: - add: [] - drop: - - something_else - privileged: true - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - isSubset: - path: spec.template.spec.initContainers[0] - content: - securityContext: - allowPrivilegeEscalation: true - capabilities: - add: [] - drop: - - something_else - privileged: true - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: false - runAsUser: 0 - - - it: should fail with probes in system container - set: - systemContainers: - some-name: - probes: - liveness: - enabled: true - asserts: - - failedTemplate: - errorMessage: Init/System/Install/Upgrade/(Cron)Job Container (RELEASE-NAME-common-test-system-some-name) do not support probes - - - it: should fail with invalid protocol in ports in system container - set: - systemContainers: - some-name: - ports: - - containerPort: 5678 - protocol: invalid-proto - name: tcp-port - asserts: - - failedTemplate: - errorMessage: Invalid (invalid-proto) in port (tcp-port) in (RELEASE-NAME-common-test-system-some-name) container. Valid protocols are TCP and UDP. - - - it: should fail without name in ports in system container - set: - systemContainers: - some-name: - ports: - - containerPort: 5678 - protocol: TCP - name: "" - asserts: - - failedTemplate: - errorMessage: is required in all in (RELEASE-NAME-common-test-system-some-name) container. - - - it: should fail without containerPort in ports in system container - set: - systemContainers: - some-name: - ports: - - containerPort: "" - name: tcp-port - asserts: - - failedTemplate: - errorMessage: is required in port (tcp-port) in (RELEASE-NAME-common-test-system-some-name) container. - - - it: should fail with non-int containerPort in ports in system container - set: - systemContainers: - some-name: - ports: - - containerPort: not-int - name: tcp-port - asserts: - - failedTemplate: - errorMessage: Invalid (not-int) in port (tcp-port) in (RELEASE-NAME-common-test-system-some-name) container. Must be an int. - - - it: should fail with non-int hostPort in ports in system container - set: - systemContainers: - some-name: - ports: - - containerPort: 1234 - hostPort: not-int - name: tcp-port - asserts: - - failedTemplate: - errorMessage: Invalid (not-int) in port (tcp-port) in (RELEASE-NAME-common-test-system-some-name) container. Must be an int. - - - it: should pass without protocol in ports in system container - documentIndex: *deploymentDoc - set: - systemContainers: - some-name: - ports: - - containerPort: 5678 - name: tcp-port - asserts: - - isSubset: - path: spec.template.spec.initContainers[0] - content: - ports: - - containerPort: 5678 - protocol: TCP - name: tcp-port - - - it: should pass with ports defined in system container - documentIndex: *deploymentDoc - set: - systemContainers: - some-name: - ports: - - containerPort: 5678 - protocol: TCP - name: tcp-port - - containerPort: 1234 - protocol: UDP - name: udp-port - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - ports: - - containerPort: 65535 - protocol: TCP - name: main - - isSubset: - path: spec.template.spec.initContainers[0] - content: - ports: - - containerPort: 5678 - protocol: TCP - name: tcp-port - - containerPort: 1234 - protocol: UDP - name: udp-port - - - it: should fail without trying to mount a non existent volume in volumeMounts defined in system container - set: - systemContainers: - some-name: - volumeMounts: - - name: some-volume - mountPath: /some/path - asserts: - - failedTemplate: - errorMessage: You are trying to mount a volume that does not exist (some-volume). Please define the volume in . - - - it: should fail without name in volumeMounts defined in system container - set: - systemContainers: - some-name: - volumeMounts: - - name: - mountPath: /some/path - readOnly: false - subPath: /some/sub/path - asserts: - - failedTemplate: - errorMessage: is required in volumeMounts in init/system/install/upgrade/additional containers. - - - it: should pass with volumeMounts defined in system container - documentIndex: *deploymentDoc - set: - persistence: - some-volume: - enabled: true - noMount: true - type: emptyDir - some-other-volume: - enabled: true - noMount: true - type: emptyDir - systemContainers: - some-name: - volumeMounts: - - name: some-volume - mountPath: /some/path - readOnly: false - subPath: /some/sub/path - - name: some-other-volume - mountPath: /some/other/path - readOnly: false - subPath: /some/other/sub/path - asserts: - - notContains: - path: spec.template.spec.containers[0].volumeMounts - content: - name: some-volume - - notContains: - path: spec.template.spec.containers[0].volumeMounts - content: - name: some-other-volume - - contains: - path: spec.template.spec.initContainers[0].volumeMounts - content: - name: some-volume - mountPath: /some/path - readOnly: false - subPath: /some/sub/path - - contains: - path: spec.template.spec.initContainers[0].volumeMounts - content: - name: some-other-volume - mountPath: /some/other/path - readOnly: false - subPath: /some/other/sub/path - - - it: should pass with volumeMounts inherit all in system container - documentIndex: *deploymentDoc - set: - persistence: - some-volume: - enabled: true - noMount: true - mountPath: /some/path - type: emptyDir - some-other-volume: - enabled: true - noMount: true - mountPath: /some/other/path - type: emptyDir - systemContainers: - some-name: - volumeMounts: - - inherit: all - asserts: - - notContains: - path: spec.template.spec.containers[0].volumeMounts - content: - name: some-volume - - notContains: - path: spec.template.spec.containers[0].volumeMounts - content: - name: some-other-volume - - contains: - path: spec.template.spec.initContainers[0].volumeMounts - content: - name: some-other-volume - mountPath: /some/other/path - - contains: - path: spec.template.spec.initContainers[0].volumeMounts - content: - name: some-volume - mountPath: /some/path - - - it: should pass with volumeMounts inherit skipNoMount in system container - documentIndex: *deploymentDoc - set: - persistence: - some-volume: - enabled: true - noMount: true - mountPath: /some/path - type: emptyDir - some-other-volume: - enabled: true - type: emptyDir - mountPath: /some/other/path - systemContainers: - some-name: - volumeMounts: - - inherit: skipNoMount - asserts: - - contains: - path: spec.template.spec.containers[0].volumeMounts - content: - mountPath: /some/other/path - name: some-other-volume - - contains: - path: spec.template.spec.initContainers[0].volumeMounts - content: - name: some-other-volume - mountPath: /some/other/path - - - it: should pass with deviceList and volumeMounts defined in system container - documentIndex: *deploymentDoc - set: - deviceList: - - enabled: true - type: hostPath - mountPath: /host/dev/something - hostPath: /dev/something - persistence: - some-volume: - enabled: true - noMount: true - type: emptyDir - some-other-volume: - enabled: true - noMount: true - type: emptyDir - systemContainers: - some-name: - deviceList: - - enabled: true - type: hostPath - mountPath: /host/dev/usb - hostPath: /dev/usb - - enabled: true - type: hostPath - mountPath: /host/dev/serial - hostPath: /dev/serial - volumeMounts: - - name: some-volume - mountPath: /some/path - readOnly: false - subPath: /some/sub/path - - name: some-other-volume - mountPath: /some/other/path - readOnly: false - subPath: /some/other/sub/path - asserts: - - contains: - path: spec.template.spec.containers[0].volumeMounts - content: - name: device-0 - mountPath: /host/dev/something - - notContains: - path: spec.template.spec.containers[0].volumeMounts - content: - name: some-volume - - notContains: - path: spec.template.spec.containers[0].volumeMounts - content: - name: some-other-volume - - contains: - path: spec.template.spec.initContainers[0].volumeMounts - content: - name: some-volume - mountPath: /some/path - readOnly: false - subPath: /some/sub/path - - contains: - path: spec.template.spec.initContainers[0].volumeMounts - content: - name: some-other-volume - mountPath: /some/other/path - readOnly: false - subPath: /some/other/sub/path - - contains: - path: spec.template.spec.initContainers[0].volumeMounts - content: - name: device-some-name-0 - mountPath: /host/dev/usb - - contains: - path: spec.template.spec.initContainers[0].volumeMounts - content: - name: device-some-name-1 - mountPath: /host/dev/serial - - - it: should pass with disabled system container from tpl - documentIndex: *deploymentDoc - set: - flag: false - systemContainers: - some-name: - enabled: "{{ .Values.flag }}" - asserts: - - isNull: - path: spec.template.spec.initContainers diff --git a/.to_be_deleted/common-test/tests/initcontainers_in_deployment/upgrade_containers_in_deployment_test.yaml b/.to_be_deleted/common-test/tests/initcontainers_in_deployment/upgrade_containers_in_deployment_test.yaml deleted file mode 100644 index 00e930bffe..0000000000 --- a/.to_be_deleted/common-test/tests/initcontainers_in_deployment/upgrade_containers_in_deployment_test.yaml +++ /dev/null @@ -1,1242 +0,0 @@ - -suite: upgradeContainer in deployment test -templates: - - common.yaml -release: - upgrade: true -tests: - - it: should pass with default values - documentIndex: &deploymentDoc 0 - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Deployment - - - it: should pass with image defined in upgrade container - documentIndex: *deploymentDoc - set: - image: - repository: some-repo - tag: some-tag - pullPolicy: Always - upgradeImage: - repository: some-repo-upgrade - tag: some-tag-upgrade - pullPolicy: Never - upgradeContainers: - some-name: - imageSelector: upgradeImage - pullPolicy: Never - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - image: some-repo:some-tag - imagePullPolicy: Always - - isSubset: - path: spec.template.spec.initContainers[0] - content: - image: some-repo-upgrade:some-tag-upgrade - imagePullPolicy: Never - - - it: should pass with image defined in multiple upgrade container - documentIndex: *deploymentDoc - set: - image: - repository: some-repo - tag: some-tag - pullPolicy: Always - initImage: - repository: some-repo-init - tag: some-tag-init - pullPolicy: Never - upgradeImage: - repository: some-repo-upgrade - tag: some-tag-upgrade - pullPolicy: Never - upgradeImage2: - repository: some-repo-upgrade2 - tag: some-tag-upgrade2 - pullPolicy: IfNotPresent - upgradeContainers: - some-name: - imageSelector: upgradeImage - pullPolicy: Never - some-name2: - imageSelector: upgradeImage2 - pullPolicy: Never - initContainers: - some-name3: - imageSelector: initImage - pullPolicy: Never - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - image: some-repo:some-tag - imagePullPolicy: Always - - isSubset: - path: spec.template.spec.initContainers[0] - content: - image: some-repo-upgrade:some-tag-upgrade - imagePullPolicy: Never - - isSubset: - path: spec.template.spec.initContainers[1] - content: - image: some-repo-upgrade2:some-tag-upgrade2 - imagePullPolicy: IfNotPresent - - isSubset: - path: spec.template.spec.initContainers[2] - content: - image: some-repo-init:some-tag-init - imagePullPolicy: Never - - - it: should pass with enabled false from tpl defined in upgrade container - documentIndex: *deploymentDoc - set: - flag: false - upgradeContainers: - some-name: - enabled: "{{ .Values.flag }}" - tty: true - stdin: true - asserts: - - isNotNull: - path: spec.template.spec.containers[0] - - isNull: - path: spec.template.spec.initContainers - - - it: should pass with enabled true from tpl defined in upgrade container - documentIndex: *deploymentDoc - set: - flag: true - upgradeContainers: - some-name: - enabled: "{{ .Values.flag }}" - tty: true - stdin: true - asserts: - - isNotNull: - path: spec.template.spec.containers[0] - - isNotNull: - path: spec.template.spec.initContainers - - - it: should pass with tty and stdin defined in upgrade container - documentIndex: *deploymentDoc - set: - upgradeContainers: - some-name: - tty: true - stdin: true - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - tty: false - stdin: false - - isSubset: - path: spec.template.spec.initContainers[0] - content: - tty: true - stdin: true - - - it: should pass with command and args defined in upgrade container - documentIndex: *deploymentDoc - set: - port: 8080 - entrypoint: ./run.sh - upgradeContainers: - some-name: - command: - - /bin/sh - - -c - - | - {{ .Values.entrypoint }} - args: - - --port - - "{{ .Values.port }}" - extraArgs: - - --data_dir - - /data - asserts: - - isNotSubset: - path: spec.template.spec.containers[0] - content: - command: - - /bin/sh - - -c - - | - ./run.sh - args: - - --port - - "8080" - - --data_dir - - /data - - isSubset: - path: spec.template.spec.initContainers[0] - content: - command: - - /bin/sh - - -c - - | - ./run.sh - args: - - --port - - "8080" - - --data_dir - - /data - - - it: should pass with termination defined in upgrade container - documentIndex: *deploymentDoc - set: - upgradeContainers: - some-name: - termination: - messagePath: somePath - messagePolicy: File - asserts: - - isNotSubset: - path: spec.template.spec.containers[0] - content: - terminationMessagePath: somePath - terminationMessagePolicy: File - - isSubset: - path: spec.template.spec.initContainers[0] - content: - terminationMessagePath: somePath - terminationMessagePolicy: File - - - it: should pass with resources inherited from main container and modified in upgrade container - documentIndex: *deploymentDoc - set: - resources: - requests: - cpu: 25m - memory: 80Mi - upgradeContainers: - some-name: - resources: - inherit: true - limits: - cpu: 1000m - memory: 1Gi - requests: - memory: 120Mi - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - resources: - limits: - cpu: 4000m - memory: 8Gi - requests: - cpu: 25m - memory: 80Mi - - isSubset: - path: spec.template.spec.initContainers[0] - content: - resources: - limits: - cpu: 1000m - memory: 1Gi - requests: - cpu: 25m - memory: 120Mi - - - it: should pass with resources defined in upgrade container - documentIndex: *deploymentDoc - set: - upgradeContainers: - some-name: - nvidiaCaps: - - compute - scaleGPU: - gpu.intel.com/i915: "1" - resources: - limits: - cpu: 3000m - memory: 4Gi - requests: - cpu: 20m - memory: 100Mi - asserts: - - equal: - path: spec.template.spec.securityContext - value: - fsGroup: 568 - fsGroupChangePolicy: OnRootMismatch - supplementalGroups: - - 44 - - isSubset: - path: spec.template.spec.containers[0] - content: - resources: - limits: - cpu: 4000m - memory: 8Gi - requests: - cpu: 10m - memory: 50Mi - - isSubset: - path: spec.template.spec.initContainers[0] - content: - resources: - limits: - cpu: 3000m - memory: 4Gi - gpu.intel.com/i915: "1" - requests: - cpu: 20m - memory: 100Mi - - notContains: - path: spec.template.spec.containers[0].env - content: - name: NVIDIA_DRIVER_CAPABILITIES - value: all - - contains: - path: spec.template.spec.initContainers[0].env - content: - name: NVIDIA_DRIVER_CAPABILITIES - value: compute - - - it: should pass with envFrom defined in upgrade container - documentIndex: *deploymentDoc - set: - some_name: a_name - some_name2: a_name2 - upgradeContainers: - some-name: - envFrom: - - configMapRef: - name: "{{ .Values.some_name }}" - - configMapRef: - name: "{{ .Values.some_name2 }}" - asserts: - - isNotSubset: - path: spec.template.spec.containers[0] - content: - envFrom: - - configMapRef: - name: a_name - - configMapRef: - name: a_name2 - - isSubset: - path: spec.template.spec.initContainers[0] - content: - envFrom: - - configMapRef: - name: a_name - - configMapRef: - name: a_name2 - - - it: should pass with env and envList defined in upgrade container - documentIndex: *deploymentDoc - set: - some_value: value - some_value2: value2 - some_value3: value3 - some_value4: value4 - upgradeContainers: - some-name: - env: - var1: "{{ .Values.some_value }}" - var2: "{{ .Values.some_value2 }}" - var5: - secretKeyRef: - key: key - name: name - envList: - - name: var3 - value: "{{ .Values.some_value3 }}" - - name: var4 - value: "{{ .Values.some_value4 }}" - asserts: - - isNotSubset: - path: spec.template.spec.containers[0] - content: - env: - - name: var1 - value: value - - name: var2 - value: value2 - - name: var3 - value: value3 - - name: var4 - value: value4 - - isSubset: - path: spec.template.spec.initContainers[0] - content: - env: - - name: TZ - value: UTC - - name: UMASK - value: "002" - - name: UMASK_SET - value: "002" - - name: NVIDIA_VISIBLE_DEVICES - value: void - - name: S6_READ_ONLY_ROOT - value: "1" - - name: var1 - value: value - - name: var2 - value: value2 - - name: var5 - valueFrom: - secretKeyRef: - name: name - key: key - - name: var3 - value: value3 - - name: var4 - value: value4 - - - it: should pass with changed PUID/UMASK - documentIndex: *deploymentDoc - set: - upgradeContainers: - some-name: - securityContext: - runAsUser: 0 - runAsNonRoot: false - UMASK: "003" - PUID: 1000 - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - env: - - name: TZ - value: UTC - - name: UMASK - value: "002" - - name: UMASK_SET - value: "002" - - name: NVIDIA_VISIBLE_DEVICES - value: void - - name: S6_READ_ONLY_ROOT - value: "1" - - isSubset: - path: spec.template.spec.initContainers[0] - content: - env: - - name: TZ - value: UTC - - name: UMASK - value: "003" - - name: UMASK_SET - value: "003" - - name: NVIDIA_VISIBLE_DEVICES - value: void - - name: PUID - value: "1000" - - name: USER_ID - value: "1000" - - name: UID - value: "1000" - - name: PGID - value: "568" - - name: GROUP_ID - value: "568" - - name: GID - value: "568" - - name: S6_READ_ONLY_ROOT - value: "1" - - - it: should pass with disabled injectFixedEnvs - documentIndex: *deploymentDoc - set: - upgradeContainers: - some-name: - securityContext: - runAsUser: 0 - runAsNonRoot: false - injectFixedEnvs: false - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - env: - - name: TZ - value: UTC - - name: UMASK - value: "002" - - name: UMASK_SET - value: "002" - - name: NVIDIA_VISIBLE_DEVICES - value: void - - name: S6_READ_ONLY_ROOT - value: "1" - - isNull: - path: spec.template.spec.initContainers[0].env - - - it: should fail with lifecycle defined in upgrade container - set: - upgradeContainers: - some-name: - lifecycle: - asserts: - - failedTemplate: - errorMessage: Init/System/Install/Upgrade/(Cron)Job Container (RELEASE-NAME-common-test-upgrade-some-name) do not support lifecycle hooks - - - it: should fail with env trying to override fixedEnvs in upgrade container - set: - upgradeContainers: - some-name: - env: - TZ: something - asserts: - - failedTemplate: - errorMessage: Environment Variable (TZ) on container (RELEASE-NAME-common-test-upgrade-some-name) is set more than once. [to (UTC) on (fixedEnv)] and [to (something) on (env)] - - - it: should fail with env trying to override configmap in upgrade container - set: - configmap: - some-confmap: - enabled: true - parseAsEnv: true - content: - TZ: something - upgradeContainers: - some-name: - envFrom: - - configMapRef: - name: '{{ include "ix.v1.common.names.fullname" . }}-some-confmap' - asserts: - - failedTemplate: - errorMessage: Environment Variable (TZ) on container (RELEASE-NAME-common-test-upgrade-some-name) is set more than once. [to (UTC) on (fixedEnv)] and [to (something) on (configmap-RELEASE-NAME-common-test-some-confmap)] - - - it: should fail with env trying to override secret in upgrade container - set: - secret: - some-secret: - enabled: true - parseAsEnv: true - content: - TZ: something - upgradeContainers: - some-name: - envFrom: - - secretRef: - name: '{{ include "ix.v1.common.names.fullname" . }}-some-secret' - asserts: - - failedTemplate: - errorMessage: Environment Variable (TZ) on container (RELEASE-NAME-common-test-upgrade-some-name) is set more than once. [to (UTC) on (fixedEnv)] and [to (something) on (secret-RELEASE-NAME-common-test-some-secret)] - - - it: should pass with securityContext inherited - documentIndex: *deploymentDoc - set: - securityContext: - runAsUser: 0 - runAsGroup: 0 - runAsNonRoot: false - readOnlyRootFilesystem: false - privileged: true - allowPrivilegeEscalation: true - capabilities: - add: - - Something - drop: - - Something_Else - upgradeContainers: - some_container: - imageSelector: image - securityContext: - inherit: true - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - securityContext: - runAsUser: 0 - runAsGroup: 0 - runAsNonRoot: false - readOnlyRootFilesystem: false - privileged: true - allowPrivilegeEscalation: true - capabilities: - add: - - Something - drop: - - Something_Else - - isSubset: - path: spec.template.spec.initContainers[0] - content: - securityContext: - allowPrivilegeEscalation: true - capabilities: - add: - - Something - drop: - - Something_Else - privileged: true - readOnlyRootFilesystem: false - runAsGroup: 0 - runAsNonRoot: false - runAsUser: 0 - - - it: should pass with deviceList defined in upgrade container - documentIndex: *deploymentDoc - set: - upgradeContainers: - some_container: - deviceList: - - enabled: true - mountPath: /host/dev/usb - hostPath: /dev/usb - securityContext: - inherit: true - asserts: - - equal: - path: spec.template.spec.securityContext - value: - fsGroup: 568 - fsGroupChangePolicy: OnRootMismatch - supplementalGroups: - - 5 - - 10 - - 20 - - 24 - - isSubset: - path: spec.template.spec.containers[0] - content: - securityContext: - allowPrivilegeEscalation: false - capabilities: - add: [] - drop: - - ALL - privileged: false - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - isSubset: - path: spec.template.spec.initContainers[0] - content: - securityContext: - allowPrivilegeEscalation: true - capabilities: - add: [] - drop: - - ALL - privileged: true - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - - it: should pass with both deviceList and scaleGPU defined in upgrade container - documentIndex: *deploymentDoc - set: - upgradeContainers: - some_container: - scaleGPU: - nvidia: something - deviceList: - - enabled: true - mountPath: /host/dev/usb - hostPath: /dev/usb - securityContext: - inherit: true - asserts: - - equal: - path: spec.template.spec.securityContext - value: - fsGroup: 568 - fsGroupChangePolicy: OnRootMismatch - supplementalGroups: - - 5 - - 10 - - 20 - - 24 - - 44 - - isSubset: - path: spec.template.spec.containers[0] - content: - securityContext: - allowPrivilegeEscalation: false - capabilities: - add: [] - drop: - - ALL - privileged: false - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - isSubset: - path: spec.template.spec.initContainers[0] - content: - securityContext: - allowPrivilegeEscalation: true - capabilities: - add: [] - drop: - - ALL - privileged: true - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - - it: should pass with port <=1024 defined in upgrade container - documentIndex: *deploymentDoc - set: - upgradeContainers: - some_container: - ports: - - name: http - containerPort: 80 - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - securityContext: - allowPrivilegeEscalation: false - capabilities: - add: [] - drop: - - ALL - privileged: false - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - isSubset: - path: spec.template.spec.initContainers[0] - content: - securityContext: - allowPrivilegeEscalation: false - capabilities: - add: - - NET_BIND_SERVICE - drop: - - ALL - privileged: false - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - - it: should pass with securityContext default - documentIndex: *deploymentDoc - set: - upgradeContainers: - some_container: - imageSelector: image - securityContext: - inherit: true - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - securityContext: - allowPrivilegeEscalation: false - capabilities: - add: [] - drop: - - ALL - privileged: false - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - isSubset: - path: spec.template.spec.initContainers[0] - content: - securityContext: - allowPrivilegeEscalation: false - capabilities: - add: [] - drop: - - ALL - privileged: false - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - - it: should pass with securityContext changed - documentIndex: *deploymentDoc - set: - upgradeContainers: - some_container: - imageSelector: image - securityContext: - runAsUser: 0 - runAsGroup: 0 - runAsNonRoot: false - readOnlyRootFilesystem: false - privileged: true - allowPrivilegeEscalation: true - capabilities: - add: - - Something - drop: - - Something_Else - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - securityContext: - allowPrivilegeEscalation: false - capabilities: - add: [] - drop: - - ALL - privileged: false - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - isSubset: - path: spec.template.spec.initContainers[0] - content: - securityContext: - allowPrivilegeEscalation: true - capabilities: - add: - - Something - drop: - - Something_Else - privileged: true - readOnlyRootFilesystem: false - runAsGroup: 0 - runAsNonRoot: false - runAsUser: 0 - - - it: should pass with securityContext with some values changed - documentIndex: *deploymentDoc - set: - upgradeContainers: - some_container: - imageSelector: image - securityContext: - runAsUser: 0 - runAsGroup: 0 - runAsNonRoot: false - capabilities: - add: - - Something - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - securityContext: - allowPrivilegeEscalation: false - capabilities: - add: [] - drop: - - ALL - privileged: false - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - isSubset: - path: spec.template.spec.initContainers[0] - content: - securityContext: - allowPrivilegeEscalation: false - capabilities: - add: - - Something - drop: - - ALL - privileged: false - readOnlyRootFilesystem: true - runAsGroup: 0 - runAsNonRoot: false - runAsUser: 0 - - - it: should pass with securityContext with inherit and at least one value changed - documentIndex: *deploymentDoc - set: - securityContext: - privileged: true - allowPrivilegeEscalation: true - capabilities: - drop: - - something_else - upgradeContainers: - some_container: - imageSelector: image - securityContext: - inherit: true - runAsNonRoot: false - runAsUser: 0 - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - securityContext: - allowPrivilegeEscalation: true - capabilities: - add: [] - drop: - - something_else - privileged: true - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - isSubset: - path: spec.template.spec.initContainers[0] - content: - securityContext: - allowPrivilegeEscalation: true - capabilities: - add: [] - drop: - - something_else - privileged: true - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: false - runAsUser: 0 - - - it: should fail with probes in upgrade container - set: - upgradeContainers: - some-name: - probes: - liveness: - enabled: true - asserts: - - failedTemplate: - errorMessage: Init/System/Install/Upgrade/(Cron)Job Container (RELEASE-NAME-common-test-upgrade-some-name) do not support probes - - - it: should fail with invalid protocol in ports in upgrade container - set: - upgradeContainers: - some-name: - ports: - - containerPort: 5678 - protocol: invalid-proto - name: tcp-port - asserts: - - failedTemplate: - errorMessage: Invalid (invalid-proto) in port (tcp-port) in (RELEASE-NAME-common-test-upgrade-some-name) container. Valid protocols are TCP and UDP. - - - it: should fail without name in ports in upgrade container - set: - upgradeContainers: - some-name: - ports: - - containerPort: 5678 - protocol: TCP - name: "" - asserts: - - failedTemplate: - errorMessage: is required in all in (RELEASE-NAME-common-test-upgrade-some-name) container. - - - it: should fail without containerPort in ports in upgrade container - set: - upgradeContainers: - some-name: - ports: - - containerPort: "" - name: tcp-port - asserts: - - failedTemplate: - errorMessage: is required in port (tcp-port) in (RELEASE-NAME-common-test-upgrade-some-name) container. - - - it: should fail with non-int containerPort in ports in upgrade container - set: - upgradeContainers: - some-name: - ports: - - containerPort: not-int - name: tcp-port - asserts: - - failedTemplate: - errorMessage: Invalid (not-int) in port (tcp-port) in (RELEASE-NAME-common-test-upgrade-some-name) container. Must be an int. - - - it: should fail with non-int hostPort in ports in upgrade container - set: - upgradeContainers: - some-name: - ports: - - containerPort: 1234 - hostPort: not-int - name: tcp-port - asserts: - - failedTemplate: - errorMessage: Invalid (not-int) in port (tcp-port) in (RELEASE-NAME-common-test-upgrade-some-name) container. Must be an int. - - - it: should pass without protocol in ports in upgrade container - documentIndex: *deploymentDoc - set: - upgradeContainers: - some-name: - ports: - - containerPort: 5678 - name: tcp-port - asserts: - - isSubset: - path: spec.template.spec.initContainers[0] - content: - ports: - - containerPort: 5678 - protocol: TCP - name: tcp-port - - - it: should pass with ports defined in upgrade container - documentIndex: *deploymentDoc - set: - upgradeContainers: - some-name: - ports: - - containerPort: 5678 - protocol: TCP - name: tcp-port - - containerPort: 1234 - protocol: UDP - name: udp-port - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - ports: - - containerPort: 65535 - protocol: TCP - name: main - - isSubset: - path: spec.template.spec.initContainers[0] - content: - ports: - - containerPort: 5678 - protocol: TCP - name: tcp-port - - containerPort: 1234 - protocol: UDP - name: udp-port - - - it: should fail without trying to mount a non existent volume in volumeMounts defined in upgrade container - set: - upgradeContainers: - some-name: - volumeMounts: - - name: some-volume - mountPath: /some/path - asserts: - - failedTemplate: - errorMessage: You are trying to mount a volume that does not exist (some-volume). Please define the volume in . - - - it: should fail without name in volumeMounts defined in upgrade container - set: - upgradeContainers: - some-name: - volumeMounts: - - name: - mountPath: /some/path - readOnly: false - subPath: /some/sub/path - asserts: - - failedTemplate: - errorMessage: is required in volumeMounts in init/system/install/upgrade/additional containers. - - - it: should pass with volumeMounts defined in upgrade container - documentIndex: *deploymentDoc - set: - persistence: - some-volume: - enabled: true - noMount: true - type: emptyDir - some-other-volume: - enabled: true - noMount: true - type: emptyDir - upgradeContainers: - some-name: - volumeMounts: - - name: some-volume - mountPath: /some/path - readOnly: false - subPath: /some/sub/path - - name: some-other-volume - mountPath: /some/other/path - readOnly: false - subPath: /some/other/sub/path - asserts: - - notContains: - path: spec.template.spec.containers[0].volumeMounts - content: - name: some-volume - - notContains: - path: spec.template.spec.containers[0].volumeMounts - content: - name: some-other-volume - - contains: - path: spec.template.spec.initContainers[0].volumeMounts - content: - name: some-volume - mountPath: /some/path - readOnly: false - subPath: /some/sub/path - - contains: - path: spec.template.spec.initContainers[0].volumeMounts - content: - name: some-other-volume - mountPath: /some/other/path - readOnly: false - subPath: /some/other/sub/path - - - it: should pass with volumeMounts inherit all in upgrade container - documentIndex: *deploymentDoc - set: - persistence: - some-volume: - enabled: true - noMount: true - mountPath: /some/path - type: emptyDir - some-other-volume: - enabled: true - noMount: true - mountPath: /some/other/path - type: emptyDir - upgradeContainers: - some-name: - volumeMounts: - - inherit: all - asserts: - - notContains: - path: spec.template.spec.containers[0].volumeMounts - content: - name: some-volume - - notContains: - path: spec.template.spec.containers[0].volumeMounts - content: - name: some-other-volume - - contains: - path: spec.template.spec.initContainers[0].volumeMounts - content: - name: some-other-volume - mountPath: /some/other/path - - contains: - path: spec.template.spec.initContainers[0].volumeMounts - content: - name: some-volume - mountPath: /some/path - - - it: should pass with volumeMounts inherit skipNoMount in upgrade container - documentIndex: *deploymentDoc - set: - persistence: - some-volume: - enabled: true - noMount: true - mountPath: /some/path - type: emptyDir - some-other-volume: - enabled: true - type: emptyDir - mountPath: /some/other/path - upgradeContainers: - some-name: - volumeMounts: - - inherit: skipNoMount - asserts: - - contains: - path: spec.template.spec.containers[0].volumeMounts - content: - mountPath: /some/other/path - name: some-other-volume - - contains: - path: spec.template.spec.initContainers[0].volumeMounts - content: - name: some-other-volume - mountPath: /some/other/path - - - - it: should pass with deviceList and volumeMounts defined in upgrade container - documentIndex: *deploymentDoc - set: - deviceList: - - enabled: true - type: hostPath - mountPath: /host/dev/something - hostPath: /dev/something - persistence: - some-volume: - enabled: true - noMount: true - type: emptyDir - some-other-volume: - enabled: true - noMount: true - type: emptyDir - upgradeContainers: - some-name: - deviceList: - - enabled: true - type: hostPath - mountPath: /host/dev/usb - hostPath: /dev/usb - - enabled: true - type: hostPath - mountPath: /host/dev/serial - hostPath: /dev/serial - volumeMounts: - - name: some-volume - mountPath: /some/path - readOnly: false - subPath: /some/sub/path - - name: some-other-volume - mountPath: /some/other/path - readOnly: false - subPath: /some/other/sub/path - asserts: - - contains: - path: spec.template.spec.containers[0].volumeMounts - content: - name: device-0 - mountPath: /host/dev/something - - notContains: - path: spec.template.spec.containers[0].volumeMounts - content: - name: some-volume - - notContains: - path: spec.template.spec.containers[0].volumeMounts - content: - name: some-other-volume - - contains: - path: spec.template.spec.initContainers[0].volumeMounts - content: - name: some-volume - mountPath: /some/path - readOnly: false - subPath: /some/sub/path - - contains: - path: spec.template.spec.initContainers[0].volumeMounts - content: - name: some-other-volume - mountPath: /some/other/path - readOnly: false - subPath: /some/other/sub/path - - contains: - path: spec.template.spec.initContainers[0].volumeMounts - content: - name: device-some-name-0 - mountPath: /host/dev/usb - - contains: - path: spec.template.spec.initContainers[0].volumeMounts - content: - name: device-some-name-1 - mountPath: /host/dev/serial - - - it: should pass with disabled upgrade container from tpl - documentIndex: *deploymentDoc - set: - flag: false - upgradeContainers: - some-name: - enabled: "{{ .Values.flag }}" - asserts: - - isNull: - path: spec.template.spec.initContainers diff --git a/.to_be_deleted/common-test/tests/job_standalone/annotations_test.yaml b/.to_be_deleted/common-test/tests/job_standalone/annotations_test.yaml deleted file mode 100644 index c357f81e4a..0000000000 --- a/.to_be_deleted/common-test/tests/job_standalone/annotations_test.yaml +++ /dev/null @@ -1,54 +0,0 @@ -suite: job annotation test -templates: - - common.yaml -tests: - - it: should pass with default values - documentIndex: &jobDoc 2 - set: - controller.type: Job - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Job - - isNull: - path: metadata.annotations - - - it: should pass with controller and global annotations - documentIndex: *jobDoc - set: - some_key: some_value - controller: - type: Job - annotations: - controller_key: controller_value - controller_key2: "{{ .Values.some_key }}" - global: - annotations: - global_key: global_value - global_key2: "{{ .Values.some_key }}" - asserts: - - isSubset: - path: metadata.annotations - content: - controller_key: controller_value - controller_key2: some_value - global_key: global_value - global_key2: some_value - - isNull: - path: metadata.annotations.rollme - - - it: should pass with podAnnotations set - documentIndex: *jobDoc - set: - controller.type: Job - some_key: some_value2 - podAnnotations: - test: some_value - test2: "{{ .Values.some_key }}" - asserts: - - isSubset: - path: metadata.annotations - content: - test2: some_value2 - test: some_value diff --git a/.to_be_deleted/common-test/tests/job_standalone/controller_test.yaml b/.to_be_deleted/common-test/tests/job_standalone/controller_test.yaml deleted file mode 100644 index cabded266a..0000000000 --- a/.to_be_deleted/common-test/tests/job_standalone/controller_test.yaml +++ /dev/null @@ -1,36 +0,0 @@ -suite: job strategy test -templates: - - common.yaml -tests: - - it: should pass with strategy changed in job - documentIndex: &jobDoc 2 - set: - controller: - type: Job - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Job - - - it: should pass with job options changed in job - documentIndex: *jobDoc - set: - controller: - type: Job - backoffLimit: 11 - ttlSecondsAfterFinished: 22 - activeDeadlineSeconds: 33 - parallelism: 44 - completions: 55 - completionMode: Indexed - asserts: - - isSubset: - path: spec - content: - backoffLimit: 11 - ttlSecondsAfterFinished: 22 - activeDeadlineSeconds: 33 - parallelism: 44 - completions: 55 - completionMode: Indexed diff --git a/.to_be_deleted/common-test/tests/job_standalone/default_test.yaml b/.to_be_deleted/common-test/tests/job_standalone/default_test.yaml deleted file mode 100644 index ecd8643c30..0000000000 --- a/.to_be_deleted/common-test/tests/job_standalone/default_test.yaml +++ /dev/null @@ -1,135 +0,0 @@ -suite: job default test -templates: - - common.yaml -tests: - - it: should pass with controller set to Job - documentIndex: &jobDoc 2 - set: - controller.type: Job - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Job - - isAPIVersion: - of: batch/v1 - - equal: - path: spec.backoffLimit - value: 6 - - isNull: - path: spec.ttlSecondsAfterFinished - - isNull: - path: spec.activeDeadlineSeconds - - isNull: - path: spec.parallelism - - isNull: - path: spec.completions - - equal: - path: spec.completionMode - value: NonIndexed - - equal: - path: spec.template.spec.hostNetwork - value: false - - equal: - path: spec.template.spec.enableServiceLinks - value: false - - isNull: - path: spec.template.spec.serviceAccountName - - equal: - path: spec.template.spec.restartPolicy - value: Never - - isNull: - path: spec.template.spec.schedulerName - - isNull: - path: spec.template.spec.priorityClassName - - isNull: - path: spec.template.spec.hostname - - isNull: - path: spec.template.spec.dnsPolicy - - isNull: - path: spec.template.spec.dnsConfig - - isNull: - path: spec.template.spec.hostAliases - - isNull: - path: spec.template.spec.nodeSelector - - isNull: - path: spec.template.spec.tolerations - - isNull: - path: spec.template.spec.imagePullSecrets - - isNull: - path: spec.template.spec.runtimeClassName - - equal: - path: spec.template.spec.terminationGracePeriodSeconds - value: 10 - - equal: - path: spec.template.spec.containers[0].name - value: RELEASE-NAME-common-test-job-main - - equal: - path: spec.template.spec.containers[0].image - value: repo:tag - - isNull: - path: spec.template.spec.containers[0].command - - isNull: - path: spec.template.spec.containers[0].args - - equal: - path: spec.template.spec.containers[0].tty - value: false - - equal: - path: spec.template.spec.containers[0].stdin - value: false - - isNull: - path: spec.template.spec.containers[0].lifecycle - - isNull: - path: spec.template.spec.containers[0].terminationMessagePath - - isNull: - path: spec.template.spec.containers[0].terminationMessagePolicy - - equal: - path: spec.template.spec.securityContext - value: - fsGroup: 568 - fsGroupChangePolicy: OnRootMismatch - supplementalGroups: [] - - equal: - path: spec.template.spec.containers[0].securityContext - value: - allowPrivilegeEscalation: false - privileged: false - readOnlyRootFilesystem: true - runAsNonRoot: true - runAsUser: 568 - runAsGroup: 568 - capabilities: - add: [] - drop: - - ALL - - equal: - path: spec.template.spec.containers[0].env - value: - - name: TZ - value: UTC - - name: UMASK - value: "002" - - name: UMASK_SET - value: "002" - - name: NVIDIA_VISIBLE_DEVICES - value: void - - name: S6_READ_ONLY_ROOT - value: "1" - - equal: - path: spec.template.spec.containers[0].volumeMounts - value: - - mountPath: /shared - name: shared - - mountPath: /tmp - name: tmp - - mountPath: /var/logs - name: varlogs - - equal: - path: spec.template.spec.volumes - value: - - name: shared - emptyDir: {} - - name: tmp - emptyDir: {} - - name: varlogs - emptyDir: {} diff --git a/.to_be_deleted/common-test/tests/job_standalone/generic_test.yaml b/.to_be_deleted/common-test/tests/job_standalone/generic_test.yaml deleted file mode 100644 index 5dba87bf1e..0000000000 --- a/.to_be_deleted/common-test/tests/job_standalone/generic_test.yaml +++ /dev/null @@ -1,230 +0,0 @@ -suite: job generic test -templates: - - common.yaml -tests: - - it: should pass with controller set to Job - documentIndex: &jobDoc 2 - set: - controller: - type: Job - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Job - - isAPIVersion: - of: batch/v1 - - - it: should pass with podSecurityContext changed - documentIndex: *jobDoc - set: - controller: - type: Job - podSecurityContext: - fsGroup: 0 - fsGroupChangePolicy: Always - supplementalGroups: - - 1000 - asserts: - - equal: - path: spec.template.spec.securityContext - value: - fsGroup: 0 - fsGroupChangePolicy: Always - supplementalGroups: - - 1000 - - - it: should pass with podSecurityContext changed - documentIndex: *jobDoc - set: - controller: - type: Job - securityContext: - runAsUser: 1000 - runAsGroup: 1000 - capabilities: - add: - - something - asserts: - - equal: - path: spec.template.spec.containers[0].securityContext - value: - allowPrivilegeEscalation: false - privileged: false - readOnlyRootFilesystem: true - runAsNonRoot: true - runAsUser: 1000 - runAsGroup: 1000 - capabilities: - add: - - something - drop: - - ALL - - - it: should pass with multiple envs defined via tpl - documentIndex: *jobDoc - set: - controller: - type: Job - some_string: a_string - some_int: 123 - some_bool: false - env: - ENVVAR: "{{ .Values.some_string }}" - ENVVAR2: "{{ .Values.some_int }}" - ENVVAR3: "{{ .Values.some_bool }}" - asserts: - - equal: - path: spec.template.spec.containers[0].env - value: - - name: TZ - value: "UTC" - - name: UMASK - value: "002" - - name: UMASK_SET - value: "002" - - name: NVIDIA_VISIBLE_DEVICES - value: "void" - - name: S6_READ_ONLY_ROOT - value: "1" - - name: ENVVAR - value: "a_string" - - name: ENVVAR2 - value: "123" - - name: ENVVAR3 - value: "false" - - - it: should pass with addNvidiaRuntimeClass and nvidiaRuntimeClassName set - documentIndex: *jobDoc - set: - controller: - type: Job - scaleGPU: - something: blabla - global: - ixChartContext: - addNvidiaRuntimeClass: true - nvidiaRuntimeClassName: something - asserts: - - equal: - path: spec.template.spec.runtimeClassName - value: something - - - it: should pass with deviceList set - documentIndex: *jobDoc - set: - controller: - type: Job - deviceList: - - enabled: true - hostPath: /dev/usb - mountPath: /host/dev/usb - asserts: - - equal: - path: spec.template.spec.securityContext - value: - fsGroup: 568 - fsGroupChangePolicy: OnRootMismatch - supplementalGroups: - - 5 - - 10 - - 20 - - 24 - - - it: should pass with added persistence - documentIndex: &jobDoc 3 - set: - controller: - type: Job - persistence: - volume0: - type: pvc - enabled: true - mountPath: /pvc/path - volume1: - enabled: true - type: nfs - server: some.server.local - path: /nfs/path - mountPath: /nfs - volume2: - enabled: true - type: ixVolume - datasetName: ix-app - mountPath: /ixVol - volume3: - enabled: true - type: hostPath - hostPath: /mnt/pool/test - mountPath: /some/path - volume4: - enabled: true - type: emptyDir - medium: Memory - sizeLimit: 1Gi - mountPath: /temp-path - volume5: - type: secret - enabled: true - objectName: some_object_name - defaultMode: "0777" - mountPath: /secret-path - volume6: - type: configMap - enabled: true - objectName: some_object_name - defaultMode: "0777" - mountPath: /configmap-path - ixVolumes: - - /mnt/pool/ix-applications/ix-app - asserts: - - isKind: - of: Job - - hasDocuments: - count: 4 - - contains: - path: spec.template.spec.volumes - content: - name: volume0 - persistentVolumeClaim: - claimName: RELEASE-NAME-common-test-volume0 - - contains: - path: spec.template.spec.volumes - content: - name: volume1 - nfs: - path: /nfs/path - server: some.server.local - - contains: - path: spec.template.spec.volumes - content: - name: volume2 - hostPath: - path: /mnt/pool/ix-applications/ix-app - - contains: - path: spec.template.spec.volumes - content: - name: volume3 - hostPath: - path: /mnt/pool/test - - contains: - path: spec.template.spec.volumes - content: - name: volume4 - emptyDir: - medium: Memory - sizeLimit: 1Gi - - contains: - path: spec.template.spec.volumes - content: - name: volume5 - secret: - defaultMode: 511 - secretName: some_object_name - - contains: - path: spec.template.spec.volumes - content: - name: volume6 - configMap: - defaultMode: 511 - name: some_object_name diff --git a/.to_be_deleted/common-test/tests/job_standalone/label_test.yaml b/.to_be_deleted/common-test/tests/job_standalone/label_test.yaml deleted file mode 100644 index 10120c8782..0000000000 --- a/.to_be_deleted/common-test/tests/job_standalone/label_test.yaml +++ /dev/null @@ -1,72 +0,0 @@ -suite: job label test -templates: - - common.yaml -chart: - appVersion: &appVer v1.2.3 -tests: - - it: should pass with default values - documentIndex: &jobDoc 2 - set: - controller.type: Job - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Job - - equal: - path: metadata.labels - value: - app: common-test - app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: common-test - app.kubernetes.io/version: *appVer - helm-revision: "0" - helm.sh/chart: common-test-1.0.0 - release: RELEASE-NAME - - - it: should pass with controller and global labels - documentIndex: *jobDoc - set: - controller.type: Job - some_key: some_value - controller: - labels: - controller_key: controller_value - controller_key2: "{{ .Values.some_key }}" - global: - labels: - global_key: global_value - global_key2: "{{ .Values.some_key }}" - asserts: - - equal: - path: metadata.labels - value: - controller_key: controller_value - controller_key2: some_value - global_key: global_value - global_key2: some_value - app: common-test - app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: common-test - app.kubernetes.io/version: *appVer - helm-revision: "0" - helm.sh/chart: common-test-1.0.0 - release: RELEASE-NAME - - - it: should pass with podLabels set - documentIndex: *jobDoc - set: - controller.type: Job - some_key: some_value2 - podLabels: - test: some_value - test2: "{{ .Values.some_key }}" - asserts: - - equal: - path: metadata.labels.test2 - value: some_value2 - - equal: - path: metadata.labels.test - value: some_value diff --git a/.to_be_deleted/common-test/tests/job_standalone/names_test.yaml b/.to_be_deleted/common-test/tests/job_standalone/names_test.yaml deleted file mode 100644 index 18fc7a3b14..0000000000 --- a/.to_be_deleted/common-test/tests/job_standalone/names_test.yaml +++ /dev/null @@ -1,38 +0,0 @@ -suite: job name test -templates: - - common.yaml -tests: - - it: should pass with default values - documentIndex: &jobDoc 2 - set: - controller.type: Job - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Job - - equal: - path: metadata.name - value: RELEASE-NAME-common-test - - - it: should pass with nameOverride - documentIndex: *jobDoc - set: - controller.type: Job - nameOverride: overrodename - asserts: - - equal: - path: metadata.name - value: RELEASE-NAME-overrodename - - - it: should pass with global.nameOverride - documentIndex: *jobDoc - set: - controller.type: Job - nameOverride: overrodename - global: - nameOverride: globaloverrodename - asserts: - - equal: - path: metadata.name - value: RELEASE-NAME-globaloverrodename diff --git a/.to_be_deleted/common-test/tests/jobs/cronJobSpecContainer_test.yaml b/.to_be_deleted/common-test/tests/jobs/cronJobSpecContainer_test.yaml deleted file mode 100644 index 541c1eaf38..0000000000 --- a/.to_be_deleted/common-test/tests/jobs/cronJobSpecContainer_test.yaml +++ /dev/null @@ -1,1129 +0,0 @@ -suite: cron Job Containers test -templates: - - common.yaml -tests: - - it: should pass with default values - documentIndex: &deploymentDoc 0 - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Deployment - - - it: should pass with default in job - documentIndex: &cronJobDoc 3 - set: - jobs: - job-name: - enabled: true - cron: - enabled: true - schedule: "* * * * *" - podSpec: - containers: - main: - imageSelector: image - asserts: - - isKind: - of: CronJob - - isAPIVersion: - of: batch/v1 - - - it: should pass with default container - documentIndex: *cronJobDoc - set: - jobs: - job-name: - enabled: true - cron: - enabled: true - schedule: "* * * * *" - podSpec: - containers: - main: - imageSelector: image - asserts: - - equal: - path: spec.jobTemplate.spec.template.spec.containers[0] - value: - name: RELEASE-NAME-common-test-job-main - image: repo:tag - imagePullPolicy: IfNotPresent - tty: false - stdin: false - env: - - name: "TZ" - value: "UTC" - - name: "UMASK" - value: "002" - - name: "UMASK_SET" - value: "002" - - name: "NVIDIA_VISIBLE_DEVICES" - value: "void" - - name: "S6_READ_ONLY_ROOT" - value: "1" - securityContext: - runAsNonRoot: true - runAsUser: 568 - runAsGroup: 568 - readOnlyRootFilesystem: true - allowPrivilegeEscalation: false - privileged: false - capabilities: - add: [] - drop: - - "ALL" - resources: - requests: - cpu: 10m - memory: 50Mi - limits: - cpu: 4000m - memory: 8Gi - - - it: should pass with image defined in job container - documentIndex: *cronJobDoc - set: - jobImage: - repository: some-repo-job - tag: some-tag-job - pullPolicy: Never - jobs: - job-name: - enabled: true - cron: - enabled: true - schedule: "* * * * *" - podSpec: - containers: - main: - imageSelector: jobImage - asserts: - - isSubset: - path: spec.jobTemplate.spec.template.spec.containers[0] - content: - image: some-repo-job:some-tag-job - imagePullPolicy: Never - - - it: should pass with tty and stdin defined in job container - documentIndex: *cronJobDoc - set: - jobs: - job-name: - enabled: true - cron: - enabled: true - schedule: "* * * * *" - podSpec: - containers: - main: - imageSelector: image - tty: true - stdin: true - asserts: - - isSubset: - path: spec.jobTemplate.spec.template.spec.containers[0] - content: - tty: true - stdin: true - - - it: should pass with command defined in job container - documentIndex: *cronJobDoc - set: - port: 8080 - entrypoint: ./run.sh - jobs: - job-name: - enabled: true - cron: - enabled: true - schedule: "* * * * *" - podSpec: - containers: - main: - imageSelector: image - command: - - /bin/sh - - -c - - | - {{ .Values.entrypoint }} - args: - - --port - - "{{ .Values.port }}" - extraArgs: - - --data_dir - - /data - asserts: - - isSubset: - path: spec.jobTemplate.spec.template.spec.containers[0] - content: - command: - - /bin/sh - - -c - - | - ./run.sh - args: - - --port - - "8080" - - --data_dir - - /data - - - it: should pass with termination defined in job container - documentIndex: *cronJobDoc - set: - port: 8080 - entrypoint: ./run.sh - jobs: - job-name: - enabled: true - cron: - enabled: true - schedule: "* * * * *" - podSpec: - containers: - main: - imageSelector: image - termination: - messagePath: somePath - messagePolicy: File - asserts: - - isSubset: - path: spec.jobTemplate.spec.template.spec.containers[0] - content: - terminationMessagePath: somePath - terminationMessagePolicy: File - - - it: should pass with resources inherited from main container and modified in job container - documentIndex: *cronJobDoc - set: - resources: - requests: - cpu: 25m - memory: 80Mi - jobs: - job-name: - enabled: true - cron: - enabled: true - schedule: "* * * * *" - podSpec: - containers: - main: - resources: - inherit: true - limits: - cpu: 1000m - memory: 1Gi - requests: - memory: 120Mi - asserts: - - isSubset: - path: spec.jobTemplate.spec.template.spec.containers[0] - content: - resources: - limits: - cpu: 1000m - memory: 1Gi - requests: - cpu: 25m - memory: 120Mi - - - it: should pass with resources defined in job container - documentIndex: *cronJobDoc - set: - jobs: - job-name: - enabled: true - cron: - enabled: true - schedule: "* * * * *" - podSpec: - containers: - main: - nvidiaCaps: - - compute - scaleGPU: - gpu.intel.com/i915: "1" - resources: - limits: - cpu: 3000m - memory: 4Gi - requests: - cpu: 20m - memory: 100Mi - asserts: - - isSubset: - path: spec.jobTemplate.spec.template.spec.containers[0] - content: - resources: - limits: - cpu: 3000m - memory: 4Gi - gpu.intel.com/i915: "1" - requests: - cpu: 20m - memory: 100Mi - - contains: - path: spec.jobTemplate.spec.template.spec.containers[0].env - content: - name: NVIDIA_DRIVER_CAPABILITIES - value: compute - - - it: should pass with envFrom defined in job container - documentIndex: *cronJobDoc - set: - some_name: a_name - some_name2: a_name2 - jobs: - job-name: - enabled: true - cron: - enabled: true - schedule: "* * * * *" - podSpec: - containers: - main: - envFrom: - - configMapRef: - name: "{{ .Values.some_name }}" - - configMapRef: - name: "{{ .Values.some_name2 }}" - asserts: - - isSubset: - path: spec.jobTemplate.spec.template.spec.containers[0] - content: - envFrom: - - configMapRef: - name: a_name - - configMapRef: - name: a_name2 - - - it: should pass with env and envList defined in job container - documentIndex: *cronJobDoc - set: - some_value: value - some_value2: value2 - some_value3: value3 - some_value4: value4 - jobs: - job-name: - enabled: true - cron: - enabled: true - schedule: "* * * * *" - podSpec: - containers: - main: - env: - var1: "{{ .Values.some_value }}" - var2: "{{ .Values.some_value2 }}" - envList: - - name: var3 - value: "{{ .Values.some_value3 }}" - - name: var4 - value: "{{ .Values.some_value4 }}" - asserts: - - isSubset: - path: spec.jobTemplate.spec.template.spec.containers[0] - content: - env: - - name: TZ - value: UTC - - name: UMASK - value: "002" - - name: UMASK_SET - value: "002" - - name: NVIDIA_VISIBLE_DEVICES - value: void - - name: S6_READ_ONLY_ROOT - value: "1" - - name: var1 - value: value - - name: var2 - value: value2 - - name: var3 - value: value3 - - name: var4 - value: value4 - - - it: should pass with changed PUID/UMASK - documentIndex: *cronJobDoc - set: - jobs: - job-name: - enabled: true - cron: - enabled: true - schedule: "* * * * *" - podSpec: - containers: - main: - securityContext: - runAsUser: 0 - runAsNonRoot: false - UMASK: "003" - PUID: 1000 - asserts: - - isSubset: - path: spec.jobTemplate.spec.template.spec.containers[0] - content: - env: - - name: TZ - value: UTC - - name: UMASK - value: "003" - - name: UMASK_SET - value: "003" - - name: NVIDIA_VISIBLE_DEVICES - value: void - - name: PUID - value: "1000" - - name: USER_ID - value: "1000" - - name: UID - value: "1000" - - name: PGID - value: "568" - - name: GROUP_ID - value: "568" - - name: GID - value: "568" - - name: S6_READ_ONLY_ROOT - value: "1" - - - it: should pass with disabled injectFixedEnvs - documentIndex: *cronJobDoc - set: - jobs: - job-name: - enabled: true - cron: - enabled: true - schedule: "* * * * *" - podSpec: - containers: - main: - securityContext: - runAsUser: 0 - runAsNonRoot: false - injectFixedEnvs: false - asserts: - - isNull: - path: spec.jobTemplate.spec.template.spec.containers[0].env - - - it: should fail with lifecycle defined in job container - set: - jobs: - job-name: - enabled: true - cron: - enabled: true - schedule: "* * * * *" - podSpec: - containers: - main: - lifecycle: - asserts: - - failedTemplate: - errorMessage: Init/System/Install/Upgrade/(Cron)Job Container (RELEASE-NAME-common-test-job-main) do not support lifecycle hooks - - - it: should fail with env trying to override fixedEnvs in job container - set: - jobs: - job-name: - enabled: true - cron: - enabled: true - schedule: "* * * * *" - podSpec: - containers: - main: - env: - TZ: something - asserts: - - failedTemplate: - errorMessage: Environment Variable (TZ) on container (RELEASE-NAME-common-test-job-main) is set more than once. [to (UTC) on (fixedEnv)] and [to (something) on (env)] - - - it: should fail with env trying to override configmap in job container - set: - configmap: - some-confmap: - enabled: true - parseAsEnv: true - content: - TZ: something - jobs: - job-name: - enabled: true - cron: - enabled: true - schedule: "* * * * *" - podSpec: - containers: - main: - envFrom: - - configMapRef: - name: '{{ include "ix.v1.common.names.fullname" . }}-some-confmap' - asserts: - - failedTemplate: - errorMessage: Environment Variable (TZ) on container (RELEASE-NAME-common-test-job-main) is set more than once. [to (UTC) on (fixedEnv)] and [to (something) on (configmap-RELEASE-NAME-common-test-some-confmap)] - - - it: should fail with env trying to override secret in job container - set: - secret: - some-secret: - enabled: true - parseAsEnv: true - content: - TZ: something - jobs: - job-name: - enabled: true - cron: - enabled: true - schedule: "* * * * *" - podSpec: - containers: - main: - envFrom: - - secretRef: - name: '{{ include "ix.v1.common.names.fullname" . }}-some-secret' - asserts: - - failedTemplate: - errorMessage: Environment Variable (TZ) on container (RELEASE-NAME-common-test-job-main) is set more than once. [to (UTC) on (fixedEnv)] and [to (something) on (secret-RELEASE-NAME-common-test-some-secret)] - - - it: should pass with securityContext inherited - documentIndex: *cronJobDoc - set: - securityContext: - runAsUser: 0 - runAsGroup: 0 - runAsNonRoot: false - readOnlyRootFilesystem: false - privileged: true - allowPrivilegeEscalation: true - capabilities: - add: - - Something - drop: - - Something_Else - jobs: - job-name: - enabled: true - cron: - enabled: true - schedule: "* * * * *" - podSpec: - containers: - main: - imageSelector: image - securityContext: - inherit: true - asserts: - - isSubset: - path: spec.jobTemplate.spec.template.spec.containers[0] - content: - securityContext: - allowPrivilegeEscalation: true - capabilities: - add: - - Something - drop: - - Something_Else - privileged: true - readOnlyRootFilesystem: false - runAsGroup: 0 - runAsNonRoot: false - runAsUser: 0 - - - it: should pass with deviceList defined in job container - documentIndex: *cronJobDoc - set: - jobs: - job-name: - enabled: true - cron: - enabled: true - schedule: "* * * * *" - podSpec: - containers: - main: - deviceList: - - enabled: true - mountPath: /host/dev/usb - hostPath: /dev/usb - securityContext: - inherit: true - asserts: - - equal: - path: spec.jobTemplate.spec.template.spec.securityContext - value: - fsGroup: 568 - fsGroupChangePolicy: OnRootMismatch - supplementalGroups: - - 5 - - 10 - - 20 - - 24 - - isSubset: - path: spec.jobTemplate.spec.template.spec.containers[0] - content: - securityContext: - allowPrivilegeEscalation: true - capabilities: - add: [] - drop: - - ALL - privileged: true - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - - it: should pass with deviceList and scaleGPU defined in job container - documentIndex: *cronJobDoc - set: - jobs: - job-name: - enabled: true - cron: - enabled: true - schedule: "* * * * *" - podSpec: - containers: - main: - scaleGPU: - nvidia: something - deviceList: - - enabled: true - mountPath: /host/dev/usb - hostPath: /dev/usb - securityContext: - inherit: true - asserts: - - equal: - path: spec.jobTemplate.spec.template.spec.securityContext - value: - fsGroup: 568 - fsGroupChangePolicy: OnRootMismatch - supplementalGroups: - - 5 - - 10 - - 20 - - 24 - - 44 - - isSubset: - path: spec.jobTemplate.spec.template.spec.containers[0] - content: - securityContext: - allowPrivilegeEscalation: true - capabilities: - add: [] - drop: - - ALL - privileged: true - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - - it: should pass with port <=1024 defined in job container - documentIndex: *cronJobDoc - set: - jobs: - job-name: - enabled: true - cron: - enabled: true - schedule: "* * * * *" - podSpec: - containers: - main: - ports: - - name: http - containerPort: 80 - asserts: - - isSubset: - path: spec.jobTemplate.spec.template.spec.containers[0] - content: - securityContext: - allowPrivilegeEscalation: false - capabilities: - add: - - NET_BIND_SERVICE - drop: - - ALL - privileged: false - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - - it: should pass with securityContext default - documentIndex: *cronJobDoc - set: - jobs: - job-name: - enabled: true - cron: - enabled: true - schedule: "* * * * *" - podSpec: - containers: - main: - imageSelector: image - securityContext: - inherit: true - asserts: - - isSubset: - path: spec.jobTemplate.spec.template.spec.containers[0] - content: - securityContext: - allowPrivilegeEscalation: false - capabilities: - add: [] - drop: - - ALL - privileged: false - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - - it: should pass with securityContext changed - documentIndex: *cronJobDoc - set: - jobs: - job-name: - enabled: true - cron: - enabled: true - schedule: "* * * * *" - podSpec: - containers: - main: - imageSelector: image - securityContext: - runAsUser: 0 - runAsGroup: 0 - runAsNonRoot: false - readOnlyRootFilesystem: false - privileged: true - allowPrivilegeEscalation: true - capabilities: - add: - - Something - drop: - - Something_Else - asserts: - - isSubset: - path: spec.jobTemplate.spec.template.spec.containers[0] - content: - securityContext: - allowPrivilegeEscalation: true - capabilities: - add: - - Something - drop: - - Something_Else - privileged: true - readOnlyRootFilesystem: false - runAsGroup: 0 - runAsNonRoot: false - runAsUser: 0 - - - it: should pass with securityContext with some values changed - documentIndex: *cronJobDoc - set: - jobs: - job-name: - enabled: true - cron: - enabled: true - schedule: "* * * * *" - podSpec: - containers: - main: - imageSelector: image - securityContext: - runAsUser: 0 - runAsGroup: 0 - runAsNonRoot: false - capabilities: - add: - - Something - asserts: - - isSubset: - path: spec.jobTemplate.spec.template.spec.containers[0] - content: - securityContext: - allowPrivilegeEscalation: false - capabilities: - add: - - Something - drop: - - ALL - privileged: false - readOnlyRootFilesystem: true - runAsGroup: 0 - runAsNonRoot: false - runAsUser: 0 - - - it: should pass with securityContext with inherit and at least one value changed - documentIndex: *cronJobDoc - set: - securityContext: - privileged: true - allowPrivilegeEscalation: true - capabilities: - drop: - - something_else - jobs: - job-name: - enabled: true - cron: - enabled: true - schedule: "* * * * *" - podSpec: - containers: - main: - imageSelector: image - securityContext: - inherit: true - runAsNonRoot: false - runAsUser: 0 - asserts: - - isSubset: - path: spec.jobTemplate.spec.template.spec.containers[0] - content: - securityContext: - allowPrivilegeEscalation: true - capabilities: - add: [] - drop: - - something_else - privileged: true - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: false - runAsUser: 0 - - - it: should fail with probes in job container - set: - jobs: - job-name: - enabled: true - cron: - enabled: true - schedule: "* * * * *" - podSpec: - containers: - main: - probes: - liveness: - enabled: true - asserts: - - failedTemplate: - errorMessage: Init/System/Install/Upgrade/(Cron)Job Container (RELEASE-NAME-common-test-job-main) do not support probes - - - it: should fail with invalid protocol in ports in job container - set: - jobs: - job-name: - enabled: true - cron: - enabled: true - schedule: "* * * * *" - podSpec: - containers: - main: - ports: - - containerPort: 5678 - protocol: invalid-proto - name: tcp-port - asserts: - - failedTemplate: - errorMessage: Invalid (invalid-proto) in port (tcp-port) in (RELEASE-NAME-common-test-job-main) container. Valid protocols are TCP and UDP. - - - it: should fail without name in ports in job container - set: - jobs: - job-name: - enabled: true - cron: - enabled: true - schedule: "* * * * *" - podSpec: - containers: - main: - ports: - - containerPort: 5678 - protocol: TCP - name: "" - asserts: - - failedTemplate: - errorMessage: is required in all in (RELEASE-NAME-common-test-job-main) container. - - - it: should fail without containerPort in ports in job container - set: - jobs: - job-name: - enabled: true - cron: - enabled: true - schedule: "* * * * *" - podSpec: - containers: - main: - ports: - - containerPort: "" - name: tcp-port - asserts: - - failedTemplate: - errorMessage: is required in port (tcp-port) in (RELEASE-NAME-common-test-job-main) container. - - - it: should fail with non-int containerPort in ports in job container - set: - jobs: - job-name: - enabled: true - cron: - enabled: true - schedule: "* * * * *" - podSpec: - containers: - main: - ports: - - containerPort: not-int - name: tcp-port - asserts: - - failedTemplate: - errorMessage: Invalid (not-int) in port (tcp-port) in (RELEASE-NAME-common-test-job-main) container. Must be an int. - - - it: should fail with non-int hostPort in ports in job container - set: - jobs: - job-name: - enabled: true - cron: - enabled: true - schedule: "* * * * *" - podSpec: - containers: - main: - ports: - - containerPort: 1234 - hostPort: not-int - name: tcp-port - asserts: - - failedTemplate: - errorMessage: Invalid (not-int) in port (tcp-port) in (RELEASE-NAME-common-test-job-main) container. Must be an int. - - - it: should pass without protocol in ports in job container - documentIndex: *cronJobDoc - set: - jobs: - job-name: - enabled: true - cron: - enabled: true - schedule: "* * * * *" - podSpec: - containers: - main: - ports: - - containerPort: 5678 - name: tcp-port - asserts: - - isSubset: - path: spec.jobTemplate.spec.template.spec.containers[0] - content: - ports: - - containerPort: 5678 - protocol: TCP - name: tcp-port - - - it: should pass with ports defined in job container - documentIndex: *cronJobDoc - set: - jobs: - job-name: - enabled: true - cron: - enabled: true - schedule: "* * * * *" - podSpec: - containers: - main: - ports: - - containerPort: 5678 - protocol: TCP - name: tcp-port - - containerPort: 1234 - protocol: UDP - name: udp-port - asserts: - - isSubset: - path: spec.jobTemplate.spec.template.spec.containers[0] - content: - ports: - - containerPort: 5678 - protocol: TCP - name: tcp-port - - containerPort: 1234 - protocol: UDP - name: udp-port - - - it: should fail without trying to mount a non existent volume in volumeMounts defined in job container - set: - jobs: - job-name: - enabled: true - cron: - enabled: true - schedule: "* * * * *" - podSpec: - containers: - main: - volumeMounts: - - name: some-volume - mountPath: /some/path - asserts: - - failedTemplate: - errorMessage: You are trying to mount a volume that does not exist (some-volume). Please define the volume in . - - - it: should fail without name in volumeMounts defined in job container - set: - jobs: - job-name: - enabled: true - cron: - enabled: true - schedule: "* * * * *" - podSpec: - containers: - main: - volumeMounts: - - name: - mountPath: /some/path - readOnly: false - subPath: /some/sub/path - asserts: - - failedTemplate: - errorMessage: is required in volumeMounts in init/system/install/upgrade/additional containers. - - - it: should pass with volumeMounts defined in job container - documentIndex: *cronJobDoc - set: - persistence: - some-volume: - enabled: true - noMount: true - type: emptyDir - some-other-volume: - enabled: true - noMount: true - type: emptyDir - jobs: - job-name: - enabled: true - cron: - enabled: true - schedule: "* * * * *" - podSpec: - containers: - main: - volumeMounts: - - name: some-volume - mountPath: /some/path - readOnly: false - subPath: /some/sub/path - - name: some-other-volume - mountPath: /some/other/path - readOnly: false - subPath: /some/other/sub/path - asserts: - - contains: - path: spec.jobTemplate.spec.template.spec.containers[0].volumeMounts - content: - name: some-volume - mountPath: /some/path - readOnly: false - subPath: /some/sub/path - - contains: - path: spec.jobTemplate.spec.template.spec.containers[0].volumeMounts - content: - name: some-other-volume - mountPath: /some/other/path - readOnly: false - subPath: /some/other/sub/path - - - it: should pass with deviceList and volumeMounts defined in job container - documentIndex: *cronJobDoc - set: - deviceList: - - enabled: true - type: hostPath - mountPath: /host/dev/something - hostPath: /dev/something - persistence: - some-volume: - enabled: true - noMount: true - type: emptyDir - some-other-volume: - enabled: true - noMount: true - type: emptyDir - jobs: - job-name: - enabled: true - cron: - enabled: true - schedule: "* * * * *" - podSpec: - containers: - main: - deviceList: - - enabled: true - type: hostPath - mountPath: /host/dev/usb - hostPath: /dev/usb - - enabled: true - type: hostPath - mountPath: /host/dev/serial - hostPath: /dev/serial - volumeMounts: - - name: some-volume - mountPath: /some/path - readOnly: false - subPath: /some/sub/path - - name: some-other-volume - mountPath: /some/other/path - readOnly: false - subPath: /some/other/sub/path - asserts: - - contains: - path: spec.jobTemplate.spec.template.spec.containers[0].volumeMounts - content: - name: some-volume - mountPath: /some/path - readOnly: false - subPath: /some/sub/path - - contains: - path: spec.jobTemplate.spec.template.spec.containers[0].volumeMounts - content: - name: some-other-volume - mountPath: /some/other/path - readOnly: false - subPath: /some/other/sub/path - - contains: - path: spec.jobTemplate.spec.template.spec.containers[0].volumeMounts - content: - name: device-job-main-0 - mountPath: /host/dev/usb - - contains: - path: spec.jobTemplate.spec.template.spec.containers[0].volumeMounts - content: - name: device-job-main-1 - mountPath: /host/dev/serial diff --git a/.to_be_deleted/common-test/tests/jobs/cronJob_test.yaml b/.to_be_deleted/common-test/tests/jobs/cronJob_test.yaml deleted file mode 100644 index b10fff08b3..0000000000 --- a/.to_be_deleted/common-test/tests/jobs/cronJob_test.yaml +++ /dev/null @@ -1,476 +0,0 @@ -suite: cronJobs test -templates: - - common.yaml -chart: - appVersion: &appVer v1.2.3 -tests: - - it: should pass with default values - documentIndex: &deploymentDoc 0 - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Deployment - - - it: should fail without schedule in cronjobs - set: - jobs: - job-name: - enabled: true - cron: - enabled: true - asserts: - - failedTemplate: - errorMessage: is required in (job-name) - - - it: should fail with non-string schedule in cronjobs - set: - jobs: - job-name: - enabled: true - cron: - enabled: true - schedule: 1 - asserts: - - failedTemplate: - errorMessage: must be a string in (job-name) - - - it: should fail with non-string timezone in cronjobs - set: - jobs: - job-name: - enabled: true - cron: - enabled: true - schedule: "* * * * *" - timezone: 2 - asserts: - - failedTemplate: - errorMessage: must be a string in (job-name). Leave empty to use the default (UTC) - - - it: should fail with invalid concurrencyPolicy in cronjobs - set: - jobs: - job-name: - enabled: true - cron: - enabled: true - schedule: "* * * * *" - concurrencyPolicy: invalid - asserts: - - failedTemplate: - errorMessage: Invalid option (invalid) for in (job-name). Valid options are Allow, Forbid, Replace. Leave empty to use the default (Forbid) - - - it: should fail with negative value in failedJobsHistoryLimit in cronjobs - set: - jobs: - job-name: - enabled: true - cron: - enabled: true - schedule: "* * * * *" - failedJobsHistoryLimit: -1 - asserts: - - failedTemplate: - errorMessage: (-1) in (job-name) must be a positive integer. Leave empty to use (1) - - - it: should fail with negative value in successfulJobsHistoryLimit in cronjobs - set: - jobs: - job-name: - enabled: true - cron: - enabled: true - schedule: "* * * * *" - successfulJobsHistoryLimit: -1 - asserts: - - failedTemplate: - errorMessage: (-1) in (job-name) must be a positive integer. Leave empty to use (3) - - - it: should fail with zero value in startingDeadlineSeconds in cronjobs - set: - jobs: - job-name: - enabled: true - cron: - enabled: true - schedule: "* * * * *" - startingDeadlineSeconds: 0 - asserts: - - failedTemplate: - errorMessage: Zero value in (0) in (job-name) is not allowed. - - - it: should fail with negative value in startingDeadlineSeconds in cronjobs - set: - jobs: - job-name: - enabled: true - cron: - enabled: true - schedule: "* * * * *" - startingDeadlineSeconds: -1 - asserts: - - failedTemplate: - errorMessage: (-1) in (job-name) must be a positive integer. - - - it: should pass with cronjob disabled - set: - jobs: - job-name: - enabled: false - cron: - enabled: false - asserts: - - hasDocuments: - count: 3 - - - it: should pass with cronjob defined - documentIndex: &cronJobDoc 3 - set: - jobs: - job-name: - enabled: true - cron: - enabled: true - schedule: "* * * * *" - podSpec: - containers: - main: - imageSelector: image - asserts: - - isKind: - of: CronJob - - isAPIVersion: - of: batch/v1 - - isNull: - path: metadata.annotations - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-job-name - - - it: should pass with nameOverride in cronjob defined - documentIndex: *cronJobDoc - set: - jobs: - job-name: - enabled: true - nameOverride: other-job-name - cron: - enabled: true - schedule: "* * * * *" - podSpec: - containers: - main: - imageSelector: image - asserts: - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-other-job-name - - - it: should pass with global labels and labels from tpl defined in cronjob - documentIndex: *cronJobDoc - set: - l1: val1 - l2: val2 - global: - labels: - label1: val3 - label2: val4 - jobs: - job-name: - enabled: true - cron: - enabled: true - schedule: "* * * * *" - labels: - l1: "{{ .Values.l1 }}" - l2: "{{ .Values.l2 }}" - podSpec: - containers: - main: - imageSelector: image - asserts: - - equal: - path: metadata.labels - value: - app: common-test - release: RELEASE-NAME - app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: common-test - app.kubernetes.io/version: *appVer - helm-revision: "0" - helm.sh/chart: common-test-1.0.0 - l1: val1 - l2: val2 - label1: val3 - label2: val4 - - - it: should pass with annotations from tpl defined in cronjob - documentIndex: *cronJobDoc - set: - a1: val1 - a2: val2 - global: - annotations: - annotation1: val3 - annotation2: val4 - jobs: - job-name: - enabled: true - cron: - enabled: true - schedule: "* * * * *" - annotations: - a1: "{{ .Values.a1 }}" - a2: "{{ .Values.a2 }}" - podSpec: - containers: - main: - imageSelector: image - asserts: - - equal: - path: metadata.annotations - value: - a1: val1 - a2: val2 - annotation1: val3 - annotation2: val4 - - - it: should pass with defaults in cronjob - documentIndex: *cronJobDoc - set: - jobs: - job-name: - enabled: true - cron: - enabled: true - schedule: "* * * * *" - podSpec: - containers: - main: - imageSelector: image - asserts: - - isSubset: - path: spec - content: - schedule: "* * * * *" - timeZone: UTC - concurrencyPolicy: Forbid - failedJobsHistoryLimit: 1 - successfulJobsHistoryLimit: 3 - - - it: should pass with defaults in multiple cronjob (1/2) - documentIndex: *cronJobDoc - set: - jobs: - job-name: - enabled: true - cron: - enabled: true - schedule: "* * * * *" - podSpec: - containers: - main: - imageSelector: image - other-job-name: - enabled: true - cron: - enabled: true - schedule: "* * * * *" - podSpec: - containers: - main: - imageSelector: image - asserts: - - isKind: - of: CronJob - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-job-name - - isSubset: - path: spec - content: - schedule: "* * * * *" - timeZone: UTC - concurrencyPolicy: Forbid - failedJobsHistoryLimit: 1 - successfulJobsHistoryLimit: 3 - - - it: should pass with defaults in multiple cronjob (2/2) - documentIndex: &otherCronJobDoc 4 - set: - jobs: - job-name: - enabled: true - cron: - enabled: true - schedule: "* * * * *" - podSpec: - containers: - main: - imageSelector: image - other-job-name: - enabled: true - cron: - enabled: true - schedule: "* * * * *" - podSpec: - containers: - main: - imageSelector: image - asserts: - - isKind: - of: CronJob - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-other-job-name - - isSubset: - path: spec - content: - schedule: "* * * * *" - timeZone: UTC - concurrencyPolicy: Forbid - failedJobsHistoryLimit: 1 - successfulJobsHistoryLimit: 3 - - - it: should pass with schedule defined defined in cronjob - documentIndex: *cronJobDoc - set: - jobs: - job-name: - enabled: true - cron: - enabled: true - schedule: "* * * * *" - podSpec: - containers: - main: - imageSelector: image - asserts: - - equal: - path: spec.schedule - value: "* * * * *" - - - it: should pass with timezone defined in cronjob - documentIndex: *cronJobDoc - set: - jobs: - job-name: - enabled: true - cron: - enabled: true - schedule: "* * * * *" - timezone: Europe/Athens - podSpec: - containers: - main: - imageSelector: image - asserts: - - equal: - path: spec.timeZone - value: Europe/Athens - - - it: should pass with concurrencyPolicy defined in cronjob - documentIndex: *cronJobDoc - set: - jobs: - job-name: - enabled: true - cron: - enabled: true - schedule: "* * * * *" - concurrencyPolicy: Allow - podSpec: - containers: - main: - imageSelector: image - asserts: - - equal: - path: spec.concurrencyPolicy - value: Allow - - - it: should pass with failedJobsHistoryLimit defined in cronjob - documentIndex: *cronJobDoc - set: - jobs: - job-name: - enabled: true - cron: - enabled: true - schedule: "* * * * *" - failedJobsHistoryLimit: 5 - podSpec: - containers: - main: - imageSelector: image - asserts: - - equal: - path: spec.failedJobsHistoryLimit - value: 5 - - - it: should pass with successfulJobsHistoryLimit defined in cronjob - documentIndex: *cronJobDoc - set: - jobs: - job-name: - enabled: true - cron: - enabled: true - schedule: "* * * * *" - successfulJobsHistoryLimit: 5 - podSpec: - containers: - main: - imageSelector: image - asserts: - - equal: - path: spec.successfulJobsHistoryLimit - value: 5 - - - it: should pass with startingDeadlineSeconds defined in cronjob - documentIndex: *cronJobDoc - set: - jobs: - job-name: - enabled: true - cron: - enabled: true - schedule: "* * * * *" - startingDeadlineSeconds: 150 - podSpec: - containers: - main: - imageSelector: image - asserts: - - equal: - path: spec.startingDeadlineSeconds - value: 150 - - - it: should pass with values set in jobTemplate - documentIndex: *cronJobDoc - set: - jobs: - job-name: - enabled: true - cron: - enabled: true - schedule: "* * * * *" - completions: 5 - parallelism: 6 - backoffLimit: 3 - activeDeadlineSeconds: 120 - ttlSecondsAfterFinished: 150 - podSpec: - containers: - main: - imageSelector: image - asserts: - - isSubset: - path: spec.jobTemplate.spec - content: - completions: 5 - parallelism: 6 - backoffLimit: 3 - activeDeadlineSeconds: 120 - ttlSecondsAfterFinished: 150 diff --git a/.to_be_deleted/common-test/tests/jobs/jobSpecContainer_test.yaml b/.to_be_deleted/common-test/tests/jobs/jobSpecContainer_test.yaml deleted file mode 100644 index d00ea0597a..0000000000 --- a/.to_be_deleted/common-test/tests/jobs/jobSpecContainer_test.yaml +++ /dev/null @@ -1,1021 +0,0 @@ -suite: job Containers test -templates: - - common.yaml -tests: - - it: should pass with default values - documentIndex: &deploymentDoc 0 - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Deployment - - - it: should pass with default in job - documentIndex: &jobDoc 3 - set: - jobs: - job-name: - enabled: true - podSpec: - containers: - main: - imageSelector: image - asserts: - - isKind: - of: Job - - isAPIVersion: - of: batch/v1 - - - it: should pass with default container - documentIndex: *jobDoc - set: - jobs: - job-name: - enabled: true - podSpec: - containers: - main: - imageSelector: image - asserts: - - equal: - path: spec.template.spec.containers[0] - value: - name: RELEASE-NAME-common-test-job-main - image: repo:tag - imagePullPolicy: IfNotPresent - tty: false - stdin: false - env: - - name: "TZ" - value: "UTC" - - name: "UMASK" - value: "002" - - name: "UMASK_SET" - value: "002" - - name: "NVIDIA_VISIBLE_DEVICES" - value: "void" - - name: "S6_READ_ONLY_ROOT" - value: "1" - securityContext: - runAsNonRoot: true - runAsUser: 568 - runAsGroup: 568 - readOnlyRootFilesystem: true - allowPrivilegeEscalation: false - privileged: false - capabilities: - add: [] - drop: - - "ALL" - resources: - requests: - cpu: 10m - memory: 50Mi - limits: - cpu: 4000m - memory: 8Gi - - - it: should pass with image defined in job container - documentIndex: *jobDoc - set: - jobImage: - repository: some-repo-job - tag: some-tag-job - pullPolicy: Never - jobs: - job-name: - enabled: true - podSpec: - containers: - main: - imageSelector: jobImage - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - image: some-repo-job:some-tag-job - imagePullPolicy: Never - - - it: should pass with tty and stdin defined in job container - documentIndex: *jobDoc - set: - jobs: - job-name: - enabled: true - podSpec: - containers: - main: - imageSelector: image - tty: true - stdin: true - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - tty: true - stdin: true - - - it: should pass with command defined in job container - documentIndex: *jobDoc - set: - port: 8080 - entrypoint: ./run.sh - jobs: - job-name: - enabled: true - podSpec: - containers: - main: - imageSelector: image - command: - - /bin/sh - - -c - - | - {{ .Values.entrypoint }} - args: - - --port - - "{{ .Values.port }}" - extraArgs: - - --data_dir - - /data - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - command: - - /bin/sh - - -c - - | - ./run.sh - args: - - --port - - "8080" - - --data_dir - - /data - - - it: should pass with termination defined in job container - documentIndex: *jobDoc - set: - port: 8080 - entrypoint: ./run.sh - jobs: - job-name: - enabled: true - podSpec: - containers: - main: - imageSelector: image - termination: - messagePath: somePath - messagePolicy: File - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - terminationMessagePath: somePath - terminationMessagePolicy: File - - - it: should pass with resources inherited from main container and modified in job container - documentIndex: *jobDoc - set: - resources: - requests: - cpu: 25m - memory: 80Mi - jobs: - job-name: - enabled: true - podSpec: - containers: - main: - resources: - inherit: true - limits: - cpu: 1000m - memory: 1Gi - requests: - memory: 120Mi - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - resources: - limits: - cpu: 1000m - memory: 1Gi - requests: - cpu: 25m - memory: 120Mi - - - it: should pass with resources defined in job container - documentIndex: *jobDoc - set: - jobs: - job-name: - enabled: true - podSpec: - containers: - main: - nvidiaCaps: - - compute - scaleGPU: - gpu.intel.com/i915: "1" - resources: - limits: - cpu: 3000m - memory: 4Gi - requests: - cpu: 20m - memory: 100Mi - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - resources: - limits: - cpu: 3000m - memory: 4Gi - gpu.intel.com/i915: "1" - requests: - cpu: 20m - memory: 100Mi - - contains: - path: spec.template.spec.containers[0].env - content: - name: NVIDIA_DRIVER_CAPABILITIES - value: compute - - - it: should pass with envFrom defined in job container - documentIndex: *jobDoc - set: - some_name: a_name - some_name2: a_name2 - jobs: - job-name: - enabled: true - podSpec: - containers: - main: - envFrom: - - configMapRef: - name: "{{ .Values.some_name }}" - - configMapRef: - name: "{{ .Values.some_name2 }}" - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - envFrom: - - configMapRef: - name: a_name - - configMapRef: - name: a_name2 - - - it: should pass with env and envList defined in job container - documentIndex: *jobDoc - set: - some_value: value - some_value2: value2 - some_value3: value3 - some_value4: value4 - jobs: - job-name: - enabled: true - podSpec: - containers: - main: - env: - var1: "{{ .Values.some_value }}" - var2: "{{ .Values.some_value2 }}" - envList: - - name: var3 - value: "{{ .Values.some_value3 }}" - - name: var4 - value: "{{ .Values.some_value4 }}" - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - env: - - name: TZ - value: UTC - - name: UMASK - value: "002" - - name: UMASK_SET - value: "002" - - name: NVIDIA_VISIBLE_DEVICES - value: void - - name: S6_READ_ONLY_ROOT - value: "1" - - name: var1 - value: value - - name: var2 - value: value2 - - name: var3 - value: value3 - - name: var4 - value: value4 - - - it: should pass with changed PUID/UMASK - documentIndex: *jobDoc - set: - jobs: - job-name: - enabled: true - podSpec: - containers: - main: - securityContext: - runAsUser: 0 - runAsNonRoot: false - UMASK: "003" - PUID: 1000 - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - env: - - name: TZ - value: UTC - - name: UMASK - value: "003" - - name: UMASK_SET - value: "003" - - name: NVIDIA_VISIBLE_DEVICES - value: void - - name: PUID - value: "1000" - - name: USER_ID - value: "1000" - - name: UID - value: "1000" - - name: PGID - value: "568" - - name: GROUP_ID - value: "568" - - name: GID - value: "568" - - name: S6_READ_ONLY_ROOT - value: "1" - - - it: should pass with disabled injectFixedEnvs - documentIndex: *jobDoc - set: - jobs: - job-name: - enabled: true - podSpec: - containers: - main: - securityContext: - runAsUser: 0 - runAsNonRoot: false - injectFixedEnvs: false - asserts: - - isNull: - path: spec.template.spec.containers[0].env - - - it: should fail with lifecycle defined in job container - set: - jobs: - job-name: - enabled: true - podSpec: - containers: - main: - lifecycle: - asserts: - - failedTemplate: - errorMessage: Init/System/Install/Upgrade/(Cron)Job Container (RELEASE-NAME-common-test-job-main) do not support lifecycle hooks - - - it: should fail with env trying to override fixedEnvs in job container - set: - jobs: - job-name: - enabled: true - podSpec: - containers: - main: - env: - TZ: something - asserts: - - failedTemplate: - errorMessage: Environment Variable (TZ) on container (RELEASE-NAME-common-test-job-main) is set more than once. [to (UTC) on (fixedEnv)] and [to (something) on (env)] - - - it: should fail with env trying to override configmap in job container - set: - configmap: - some-confmap: - enabled: true - parseAsEnv: true - content: - TZ: something - jobs: - job-name: - enabled: true - podSpec: - containers: - main: - envFrom: - - configMapRef: - name: '{{ include "ix.v1.common.names.fullname" . }}-some-confmap' - asserts: - - failedTemplate: - errorMessage: Environment Variable (TZ) on container (RELEASE-NAME-common-test-job-main) is set more than once. [to (UTC) on (fixedEnv)] and [to (something) on (configmap-RELEASE-NAME-common-test-some-confmap)] - - - it: should fail with env trying to override secret in job container - set: - secret: - some-secret: - enabled: true - parseAsEnv: true - content: - TZ: something - jobs: - job-name: - enabled: true - podSpec: - containers: - main: - envFrom: - - secretRef: - name: '{{ include "ix.v1.common.names.fullname" . }}-some-secret' - asserts: - - failedTemplate: - errorMessage: Environment Variable (TZ) on container (RELEASE-NAME-common-test-job-main) is set more than once. [to (UTC) on (fixedEnv)] and [to (something) on (secret-RELEASE-NAME-common-test-some-secret)] - - - it: should pass with securityContext inherited - documentIndex: *jobDoc - set: - securityContext: - runAsUser: 0 - runAsGroup: 0 - runAsNonRoot: false - readOnlyRootFilesystem: false - privileged: true - allowPrivilegeEscalation: true - capabilities: - add: - - Something - drop: - - Something_Else - jobs: - job-name: - enabled: true - podSpec: - containers: - main: - imageSelector: image - securityContext: - inherit: true - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - securityContext: - allowPrivilegeEscalation: true - capabilities: - add: - - Something - drop: - - Something_Else - privileged: true - readOnlyRootFilesystem: false - runAsGroup: 0 - runAsNonRoot: false - runAsUser: 0 - - - it: should pass with deviceList defined in job container - documentIndex: *jobDoc - set: - jobs: - job-name: - enabled: true - podSpec: - containers: - main: - deviceList: - - enabled: true - mountPath: /host/dev/usb - hostPath: /dev/usb - securityContext: - inherit: true - asserts: - - equal: - path: spec.template.spec.securityContext - value: - fsGroup: 568 - fsGroupChangePolicy: OnRootMismatch - supplementalGroups: - - 5 - - 10 - - 20 - - 24 - - isSubset: - path: spec.template.spec.containers[0] - content: - securityContext: - allowPrivilegeEscalation: true - capabilities: - add: [] - drop: - - ALL - privileged: true - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - - it: should pass with deviceList and scaleGPU defined in job container - documentIndex: *jobDoc - set: - jobs: - job-name: - enabled: true - podSpec: - containers: - main: - scaleGPU: - nvidia: something - deviceList: - - enabled: true - mountPath: /host/dev/usb - hostPath: /dev/usb - securityContext: - inherit: true - asserts: - - equal: - path: spec.template.spec.securityContext - value: - fsGroup: 568 - fsGroupChangePolicy: OnRootMismatch - supplementalGroups: - - 5 - - 10 - - 20 - - 24 - - 44 - - isSubset: - path: spec.template.spec.containers[0] - content: - securityContext: - allowPrivilegeEscalation: true - capabilities: - add: [] - drop: - - ALL - privileged: true - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - - it: should pass with port <=1024 defined in job container - documentIndex: *jobDoc - set: - jobs: - job-name: - enabled: true - podSpec: - containers: - main: - ports: - - name: http - containerPort: 80 - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - securityContext: - allowPrivilegeEscalation: false - capabilities: - add: - - NET_BIND_SERVICE - drop: - - ALL - privileged: false - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - - it: should pass with securityContext default - documentIndex: *jobDoc - set: - jobs: - job-name: - enabled: true - podSpec: - containers: - main: - imageSelector: image - securityContext: - inherit: true - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - securityContext: - allowPrivilegeEscalation: false - capabilities: - add: [] - drop: - - ALL - privileged: false - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: true - runAsUser: 568 - - - it: should pass with securityContext changed - documentIndex: *jobDoc - set: - jobs: - job-name: - enabled: true - podSpec: - containers: - main: - imageSelector: image - securityContext: - runAsUser: 0 - runAsGroup: 0 - runAsNonRoot: false - readOnlyRootFilesystem: false - privileged: true - allowPrivilegeEscalation: true - capabilities: - add: - - Something - drop: - - Something_Else - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - securityContext: - allowPrivilegeEscalation: true - capabilities: - add: - - Something - drop: - - Something_Else - privileged: true - readOnlyRootFilesystem: false - runAsGroup: 0 - runAsNonRoot: false - runAsUser: 0 - - - it: should pass with securityContext with some values changed - documentIndex: *jobDoc - set: - jobs: - job-name: - enabled: true - podSpec: - containers: - main: - imageSelector: image - securityContext: - runAsUser: 0 - runAsGroup: 0 - runAsNonRoot: false - capabilities: - add: - - Something - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - securityContext: - allowPrivilegeEscalation: false - capabilities: - add: - - Something - drop: - - ALL - privileged: false - readOnlyRootFilesystem: true - runAsGroup: 0 - runAsNonRoot: false - runAsUser: 0 - - - it: should pass with securityContext with inherit and at least one value changed - documentIndex: *jobDoc - set: - securityContext: - privileged: true - allowPrivilegeEscalation: true - capabilities: - drop: - - something_else - jobs: - job-name: - enabled: true - podSpec: - containers: - main: - imageSelector: image - securityContext: - inherit: true - runAsNonRoot: false - runAsUser: 0 - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - securityContext: - allowPrivilegeEscalation: true - capabilities: - add: [] - drop: - - something_else - privileged: true - readOnlyRootFilesystem: true - runAsGroup: 568 - runAsNonRoot: false - runAsUser: 0 - - - it: should fail with probes in job container - set: - jobs: - job-name: - enabled: true - podSpec: - containers: - main: - probes: - liveness: - enabled: true - asserts: - - failedTemplate: - errorMessage: Init/System/Install/Upgrade/(Cron)Job Container (RELEASE-NAME-common-test-job-main) do not support probes - - - it: should fail with invalid protocol in ports in job container - set: - jobs: - job-name: - enabled: true - podSpec: - containers: - main: - ports: - - containerPort: 5678 - protocol: invalid-proto - name: tcp-port - asserts: - - failedTemplate: - errorMessage: Invalid (invalid-proto) in port (tcp-port) in (RELEASE-NAME-common-test-job-main) container. Valid protocols are TCP and UDP. - - - it: should fail without name in ports in job container - set: - jobs: - job-name: - enabled: true - podSpec: - containers: - main: - ports: - - containerPort: 5678 - protocol: TCP - name: "" - asserts: - - failedTemplate: - errorMessage: is required in all in (RELEASE-NAME-common-test-job-main) container. - - - it: should fail without containerPort in ports in job container - set: - jobs: - job-name: - enabled: true - podSpec: - containers: - main: - ports: - - containerPort: "" - name: tcp-port - asserts: - - failedTemplate: - errorMessage: is required in port (tcp-port) in (RELEASE-NAME-common-test-job-main) container. - - - it: should fail with non-int containerPort in ports in job container - set: - jobs: - job-name: - enabled: true - podSpec: - containers: - main: - ports: - - containerPort: not-int - name: tcp-port - asserts: - - failedTemplate: - errorMessage: Invalid (not-int) in port (tcp-port) in (RELEASE-NAME-common-test-job-main) container. Must be an int. - - - it: should fail with non-int hostPort in ports in job container - set: - jobs: - job-name: - enabled: true - podSpec: - containers: - main: - ports: - - containerPort: 1234 - hostPort: not-int - name: tcp-port - asserts: - - failedTemplate: - errorMessage: Invalid (not-int) in port (tcp-port) in (RELEASE-NAME-common-test-job-main) container. Must be an int. - - - it: should pass without protocol in ports in job container - documentIndex: *jobDoc - set: - jobs: - job-name: - enabled: true - podSpec: - containers: - main: - ports: - - containerPort: 5678 - name: tcp-port - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - ports: - - containerPort: 5678 - protocol: TCP - name: tcp-port - - - it: should pass with ports defined in job container - documentIndex: *jobDoc - set: - jobs: - job-name: - enabled: true - podSpec: - containers: - main: - ports: - - containerPort: 5678 - protocol: TCP - name: tcp-port - - containerPort: 1234 - protocol: UDP - name: udp-port - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - ports: - - containerPort: 5678 - protocol: TCP - name: tcp-port - - containerPort: 1234 - protocol: UDP - name: udp-port - - - it: should fail without trying to mount a non existent volume in volumeMounts defined in job container - set: - jobs: - job-name: - enabled: true - podSpec: - containers: - main: - volumeMounts: - - name: some-volume - mountPath: /some/path - asserts: - - failedTemplate: - errorMessage: You are trying to mount a volume that does not exist (some-volume). Please define the volume in . - - - it: should fail without name in volumeMounts defined in job container - set: - jobs: - job-name: - enabled: true - podSpec: - containers: - main: - volumeMounts: - - name: - mountPath: /some/path - readOnly: false - subPath: /some/sub/path - asserts: - - failedTemplate: - errorMessage: is required in volumeMounts in init/system/install/upgrade/additional containers. - - - it: should pass with volumeMounts defined in job container - documentIndex: *jobDoc - set: - persistence: - some-volume: - enabled: true - noMount: true - type: emptyDir - some-other-volume: - enabled: true - noMount: true - type: emptyDir - jobs: - job-name: - enabled: true - podSpec: - containers: - main: - volumeMounts: - - name: some-volume - mountPath: /some/path - readOnly: false - subPath: /some/sub/path - - name: some-other-volume - mountPath: /some/other/path - readOnly: false - subPath: /some/other/sub/path - asserts: - - contains: - path: spec.template.spec.containers[0].volumeMounts - content: - name: some-volume - mountPath: /some/path - readOnly: false - subPath: /some/sub/path - - contains: - path: spec.template.spec.containers[0].volumeMounts - content: - name: some-other-volume - mountPath: /some/other/path - readOnly: false - subPath: /some/other/sub/path - - - it: should pass with deviceList and volumeMounts defined in job container - documentIndex: *jobDoc - set: - deviceList: - - enabled: true - type: hostPath - mountPath: /host/dev/something - hostPath: /dev/something - persistence: - some-volume: - enabled: true - noMount: true - type: emptyDir - some-other-volume: - enabled: true - noMount: true - type: emptyDir - jobs: - job-name: - enabled: true - podSpec: - containers: - main: - deviceList: - - enabled: true - type: hostPath - mountPath: /host/dev/usb - hostPath: /dev/usb - - enabled: true - type: hostPath - mountPath: /host/dev/serial - hostPath: /dev/serial - volumeMounts: - - name: some-volume - mountPath: /some/path - readOnly: false - subPath: /some/sub/path - - name: some-other-volume - mountPath: /some/other/path - readOnly: false - subPath: /some/other/sub/path - asserts: - - contains: - path: spec.template.spec.containers[0].volumeMounts - content: - name: some-volume - mountPath: /some/path - readOnly: false - subPath: /some/sub/path - - contains: - path: spec.template.spec.containers[0].volumeMounts - content: - name: some-other-volume - mountPath: /some/other/path - readOnly: false - subPath: /some/other/sub/path - - contains: - path: spec.template.spec.containers[0].volumeMounts - content: - name: device-job-main-0 - mountPath: /host/dev/usb - - contains: - path: spec.template.spec.containers[0].volumeMounts - content: - name: device-job-main-1 - mountPath: /host/dev/serial diff --git a/.to_be_deleted/common-test/tests/jobs/jobTemplate_test.yaml b/.to_be_deleted/common-test/tests/jobs/jobTemplate_test.yaml deleted file mode 100644 index 3aa171494c..0000000000 --- a/.to_be_deleted/common-test/tests/jobs/jobTemplate_test.yaml +++ /dev/null @@ -1,926 +0,0 @@ -suite: jobTemplate test -templates: - - common.yaml -tests: - - it: should pass with default values - documentIndex: &deploymentDoc 0 - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Deployment - - - it: should fail with zero value in backoffLimit in jobs - set: - jobs: - job-name: - enabled: true - backoffLimit: 0 - asserts: - - failedTemplate: - errorMessage: Zero value in (0) in (job-name) is not allowed. Leave empty to use the default (6) - - - it: should fail with negative value in backoffLimit in jobs - set: - jobs: - job-name: - enabled: true - backoffLimit: -1 - asserts: - - failedTemplate: - errorMessage: (-1) in (job-name) must be a positive integer. Leave empty to use the default (6) - - - it: should fail with zero value in ttlSecondsAfterFinished in jobs - set: - jobs: - job-name: - enabled: true - ttlSecondsAfterFinished: 0 - asserts: - - failedTemplate: - errorMessage: Zero value in (0) in (job-name) is not allowed. - - - it: should fail with negative value in ttlSecondsAfterFinished in jobs - set: - jobs: - job-name: - enabled: true - ttlSecondsAfterFinished: -1 - asserts: - - failedTemplate: - errorMessage: (-1) in (job-name) must be a positive integer. - - - it: should fail with zero value in activeDeadlineSeconds in jobs - set: - jobs: - job-name: - enabled: true - activeDeadlineSeconds: 0 - asserts: - - failedTemplate: - errorMessage: Zero value in (0) in (job-name) is not allowed. - - - it: should fail with negative value in activeDeadlineSeconds in jobs - set: - jobs: - job-name: - enabled: true - activeDeadlineSeconds: -1 - asserts: - - failedTemplate: - errorMessage: (-1) in (job-name) must be a positive integer. - - - it: should fail with zero value in parallelism in jobs - set: - jobs: - job-name: - enabled: true - parallelism: 0 - asserts: - - failedTemplate: - errorMessage: Zero value in (0) in (job-name) is not allowed. - - - it: should fail with negative value in parallelism in jobs - set: - jobs: - job-name: - enabled: true - parallelism: -1 - asserts: - - failedTemplate: - errorMessage: (-1) in (job-name) must be a positive integer. - - - it: should fail with zero value in completions in jobs - set: - jobs: - job-name: - enabled: true - completions: 0 - asserts: - - failedTemplate: - errorMessage: Zero value in (0) in (job-name) is not allowed. - - - it: should fail with negative value in completions in jobs - set: - jobs: - job-name: - enabled: true - completions: -1 - asserts: - - failedTemplate: - errorMessage: (-1) in (job-name) must be a positive integer. - - - it: should fail with invalid completionMode in jobs - set: - jobs: - job-name: - enabled: true - completionMode: invalid - asserts: - - failedTemplate: - errorMessage: Invalid option (invalid) for in (job-name). Valid options are NonIndexed and Indexed. Leave empty to use the default (NonIndexed) - - - it: should fail without pod in jobs - set: - jobs: - job-name: - enabled: true - asserts: - - failedTemplate: - errorMessage: A pod in is required in (job-name). - - - it: should fail without containers in pod in jobs - set: - jobs: - job-name: - enabled: true - podSpec: - containers: {} - asserts: - - failedTemplate: - errorMessage: At least one container in is required in (job-name). - - - it: should pass with job values changed - documentIndex: *deploymentDoc - set: - jobs: - job-name: - enabled: true - podSpec: - dnsPolicy: None - hostname: some-hostname - priorityClassName: some-priorityClass - schedulerName: some-schedulerName - serviceAccountName: some-serviceAccountName - runtimeClassName: some-runtimeClassName - hostNetwork: true - enableServiceLinks: true - restartPolicy: OnFailure - podSecurityContext: - fsGroup: 0 - fsGroupChangePolicy: Always - supplementalGroups: - - 50 - containers: - main: - imageSelector: image - asserts: - - isKind: - of: Deployment - - equal: - path: spec.template.spec.serviceAccountName - value: default - - equal: - path: spec.template.spec.dnsPolicy - value: ClusterFirst - - isNull: - path: spec.template.spec.hostname - - isNull: - path: spec.template.spec.priorityClassName - - isNull: - path: spec.template.spec.runtimeClassName - - isNull: - path: spec.template.spec.schedulerName - - equal: - path: spec.template.spec.hostNetwork - value: false - - equal: - path: spec.template.spec.enableServiceLinks - value: false - - equal: - path: spec.template.spec.restartPolicy - value: Always - - equal: - path: spec.template.spec.securityContext - value: - fsGroup: 568 - fsGroupChangePolicy: OnRootMismatch - supplementalGroups: [] - - - it: should pass with default in job - documentIndex: &jobDoc 3 - set: - jobs: - job-name: - enabled: true - podSpec: - containers: - main: - imageSelector: image - asserts: - - isKind: - of: Job - - isAPIVersion: - of: batch/v1 - - isSubset: - path: spec - content: - backoffLimit: 6 - completionMode: NonIndexed - - - it: should pass with default in multiple job (1/2) - documentIndex: *jobDoc - set: - jobs: - job-name: - enabled: true - podSpec: - containers: - main: - imageSelector: image - other-job-name: - enabled: true - podSpec: - containers: - main: - imageSelector: image - asserts: - - isKind: - of: Job - - isAPIVersion: - of: batch/v1 - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-job-name - - isSubset: - path: spec - content: - backoffLimit: 6 - completionMode: NonIndexed - - - it: should pass with default in multiple job (2/2) - documentIndex: &otherJobDoc 4 - set: - jobs: - job-name: - enabled: true - podSpec: - containers: - main: - imageSelector: image - other-job-name: - enabled: true - podSpec: - containers: - main: - imageSelector: image - asserts: - - isKind: - of: Job - - isAPIVersion: - of: batch/v1 - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-other-job-name - - isSubset: - path: spec - content: - backoffLimit: 6 - completionMode: NonIndexed - - - it: should pass with backoffLimit set in job - documentIndex: *jobDoc - set: - jobs: - job-name: - enabled: true - backoffLimit: 3 - podSpec: - containers: - main: - imageSelector: image - asserts: - - isSubset: - path: spec - content: - backoffLimit: 3 - - - it: should pass with completionMode set in job - documentIndex: *jobDoc - set: - jobs: - job-name: - enabled: true - completionMode: Indexed - podSpec: - containers: - main: - imageSelector: image - asserts: - - isSubset: - path: spec - content: - completionMode: Indexed - - - it: should pass with ttlSecondsAfterFinished set in job - documentIndex: *jobDoc - set: - jobs: - job-name: - enabled: true - ttlSecondsAfterFinished: 150 - podSpec: - containers: - main: - imageSelector: image - asserts: - - isSubset: - path: spec - content: - ttlSecondsAfterFinished: 150 - - - it: should pass with activeDeadlineSeconds set in job - documentIndex: *jobDoc - set: - jobs: - job-name: - enabled: true - activeDeadlineSeconds: 120 - podSpec: - containers: - main: - imageSelector: image - asserts: - - isSubset: - path: spec - content: - activeDeadlineSeconds: 120 - - - it: should pass with parallelism set in job - documentIndex: *jobDoc - set: - jobs: - job-name: - enabled: true - parallelism: 5 - podSpec: - containers: - main: - imageSelector: image - asserts: - - isSubset: - path: spec - content: - parallelism: 5 - - - it: should pass with completions set in job - documentIndex: *jobDoc - set: - jobs: - job-name: - enabled: true - completions: 5 - podSpec: - containers: - main: - imageSelector: image - asserts: - - isSubset: - path: spec - content: - completions: 5 - - - it: should pass with default podSpec - documentIndex: *jobDoc - set: - jobs: - job-name: - enabled: true - podSpec: - containers: - main: - imageSelector: image - asserts: - - isSubset: - path: spec.template.spec - content: - enableServiceLinks: false - hostNetwork: false - restartPolicy: Never - securityContext: - fsGroup: 568 - fsGroupChangePolicy: OnRootMismatch - supplementalGroups: [] - - - it: should pass with inherit set in serviceAccountName - documentIndex: &saJobDoc 4 - set: - serviceAccount: - main: - enabled: true - jobs: - job-name: - enabled: true - podSpec: - serviceAccountName: inherit - containers: - main: - imageSelector: image - asserts: - - isKind: - of: Job - - isSubset: - path: spec.template.spec - content: - serviceAccountName: RELEASE-NAME-common-test - - - it: should pass with custom serviceAccountName - documentIndex: &saJobDoc 4 - set: - saName: custom - serviceAccount: - main: - enabled: true - jobs: - job-name: - enabled: true - podSpec: - serviceAccountName: "{{ .Values.saName }}" - containers: - main: - imageSelector: image - asserts: - - isKind: - of: Job - - isSubset: - path: spec.template.spec - content: - serviceAccountName: custom - - - it: should pass with inherit set in schedulerName - documentIndex: *jobDoc - set: - controllers: - main: - pod: - schedulerName: somename - jobs: - job-name: - enabled: true - podSpec: - schedulerName: inherit - containers: - main: - imageSelector: image - asserts: - - isSubset: - path: spec.template.spec - content: - schedulerName: somename - - - it: should pass with custom schedulerName - documentIndex: *jobDoc - set: - key: somename - controllers: - main: - pod: - schedulerName: main-scheduler - jobs: - job-name: - enabled: true - podSpec: - schedulerName: "{{ .Values.key }}" - containers: - main: - imageSelector: image - asserts: - - isSubset: - path: spec.template.spec - content: - schedulerName: somename - - - it: should pass with inherit set in terminationgracePeriodSeconds - documentIndex: *jobDoc - set: - controllers: - main: - pod: - terminationGracePeriodSeconds: 35 - jobs: - job-name: - enabled: true - podSpec: - terminationGracePeriodSeconds: inherit - containers: - main: - imageSelector: image - asserts: - - isSubset: - path: spec.template.spec - content: - terminationGracePeriodSeconds: 35 - - - it: should pass with custom terminationGracePeriodSeconds - documentIndex: *jobDoc - set: - key: 50 - jobs: - job-name: - enabled: true - podSpec: - terminationGracePeriodSeconds: "{{ .Values.key }}" - containers: - main: - imageSelector: image - asserts: - - isSubset: - path: spec.template.spec - content: - terminationGracePeriodSeconds: 50 - - - it: should pass with inherit set for hostNetwork - documentIndex: *jobDoc - set: - hostNetwork: true - jobs: - job-name: - enabled: true - podSpec: - hostNetwork: inherit - containers: - main: - imageSelector: image - asserts: - - isSubset: - path: spec.template.spec - content: - hostNetwork: true - - - it: should pass with false on hostNetwork and true on main - documentIndex: *jobDoc - set: - hostNetwork: true - jobs: - job-name: - enabled: true - podSpec: - hostNetwork: false - containers: - main: - imageSelector: image - asserts: - - isSubset: - path: spec.template.spec - content: - hostNetwork: false - - - it: should pass with inherit set for enableServiceLinks - documentIndex: *jobDoc - set: - controllers: - main: - pod: - enableServiceLinks: true - jobs: - job-name: - enabled: true - podSpec: - enableServiceLinks: inherit - containers: - main: - imageSelector: image - asserts: - - isSubset: - path: spec.template.spec - content: - enableServiceLinks: true - - - it: should pass with false on enableServiceLinks and true on main - documentIndex: *jobDoc - set: - controllers: - main: - pod: - enableServiceLinks: true - jobs: - job-name: - enabled: true - podSpec: - enableServiceLinks: false - containers: - main: - imageSelector: image - asserts: - - isSubset: - path: spec.template.spec - content: - enableServiceLinks: false - - - it: should pass with changed restartPolicy - documentIndex: *jobDoc - set: - jobs: - job-name: - enabled: true - podSpec: - restartPolicy: Always - containers: - main: - imageSelector: image - asserts: - - isSubset: - path: spec.template.spec - content: - restartPolicy: Always - - - it: should pass with inherit set in priorityClassName - documentIndex: *jobDoc - set: - controllers: - main: - pod: - priorityClassName: somename - jobs: - job-name: - enabled: true - podSpec: - priorityClassName: inherit - containers: - main: - imageSelector: image - asserts: - - isSubset: - path: spec.template.spec - content: - priorityClassName: somename - - - it: should pass with custom priorityClassName - documentIndex: *jobDoc - set: - key: somename - controllers: - main: - pod: - priorityClassName: main-priorityClass - jobs: - job-name: - enabled: true - podSpec: - priorityClassName: "{{ .Values.key }}" - containers: - main: - imageSelector: image - asserts: - - isSubset: - path: spec.template.spec - content: - priorityClassName: somename - - - it: should pass with inherit set in runtimeClassName - documentIndex: *jobDoc - set: - global: - ixChartContext: - addNvidiaRuntimeClass: true - nvidiaRuntimeClassName: nvidia-runtime - scaleGPU: - gpu: somegpu - jobs: - job-name: - enabled: true - podSpec: - runtimeClassName: inherit - containers: - main: - imageSelector: image - asserts: - - isSubset: - path: spec.template.spec - content: - runtimeClassName: nvidia-runtime - - - it: should pass with custom runtimeClassName - documentIndex: *jobDoc - set: - jobs: - job-name: - enabled: true - podSpec: - runtimeClassName: some-runtime - containers: - main: - imageSelector: image - asserts: - - isSubset: - path: spec.template.spec - content: - runtimeClassName: some-runtime - - - it: should pass with inherit set in hostname - documentIndex: *jobDoc - set: - hostname: somename - jobs: - job-name: - enabled: true - podSpec: - hostname: inherit - containers: - main: - imageSelector: image - asserts: - - isSubset: - path: spec.template.spec - content: - hostname: somename - - - it: should pass with custom hostname - documentIndex: *jobDoc - set: - key: somename - controllers: - main: - pod: - hostname: main-hostname - jobs: - job-name: - enabled: true - podSpec: - hostname: "{{ .Values.key }}" - containers: - main: - imageSelector: image - asserts: - - isSubset: - path: spec.template.spec - content: - hostname: somename - - - it: should pass with inherit set in dnsPolicy - documentIndex: *jobDoc - set: - controllers: - main: - pod: - dnsPolicy: ClusterFirstWithHostNet - jobs: - job-name: - enabled: true - podSpec: - dnsPolicy: inherit - containers: - main: - imageSelector: image - asserts: - - isSubset: - path: spec.template.spec - content: - dnsPolicy: ClusterFirstWithHostNet - - - it: should pass with custom dnsPolicy - documentIndex: *jobDoc - set: - controllers: - main: - pod: - dnsPolicy: ClusterFirstWithHostNet - jobs: - job-name: - enabled: true - podSpec: - dnsPolicy: None - containers: - main: - imageSelector: image - asserts: - - isSubset: - path: spec.template.spec - content: - dnsPolicy: None - - - it: should pass with volumes added - documentIndex: *jobDoc - set: - persistence: - some-volume: - enabled: true - type: nfs - server: some-server - path: /some/path - mountPath: /some/path - jobs: - job-name: - enabled: true - podSpec: - containers: - main: - imageSelector: image - asserts: - - isKind: - of: Job - - contains: - path: spec.template.spec.volumes - content: - name: some-volume - nfs: - server: some-server - path: /some/path - - - it: should pass with security Context changed and added gpu - documentIndex: *jobDoc - set: - global: - ixChartContext: - addNvidiaRuntimeClass: true - nvidiaRuntimeClassName: nvidia-runtime - jobs: - job-name: - enabled: true - podSpec: - podSecurityContext: - fsGroup: 0 - fsGroupChangePolicy: Always - supplementalGroups: - - 50 - containers: - main: - imageSelector: image - scaleGPU: - gpu: nvidia - asserts: - - isSubset: - path: spec.template.spec - content: - runtimeClassName: nvidia-runtime - securityContext: - fsGroup: 0 - fsGroupChangePolicy: Always - supplementalGroups: - - 50 - - 44 - - - it: should pass with security Context set to inherit - documentIndex: *jobDoc - set: - podSecurityContext: - fsGroup: 100 - fsGroupChangePolicy: Always - supplementalGroups: - - 100 - jobs: - job-name: - enabled: true - podSpec: - podSecurityContext: inherit - containers: - main: - imageSelector: image - asserts: - - isSubset: - path: spec.template.spec - content: - securityContext: - fsGroup: 100 - fsGroupChangePolicy: Always - supplementalGroups: - - 100 - - - it: should pass with default container - documentIndex: *jobDoc - set: - jobs: - job-name: - enabled: true - podSpec: - containers: - main: - imageSelector: image - asserts: - - equal: - path: spec.template.spec.containers[0] - value: - name: RELEASE-NAME-common-test-job-main - image: repo:tag - imagePullPolicy: IfNotPresent - tty: false - stdin: false - env: - - name: "TZ" - value: "UTC" - - name: "UMASK" - value: "002" - - name: "UMASK_SET" - value: "002" - - name: "NVIDIA_VISIBLE_DEVICES" - value: "void" - - name: "S6_READ_ONLY_ROOT" - value: "1" - securityContext: - runAsNonRoot: true - runAsUser: 568 - runAsGroup: 568 - readOnlyRootFilesystem: true - allowPrivilegeEscalation: false - privileged: false - capabilities: - add: [] - drop: - - "ALL" - resources: - requests: - cpu: 10m - memory: 50Mi - limits: - cpu: 4000m - memory: 8Gi diff --git a/.to_be_deleted/common-test/tests/jobs/job_test.yaml b/.to_be_deleted/common-test/tests/jobs/job_test.yaml deleted file mode 100644 index 0e26a8dd87..0000000000 --- a/.to_be_deleted/common-test/tests/jobs/job_test.yaml +++ /dev/null @@ -1,127 +0,0 @@ -suite: job test -templates: - - common.yaml -chart: - appVersion: &appVer v1.2.3 -tests: - - it: should pass with default values - documentIndex: &deploymentDoc 0 - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Deployment - - - it: should pass with disabled job - set: - jobs: - job-name: - enabled: false - podSpec: - containers: - main: - imageSelector: image - asserts: - - hasDocuments: - count: 3 - - - it: should pass with defined job - documentIndex: &jobDoc 3 - set: - jobs: - job-name: - enabled: true - podSpec: - containers: - main: - imageSelector: image - asserts: - - isKind: - of: Job - - isAPIVersion: - of: batch/v1 - - isNull: - path: metadata.annotations - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-job-name - - - it: should pass with nameOverride defined in job - documentIndex: *jobDoc - set: - jobs: - job-name: - enabled: true - nameOverride: other-job-name - podSpec: - containers: - main: - imageSelector: image - asserts: - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-other-job-name - - - it: should pass with global labels and labels from tpl defined in job - documentIndex: *jobDoc - set: - l1: val1 - l2: val2 - global: - labels: - label1: val3 - label2: val4 - jobs: - job-name: - enabled: true - labels: - l1: "{{ .Values.l1 }}" - l2: "{{ .Values.l2 }}" - podSpec: - containers: - main: - imageSelector: image - asserts: - - equal: - path: metadata.labels - value: - app: common-test - release: RELEASE-NAME - app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: common-test - app.kubernetes.io/version: *appVer - helm-revision: "0" - helm.sh/chart: common-test-1.0.0 - l1: val1 - l2: val2 - label1: val3 - label2: val4 - - - it: should pass with annotations from tpl defined in job - documentIndex: *jobDoc - set: - a1: val1 - a2: val2 - global: - annotations: - annotation1: val3 - annotation2: val4 - jobs: - job-name: - enabled: true - annotations: - a1: "{{ .Values.a1 }}" - a2: "{{ .Values.a2 }}" - podSpec: - containers: - main: - imageSelector: image - asserts: - - equal: - path: metadata.annotations - value: - a1: val1 - a2: val2 - annotation1: val3 - annotation2: val4 diff --git a/.to_be_deleted/common-test/tests/lists/deviceList_test.yaml b/.to_be_deleted/common-test/tests/lists/deviceList_test.yaml deleted file mode 100644 index 2f583486b4..0000000000 --- a/.to_be_deleted/common-test/tests/lists/deviceList_test.yaml +++ /dev/null @@ -1,70 +0,0 @@ -suite: deviceList test -templates: - - common.yaml -tests: - - it: should pass with default values - documentIndex: &deploymentDoc 0 - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Deployment - - isNull: - path: spec.template.spec.volume - - - it: should pass with deviceList defined - documentIndex: *deploymentDoc - set: - deviceList: - - enabled: true - type: hostPath - mountPath: /dev/usb - hostPath: /dev/usb - asserts: - - contains: - path: spec.template.spec.containers[0].volumeMounts - content: - name: device-0 - mountPath: /dev/usb - - contains: - path: spec.template.spec.volumes - content: - name: device-0 - hostPath: - path: /dev/usb - - - it: should pass with deviceList defined as readOnly - documentIndex: *deploymentDoc - set: - deviceList: - - enabled: true - type: hostPath - mountPath: /dev/usb - hostPath: /dev/usb - readOnly: true - asserts: - - contains: - path: spec.template.spec.containers[0].volumeMounts - content: - name: device-0 - mountPath: /dev/usb - readOnly: true - - contains: - path: spec.template.spec.volumes - content: - name: device-0 - hostPath: - path: /dev/usb - - - it: should pass with deviceList defined, validateHostPath true and a malicious not allowed path - documentIndex: *deploymentDoc - set: - deviceList: - - enabled: true - type: hostPath - mountPath: /dev/usb - hostPath: /mnt - validateHostPath: true - asserts: - - failedTemplate: - errorMessage: Invalid hostPath (/mnt). Allowed hostPaths are valid paths under a given pool. e.g. /mnt/POOL/DATASET, /mnt/POOL/DATASET/DIRECTORY diff --git a/.to_be_deleted/common-test/tests/lists/persistenceList_test.yaml b/.to_be_deleted/common-test/tests/lists/persistenceList_test.yaml deleted file mode 100644 index a963c0722b..0000000000 --- a/.to_be_deleted/common-test/tests/lists/persistenceList_test.yaml +++ /dev/null @@ -1,106 +0,0 @@ -suite: persistenceList test -templates: - - common.yaml -tests: - - it: should pass with default values - documentIndex: &deploymentDoc 0 - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Deployment - - isNull: - path: spec.template.spec.volume - - - it: should pass with persistenceList defined - documentIndex: *deploymentDoc - set: - persistenceList: - - enabled: true - type: pvc - mountPath: /some-path - asserts: - - contains: - path: spec.template.spec.containers[0].volumeMounts - content: - name: persist-list-0 - mountPath: /some-path - - contains: - path: spec.template.spec.volumes - content: - name: persist-list-0 - persistentVolumeClaim: - claimName: RELEASE-NAME-common-test-persist-list-0 - - - it: should pass with persistenceList defined - documentIndex: *deploymentDoc - set: - persistenceList: - - enabled: true - type: nfs - server: 10.10.10.100 - path: /nfs/path - mountPath: /some-path - - enabled: true - type: hostPath - mountPath: /some-path - hostPath: /mnt/pool/dataset/dir - asserts: - - contains: - path: spec.template.spec.containers[0].volumeMounts - content: - name: persist-list-0 - mountPath: /some-path - - contains: - path: spec.template.spec.containers[0].volumeMounts - content: - name: persist-list-1 - mountPath: /some-path - - contains: - path: spec.template.spec.volumes - content: - name: persist-list-0 - nfs: - server: 10.10.10.100 - path: /nfs/path - - contains: - path: spec.template.spec.volumes - content: - name: persist-list-1 - hostPath: - path: /mnt/pool/dataset/dir - - - it: should pass with persistenceList defined as readOnly - documentIndex: *deploymentDoc - set: - persistenceList: - - enabled: true - type: pvc - mountPath: /some-path - readOnly: true - asserts: - - contains: - path: spec.template.spec.containers[0].volumeMounts - content: - name: persist-list-0 - mountPath: /some-path - readOnly: true - - contains: - path: spec.template.spec.volumes - content: - name: persist-list-0 - persistentVolumeClaim: - claimName: RELEASE-NAME-common-test-persist-list-0 - - - it: should pass with persistenceList defined, validateHostPath true and a malicious not allowed path - documentIndex: *deploymentDoc - set: - persistenceList: - - enabled: true - type: hostPath - mountPath: /some-path - hostPath: /mnt - validateHostPath: true - asserts: - - failedTemplate: - errorMessage: Invalid hostPath (/mnt). Allowed hostPaths are valid paths under a given pool. e.g. /mnt/POOL/DATASET, /mnt/POOL/DATASET/DIRECTORY diff --git a/.to_be_deleted/common-test/tests/lists/serviceList_test.yaml b/.to_be_deleted/common-test/tests/lists/serviceList_test.yaml deleted file mode 100644 index 8e694c0241..0000000000 --- a/.to_be_deleted/common-test/tests/lists/serviceList_test.yaml +++ /dev/null @@ -1,180 +0,0 @@ -suite: serviceList test -templates: - - common.yaml -tests: - - it: should pass with default values - documentIndex: &deploymentDoc 0 - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Deployment - - - it: should pass with serviceList defined (container) - documentIndex: *deploymentDoc - set: - serviceList: - - enabled: true - type: ClusterIP - portsList: - - enabled: true - primary: true - protocol: HTTP - targetPort: 1234 - port: 3425 - - enabled: true - protocol: HTTP - targetPort: 12346 - port: 3427 - - enabled: true - type: NodePort - portsList: - - enabled: true - protocol: HTTP - targetPort: 12345 - nodePort: 30000 - port: 3426 - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - ports: - - containerPort: 65535 - name: main - protocol: TCP - - name: port-list-0-0 - containerPort: 1234 - protocol: TCP - - name: port-list-0-1 - containerPort: 12346 - protocol: TCP - - name: port-list-1-0 - containerPort: 12345 - protocol: TCP - - - it: should pass with serviceList defined (service 1/2) - documentIndex: &serviceDoc 3 - set: - serviceList: - - enabled: true - type: ClusterIP - portsList: - - enabled: true - primary: true - protocol: HTTP - targetPort: 1234 - port: 3425 - - enabled: true - protocol: HTTP - targetPort: 12346 - port: 3427 - - enabled: true - type: NodePort - portsList: - - enabled: true - protocol: HTTP - targetPort: 12345 - nodePort: 30000 - port: 3426 - asserts: - - isSubset: - path: spec - content: - type: NodePort - ports: - - name: port-list-1-0 - port: 3426 - protocol: TCP - targetPort: 12345 - nodePort: 30000 - - - it: should pass with serviceList defined (service 2/2) - documentIndex: &otherServiceDoc 2 - set: - serviceList: - - enabled: true - type: ClusterIP - portsList: - - enabled: true - primary: true - protocol: HTTP - targetPort: 1234 - port: 3425 - - enabled: true - protocol: HTTP - targetPort: 12346 - port: 3427 - - enabled: true - type: NodePort - portsList: - - enabled: true - protocol: HTTP - targetPort: 12345 - nodePort: 30000 - port: 3426 - asserts: - - isSubset: - path: spec - content: - type: ClusterIP - ports: - - name: port-list-0-0 - port: 3425 - protocol: TCP - targetPort: 1234 - - name: port-list-0-1 - port: 3427 - protocol: TCP - targetPort: 12346 - - - it: should pass with serviceList defined (portal) - documentIndex: &portalDoc 4 - set: - serviceList: - - enabled: true - type: ClusterIP - portsList: - - enabled: true - primary: true - protocol: HTTP - targetPort: 1234 - port: 3425 - - enabled: true - protocol: HTTP - targetPort: 12346 - port: 3427 - - enabled: true - type: NodePort - portsList: - - enabled: true - protocol: HTTP - targetPort: 12345 - nodePort: 30000 - port: 3426 - asserts: - - equal: - path: kind - value: ConfigMap - - equal: - path: data - value: - host-main-main: $node_ip - host-svc-list-0-port-list-0-0: $node_ip - host-svc-list-0-port-list-0-1: $node_ip - host-svc-list-1-port-list-1-0: $node_ip - path-main-main: / - path-svc-list-0-port-list-0-0: / - path-svc-list-0-port-list-0-1: / - path-svc-list-1-port-list-1-0: / - port-main-main: "443" - port-svc-list-0-port-list-0-0: "443" - port-svc-list-0-port-list-0-1: "443" - port-svc-list-1-port-list-1-0: "30000" - protocol-main-main: http - protocol-svc-list-0-port-list-0-0: http - protocol-svc-list-0-port-list-0-1: http - protocol-svc-list-1-port-list-1-0: http - url-main-main: http://$node_ip:443/ - url-svc-list-0-port-list-0-0: http://$node_ip:443/ - url-svc-list-0-port-list-0-1: http://$node_ip:443/ - url-svc-list-1-port-list-1-0: http://$node_ip:30000/ diff --git a/.to_be_deleted/common-test/tests/portal/portal_host_test.yaml b/.to_be_deleted/common-test/tests/portal/portal_host_test.yaml deleted file mode 100644 index fef96bfcea..0000000000 --- a/.to_be_deleted/common-test/tests/portal/portal_host_test.yaml +++ /dev/null @@ -1,279 +0,0 @@ -suite: portal host test -templates: - - common.yaml -tests: - - it: should pass with default values - documentIndex: &deploymentDoc 0 - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Deployment - - - it: should fail with portal override with empty host - set: - portal: - main: - main: - host: - service: - main: - enabled: true - ports: - main: - enabled: true - port: 10000 - targetPort: 80 - asserts: - - failedTemplate: - errorMessage: You have defined empty in . Define a host or remove the key. - - - it: should pass with defaults on single service/port - documentIndex: &portalDoc 2 - set: - service: - main: - enabled: true - ports: - main: - enabled: true - port: 10000 - protocol: HTTP - targetPort: 80 - asserts: - - isKind: - of: ConfigMap - - isAPIVersion: - of: v1 - - equal: - path: metadata.name - value: portal - - isSubset: - path: data - content: - host-main-main: $node_ip - - - it: should pass with LoadBalancer and IP set on single service/port - documentIndex: &portalDoc 2 - set: - service: - main: - enabled: true - type: LoadBalancer - loadBalancerIP: 10.10.10.100 - ports: - main: - enabled: true - port: 10000 - protocol: HTTP - targetPort: 80 - asserts: - - isKind: - of: ConfigMap - - isAPIVersion: - of: v1 - - equal: - path: metadata.name - value: portal - - isSubset: - path: data - content: - host-main-main: "10.10.10.100" - - - it: should pass with host override on single service/port - documentIndex: *portalDoc - set: - portal: - main: - main: - host: 10.10.10.100 - service: - main: - enabled: true - ports: - main: - enabled: true - port: 10000 - targetPort: 80 - asserts: - - isKind: - of: ConfigMap - - isAPIVersion: - of: v1 - - equal: - path: metadata.name - value: portal - - isSubset: - path: data - content: - host-main-main: "10.10.10.100" - - - it: should pass with defaults on multiple service/port - documentIndex: &dualServicePortalDoc 3 - set: - service: - main: - enabled: true - ports: - main: - enabled: true - primary: true - port: 10000 - protocol: HTTP - targetPort: 80 - main2: - enabled: true - port: 10001 - protocol: HTTP - targetPort: 80 - other: - enabled: true - ports: - other: - enabled: true - primary: true - port: 10002 - protocol: HTTP - targetPort: 80 - other2: - enabled: true - port: 10003 - protocol: HTTP - targetPort: 80 - asserts: - - isKind: - of: ConfigMap - - isAPIVersion: - of: v1 - - equal: - path: metadata.name - value: portal - - isSubset: - path: data - content: - host-main-main: $node_ip - host-main-main2: $node_ip - host-other-other: $node_ip - host-other-other2: $node_ip - - - it: should pass with host override on multiple service/port - documentIndex: *dualServicePortalDoc - set: - portal: - main: - main: - host: 10.10.10.100 - main2: - host: 10.10.10.101 - other: - other: - host: 10.10.10.102 - other2: - host: 10.10.10.103 - service: - main: - enabled: true - ports: - main: - enabled: true - primary: true - port: 10000 - protocol: HTTP - targetPort: 80 - main2: - enabled: true - port: 10001 - protocol: HTTP - targetPort: 80 - other: - enabled: true - ports: - other: - enabled: true - primary: true - port: 10002 - protocol: HTTP - targetPort: 80 - other2: - enabled: true - port: 10003 - protocol: HTTP - targetPort: 80 - asserts: - - isKind: - of: ConfigMap - - isAPIVersion: - of: v1 - - equal: - path: metadata.name - value: portal - - isSubset: - path: data - content: - host-main-main: "10.10.10.100" - host-main-main2: "10.10.10.101" - host-other-other: "10.10.10.102" - host-other-other2: "10.10.10.103" - - - it: should pass with override on multiple service/port from tpl - documentIndex: *dualServicePortalDoc - set: - host1: 10.10.10.100 - host2: 10.10.10.101 - host3: 10.10.10.102 - host4: 10.10.10.103 - portal: - main: - main: - host: "{{ .Values.host1 }}" - main2: - host: "{{ .Values.host2 }}" - other: - other: - host: "{{ .Values.host3 }}" - other2: - host: "{{ .Values.host4 }}" - service: - main: - enabled: true - ports: - main: - enabled: true - primary: true - port: 10000 - protocol: HTTP - targetPort: 80 - main2: - enabled: true - port: 10001 - protocol: HTTP - targetPort: 80 - other: - enabled: true - ports: - other: - enabled: true - primary: true - port: 10002 - protocol: HTTP - targetPort: 80 - other2: - enabled: true - port: 10003 - protocol: HTTP - targetPort: 80 - asserts: - - isKind: - of: ConfigMap - - isAPIVersion: - of: v1 - - equal: - path: metadata.name - value: portal - - isSubset: - path: data - content: - host-main-main: "10.10.10.100" - host-main-main2: "10.10.10.101" - host-other-other: "10.10.10.102" - host-other-other2: "10.10.10.103" diff --git a/.to_be_deleted/common-test/tests/portal/portal_path_test.yaml b/.to_be_deleted/common-test/tests/portal/portal_path_test.yaml deleted file mode 100644 index f94bb9877a..0000000000 --- a/.to_be_deleted/common-test/tests/portal/portal_path_test.yaml +++ /dev/null @@ -1,270 +0,0 @@ -suite: portal path test -templates: - - common.yaml -tests: - - it: should pass with default values - documentIndex: &deploymentDoc 0 - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Deployment - - - it: should fail with portal override with empty path - set: - portal: - main: - main: - path: - service: - main: - enabled: true - ports: - main: - enabled: true - port: 10000 - targetPort: 80 - asserts: - - failedTemplate: - errorMessage: You have defined empty in . Define a path or remove the key. - - - it: should fail with portal override with path not starting with / - set: - portal: - main: - main: - path: a/relative/path - service: - main: - enabled: true - ports: - main: - enabled: true - port: 10000 - targetPort: 80 - asserts: - - failedTemplate: - errorMessage: Portal path (a/relative/path) must start with a forward slash -> / <- - - - it: should pass with defaults on single service/port - documentIndex: &portalDoc 2 - set: - service: - main: - enabled: true - ports: - main: - enabled: true - port: 10000 - protocol: HTTP - targetPort: 80 - asserts: - - isKind: - of: ConfigMap - - isAPIVersion: - of: v1 - - equal: - path: metadata.name - value: portal - - isSubset: - path: data - content: - path-main-main: / - - - it: should pass with path override on single service/port - documentIndex: *portalDoc - set: - portal: - main: - main: - path: /some_path - service: - main: - enabled: true - ports: - main: - enabled: true - port: 10000 - targetPort: 80 - asserts: - - isKind: - of: ConfigMap - - isAPIVersion: - of: v1 - - equal: - path: metadata.name - value: portal - - isSubset: - path: data - content: - path-main-main: /some_path - - - it: should pass with defaults on multiple service/port - documentIndex: &dualServicePortalDoc 3 - set: - service: - main: - enabled: true - ports: - main: - enabled: true - primary: true - port: 10000 - protocol: HTTP - targetPort: 80 - main2: - enabled: true - port: 10001 - protocol: HTTP - targetPort: 80 - other: - enabled: true - ports: - other: - enabled: true - primary: true - port: 10002 - protocol: HTTP - targetPort: 80 - other2: - enabled: true - port: 10003 - protocol: HTTP - targetPort: 80 - asserts: - - isKind: - of: ConfigMap - - isAPIVersion: - of: v1 - - equal: - path: metadata.name - value: portal - - isSubset: - path: data - content: - path-main-main: / - path-main-main2: / - path-other-other: / - path-other-other2: / - - - it: should pass with path override on multiple service/port - documentIndex: *dualServicePortalDoc - set: - portal: - main: - main: - path: /some_path1 - main2: - path: /some_path2 - other: - other: - path: /some_path3 - other2: - path: /some_path4 - service: - main: - enabled: true - ports: - main: - enabled: true - primary: true - port: 10000 - protocol: HTTP - targetPort: 80 - main2: - enabled: true - port: 10001 - protocol: HTTP - targetPort: 80 - other: - enabled: true - ports: - other: - enabled: true - primary: true - port: 10002 - protocol: HTTP - targetPort: 80 - other2: - enabled: true - port: 10003 - protocol: HTTP - targetPort: 80 - asserts: - - isKind: - of: ConfigMap - - isAPIVersion: - of: v1 - - equal: - path: metadata.name - value: portal - - isSubset: - path: data - content: - path-main-main: /some_path1 - path-main-main2: /some_path2 - path-other-other: /some_path3 - path-other-other2: /some_path4 - - - it: should pass with path override on multiple service/port from tpl - documentIndex: *dualServicePortalDoc - set: - path1: /some_path1 - path2: /some_path2 - path3: /some_path3 - path4: /some_path4 - portal: - main: - main: - path: "{{ .Values.path1 }}" - main2: - path: "{{ .Values.path2 }}" - other: - other: - path: "{{ .Values.path3 }}" - other2: - path: "{{ .Values.path4 }}" - service: - main: - enabled: true - ports: - main: - enabled: true - primary: true - port: 10000 - protocol: HTTP - targetPort: 80 - main2: - enabled: true - port: 10001 - protocol: HTTP - targetPort: 80 - other: - enabled: true - ports: - other: - enabled: true - primary: true - port: 10002 - protocol: HTTP - targetPort: 80 - other2: - enabled: true - port: 10003 - protocol: HTTP - targetPort: 80 - asserts: - - isKind: - of: ConfigMap - - isAPIVersion: - of: v1 - - equal: - path: metadata.name - value: portal - - isSubset: - path: data - content: - path-main-main: /some_path1 - path-main-main2: /some_path2 - path-other-other: /some_path3 - path-other-other2: /some_path4 diff --git a/.to_be_deleted/common-test/tests/portal/portal_port_test.yaml b/.to_be_deleted/common-test/tests/portal/portal_port_test.yaml deleted file mode 100644 index 4e282d4acb..0000000000 --- a/.to_be_deleted/common-test/tests/portal/portal_port_test.yaml +++ /dev/null @@ -1,1139 +0,0 @@ -suite: portal port test -templates: - - common.yaml -tests: - - it: should pass with default values - documentIndex: &deploymentDoc 0 - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Deployment - - - it: should fail with portal override out of upper range (upper) - set: - portal: - main: - main: - port: 65536 - service: - main: - enabled: true - ports: - main: - enabled: true - port: 10000 - targetPort: 80 - asserts: - - failedTemplate: - errorMessage: Port (65536) in is out of range. Range is 1-65535 - - - it: should fail with portal override out of lower range (lower) - set: - portal: - main: - main: - port: 0 - service: - main: - enabled: true - ports: - main: - enabled: true - port: 10000 - targetPort: 80 - asserts: - - failedTemplate: - errorMessage: Port (0) in is out of range. Range is 1-65535 - - - it: should fail with portal override out of range (negative) - set: - portal: - main: - main: - port: -1 - service: - main: - enabled: true - ports: - main: - enabled: true - port: 10000 - targetPort: 80 - asserts: - - failedTemplate: - errorMessage: Port (-1) in is out of range. Range is 1-65535 - - - it: should pass with hostPort single service - documentIndex: &portalDoc 2 - set: - service: - main: - enabled: true - ports: - main: - enabled: true - port: 10000 - hostPort: 11000 - targetPort: 80 - asserts: - - isKind: - of: ConfigMap - - isAPIVersion: - of: v1 - - equal: - path: metadata.name - value: portal - - isSubset: - path: data - content: - port-main-main: "11000" - - - it: should pass with hostPort multiple service - documentIndex: &dualServicePortalDoc 3 - set: - service: - main: - enabled: true - ports: - main: - enabled: true - port: 10000 - hostPort: 11000 - targetPort: 80 - other: - enabled: true - ports: - other: - enabled: true - port: 10001 - hostPort: 11001 - targetPort: 80 - asserts: - - isKind: - of: ConfigMap - - equal: - path: metadata.name - value: portal - - isSubset: - path: data - content: - port-main-main: "11000" - port-other-other: "11001" - - - it: should pass with hostPort multiple service and multiple port - documentIndex: *dualServicePortalDoc - set: - service: - main: - enabled: true - ports: - main: - enabled: true - primary: true - port: 10000 - hostPort: 11000 - targetPort: 80 - main2: - enabled: true - port: 10002 - hostPort: 11002 - targetPort: 81 - other: - enabled: true - ports: - other: - enabled: true - primary: true - port: 10001 - hostPort: 11001 - targetPort: 80 - other2: - enabled: true - port: 10003 - hostPort: 11003 - targetPort: 80 - asserts: - - isKind: - of: ConfigMap - - equal: - path: metadata.name - value: portal - - isSubset: - path: data - content: - port-main-main: "11000" - port-main-main2: "11002" - port-other-other: "11001" - port-other-other2: "11003" - - - it: should pass with hostPort multiple service and multiple port and single port override on portal - documentIndex: *dualServicePortalDoc - set: - portal: - main: - main: - port: 20000 - service: - main: - enabled: true - ports: - main: - enabled: true - primary: true - port: 10000 - hostPort: 11000 - targetPort: 80 - main2: - enabled: true - port: 10002 - hostPort: 11002 - targetPort: 81 - other: - enabled: true - ports: - other: - enabled: true - primary: true - port: 10001 - hostPort: 11001 - targetPort: 80 - other2: - enabled: true - port: 10003 - hostPort: 11003 - targetPort: 80 - asserts: - - isKind: - of: ConfigMap - - equal: - path: metadata.name - value: portal - - isSubset: - path: data - content: - port-main-main: "20000" - port-main-main2: "11002" - port-other-other: "11001" - port-other-other2: "11003" - - - it: should pass with hostPort multiple service and multiple port and multiple port override on portal - documentIndex: *dualServicePortalDoc - set: - portal: - main: - main: - port: 20000 - main2: - port: 20002 - other: - other: - port: 20001 - other2: - port: 20003 - service: - main: - enabled: true - ports: - main: - enabled: true - primary: true - port: 10000 - hostPort: 11000 - targetPort: 80 - main2: - enabled: true - port: 10002 - hostPort: 11002 - targetPort: 81 - other: - enabled: true - ports: - other: - enabled: true - primary: true - port: 10001 - hostPort: 11001 - targetPort: 80 - other2: - enabled: true - port: 10003 - hostPort: 11003 - targetPort: 80 - asserts: - - isKind: - of: ConfigMap - - equal: - path: metadata.name - value: portal - - isSubset: - path: data - content: - port-main-main: "20000" - port-main-main2: "20002" - port-other-other: "20001" - port-other-other2: "20003" - - - it: should pass with hostPort multiple service and multiple port and override on portal from tpl - documentIndex: *dualServicePortalDoc - set: - port1: 20000 - port2: 20002 - port3: 20001 - port4: 20003 - portal: - main: - main: - port: "{{ .Values.port1 }}" - main2: - port: "{{ .Values.port2 }}" - other: - other: - port: "{{ .Values.port3 }}" - other2: - port: "{{ .Values.port4 }}" - service: - main: - enabled: true - ports: - main: - enabled: true - primary: true - port: 10000 - hostPort: 11000 - targetPort: 80 - main2: - enabled: true - port: 10002 - hostPort: 11002 - targetPort: 81 - other: - enabled: true - ports: - other: - enabled: true - primary: true - port: 10001 - hostPort: 11001 - targetPort: 80 - other2: - enabled: true - port: 10003 - hostPort: 11003 - targetPort: 80 - asserts: - - isKind: - of: ConfigMap - - equal: - path: metadata.name - value: portal - - isSubset: - path: data - content: - port-main-main: "20000" - port-main-main2: "20002" - port-other-other: "20001" - port-other-other2: "20003" - - - it: should pass with hostNetwork single service - documentIndex: *portalDoc - set: - hostNetwork: true - service: - main: - enabled: true - ports: - main: - enabled: true - port: 10000 - targetPort: 80 - asserts: - - isKind: - of: ConfigMap - - isAPIVersion: - of: v1 - - equal: - path: metadata.name - value: portal - - isSubset: - path: data - content: - port-main-main: "10000" - - - it: should pass with hostNetwork multiple service - documentIndex: *dualServicePortalDoc - set: - hostNetwork: true - service: - main: - enabled: true - ports: - main: - enabled: true - port: 10000 - targetPort: 80 - other: - enabled: true - ports: - other: - enabled: true - port: 10001 - targetPort: 80 - asserts: - - isKind: - of: ConfigMap - - equal: - path: metadata.name - value: portal - - isSubset: - path: data - content: - port-main-main: "10000" - port-other-other: "10001" - - - it: should pass with hostNetwork multiple service and multiple port - documentIndex: *dualServicePortalDoc - set: - hostNetwork: true - service: - main: - enabled: true - ports: - main: - enabled: true - primary: true - port: 10000 - targetPort: 80 - main2: - enabled: true - port: 10002 - targetPort: 81 - other: - enabled: true - ports: - other: - enabled: true - primary: true - port: 10001 - targetPort: 80 - other2: - enabled: true - port: 10003 - targetPort: 80 - asserts: - - isKind: - of: ConfigMap - - equal: - path: metadata.name - value: portal - - isSubset: - path: data - content: - port-main-main: "10000" - port-main-main2: "10002" - port-other-other: "10001" - port-other-other2: "10003" - - - it: should pass with hostNetwork multiple service and multiple port and single port override on portal - documentIndex: *dualServicePortalDoc - set: - hostNetwork: true - portal: - main: - main: - port: 20000 - service: - main: - enabled: true - ports: - main: - enabled: true - primary: true - port: 10000 - targetPort: 80 - main2: - enabled: true - port: 10002 - targetPort: 81 - other: - enabled: true - ports: - other: - enabled: true - primary: true - port: 10001 - targetPort: 80 - other2: - enabled: true - port: 10003 - targetPort: 80 - asserts: - - isKind: - of: ConfigMap - - equal: - path: metadata.name - value: portal - - isSubset: - path: data - content: - port-main-main: "20000" - port-main-main2: "10002" - port-other-other: "10001" - port-other-other2: "10003" - - - it: should pass with hostNetwork multiple service and multiple port and multiple port override on portal - documentIndex: *dualServicePortalDoc - set: - hostNetwork: true - portal: - main: - main: - port: 20000 - main2: - port: 20002 - other: - other: - port: 20001 - other2: - port: 20003 - service: - main: - enabled: true - ports: - main: - enabled: true - primary: true - port: 10000 - targetPort: 80 - main2: - enabled: true - port: 10002 - targetPort: 81 - other: - enabled: true - ports: - other: - enabled: true - primary: true - port: 10001 - targetPort: 80 - other2: - enabled: true - port: 10003 - targetPort: 80 - asserts: - - isKind: - of: ConfigMap - - equal: - path: metadata.name - value: portal - - isSubset: - path: data - content: - port-main-main: "20000" - port-main-main2: "20002" - port-other-other: "20001" - port-other-other2: "20003" - - - it: should pass with hostNetwork multiple service and multiple port and override on portal from tpl - documentIndex: *dualServicePortalDoc - set: - port1: 20000 - port2: 20002 - port3: 20001 - port4: 20003 - hostNetwork: true - portal: - main: - main: - port: "{{ .Values.port1 }}" - main2: - port: "{{ .Values.port2 }}" - other: - other: - port: "{{ .Values.port3 }}" - other2: - port: "{{ .Values.port4 }}" - service: - main: - enabled: true - ports: - main: - enabled: true - primary: true - port: 10000 - targetPort: 80 - main2: - enabled: true - port: 10002 - targetPort: 81 - other: - enabled: true - ports: - other: - enabled: true - primary: true - port: 10001 - targetPort: 80 - other2: - enabled: true - port: 10003 - targetPort: 80 - asserts: - - isKind: - of: ConfigMap - - equal: - path: metadata.name - value: portal - - isSubset: - path: data - content: - port-main-main: "20000" - port-main-main2: "20002" - port-other-other: "20001" - port-other-other2: "20003" - - - it: should pass with nodePort single service - documentIndex: *portalDoc - set: - service: - main: - type: NodePort - enabled: true - ports: - main: - enabled: true - port: 10000 - nodePort: 11000 - targetPort: 80 - asserts: - - isKind: - of: ConfigMap - - isAPIVersion: - of: v1 - - equal: - path: metadata.name - value: portal - - isSubset: - path: data - content: - port-main-main: "11000" - - - it: should pass with nodePort multiple service - documentIndex: *dualServicePortalDoc - set: - service: - main: - enabled: true - type: NodePort - ports: - main: - enabled: true - port: 10000 - nodePort: 11000 - targetPort: 80 - other: - enabled: true - type: NodePort - ports: - other: - enabled: true - port: 10001 - nodePort: 11001 - targetPort: 80 - asserts: - - isKind: - of: ConfigMap - - equal: - path: metadata.name - value: portal - - isSubset: - path: data - content: - port-main-main: "11000" - port-other-other: "11001" - - - it: should pass with nodePort multiple service - documentIndex: *dualServicePortalDoc - set: - service: - main: - enabled: true - type: NodePort - ports: - main: - enabled: true - primary: true - port: 10000 - nodePort: 11000 - targetPort: 80 - main2: - enabled: true - port: 10001 - nodePort: 11002 - targetPort: 81 - other: - enabled: true - type: NodePort - ports: - other: - enabled: true - primary: true - port: 10002 - nodePort: 11001 - targetPort: 80 - other2: - enabled: true - port: 10003 - nodePort: 11003 - targetPort: 81 - asserts: - - isKind: - of: ConfigMap - - equal: - path: metadata.name - value: portal - - isSubset: - path: data - content: - port-main-main: "11000" - port-main-main2: "11002" - port-other-other: "11001" - port-other-other2: "11003" - - - it: should pass with nodePort multiple service and single override portal port - documentIndex: *dualServicePortalDoc - set: - portal: - other: - other2: - port: 21003 - service: - main: - enabled: true - type: NodePort - ports: - main: - enabled: true - primary: true - port: 10000 - nodePort: 11000 - targetPort: 80 - main2: - enabled: true - port: 10001 - nodePort: 11002 - targetPort: 81 - other: - enabled: true - type: NodePort - ports: - other: - enabled: true - primary: true - port: 10002 - nodePort: 11001 - targetPort: 80 - other2: - enabled: true - port: 10003 - nodePort: 11003 - targetPort: 81 - asserts: - - isKind: - of: ConfigMap - - equal: - path: metadata.name - value: portal - - isSubset: - path: data - content: - port-main-main: "11000" - port-main-main2: "11002" - port-other-other: "11001" - port-other-other2: "21003" - - - it: should pass with nodePort multiple service and multiple override portal port - documentIndex: *dualServicePortalDoc - set: - portal: - main: - main: - port: 21000 - main2: - port: 21002 - other: - other: - port: 21001 - other2: - port: 21003 - service: - main: - enabled: true - type: NodePort - ports: - main: - enabled: true - primary: true - port: 10000 - nodePort: 11000 - targetPort: 80 - main2: - enabled: true - port: 10001 - nodePort: 11002 - targetPort: 81 - other: - enabled: true - type: NodePort - ports: - other: - enabled: true - primary: true - port: 10002 - nodePort: 11001 - targetPort: 80 - other2: - enabled: true - port: 10003 - nodePort: 11003 - targetPort: 81 - asserts: - - isKind: - of: ConfigMap - - equal: - path: metadata.name - value: portal - - isSubset: - path: data - content: - port-main-main: "21000" - port-main-main2: "21002" - port-other-other: "21001" - port-other-other2: "21003" - - - it: should pass with nodePort multiple service and multiple override portal port from tpl - documentIndex: *dualServicePortalDoc - set: - port1: 21000 - port2: 21002 - port3: 21001 - port4: 21003 - portal: - main: - main: - port: "{{ .Values.port1 }}" - main2: - port: "{{ .Values.port2 }}" - other: - other: - port: "{{ .Values.port3 }}" - other2: - port: "{{ .Values.port4 }}" - service: - main: - enabled: true - type: NodePort - ports: - main: - enabled: true - primary: true - port: 10000 - nodePort: 11000 - targetPort: 80 - main2: - enabled: true - port: 10001 - nodePort: 11002 - targetPort: 81 - other: - enabled: true - type: NodePort - ports: - other: - enabled: true - primary: true - port: 10002 - nodePort: 11001 - targetPort: 80 - other2: - enabled: true - port: 10003 - nodePort: 11003 - targetPort: 81 - asserts: - - isKind: - of: ConfigMap - - equal: - path: metadata.name - value: portal - - isSubset: - path: data - content: - port-main-main: "21000" - port-main-main2: "21002" - port-other-other: "21001" - port-other-other2: "21003" - - - it: should pass with loadBalancer single service - documentIndex: *portalDoc - set: - service: - main: - type: LoadBalancer - enabled: true - ports: - main: - enabled: true - port: 10000 - targetPort: 80 - asserts: - - isKind: - of: ConfigMap - - isAPIVersion: - of: v1 - - equal: - path: metadata.name - value: portal - - isSubset: - path: data - content: - port-main-main: "10000" - - - it: should pass with loadBalancer multiple service - documentIndex: *dualServicePortalDoc - set: - service: - main: - enabled: true - type: LoadBalancer - ports: - main: - enabled: true - port: 10000 - targetPort: 80 - other: - enabled: true - type: LoadBalancer - ports: - other: - enabled: true - port: 10001 - targetPort: 80 - asserts: - - isKind: - of: ConfigMap - - equal: - path: metadata.name - value: portal - - isSubset: - path: data - content: - port-main-main: "10000" - port-other-other: "10001" - - - it: should pass with loadBalancer multiple service - documentIndex: *dualServicePortalDoc - set: - service: - main: - enabled: true - type: LoadBalancer - ports: - main: - enabled: true - primary: true - port: 10000 - targetPort: 80 - main2: - enabled: true - port: 10001 - targetPort: 81 - other: - enabled: true - type: LoadBalancer - ports: - other: - enabled: true - primary: true - port: 10002 - targetPort: 80 - other2: - enabled: true - port: 10003 - targetPort: 81 - asserts: - - isKind: - of: ConfigMap - - equal: - path: metadata.name - value: portal - - isSubset: - path: data - content: - port-main-main: "10000" - port-main-main2: "10001" - port-other-other: "10002" - port-other-other2: "10003" - - - it: should pass with loadBalancer multiple service and single override portal port - documentIndex: *dualServicePortalDoc - set: - portal: - other: - other2: - port: 21003 - service: - main: - enabled: true - type: LoadBalancer - ports: - main: - enabled: true - primary: true - port: 10000 - targetPort: 80 - main2: - enabled: true - port: 10001 - targetPort: 81 - other: - enabled: true - type: LoadBalancer - ports: - other: - enabled: true - primary: true - port: 10002 - targetPort: 80 - other2: - enabled: true - port: 10003 - targetPort: 81 - asserts: - - isKind: - of: ConfigMap - - equal: - path: metadata.name - value: portal - - isSubset: - path: data - content: - port-main-main: "10000" - port-main-main2: "10001" - port-other-other: "10002" - port-other-other2: "21003" - - - it: should pass with loadBalancer multiple service and multiple override portal port - documentIndex: *dualServicePortalDoc - set: - portal: - main: - main: - port: 21000 - main2: - port: 21002 - other: - other: - port: 21001 - other2: - port: 21003 - service: - main: - enabled: true - type: LoadBalancer - ports: - main: - enabled: true - primary: true - port: 10000 - targetPort: 80 - main2: - enabled: true - port: 10001 - targetPort: 81 - other: - enabled: true - type: LoadBalancer - ports: - other: - enabled: true - primary: true - port: 10002 - targetPort: 80 - other2: - enabled: true - port: 10003 - targetPort: 81 - asserts: - - isKind: - of: ConfigMap - - equal: - path: metadata.name - value: portal - - isSubset: - path: data - content: - port-main-main: "21000" - port-main-main2: "21002" - port-other-other: "21001" - port-other-other2: "21003" - - - it: should pass with loadBalancer multiple service and multiple override portal port from tpl - documentIndex: *dualServicePortalDoc - set: - port1: 21000 - port2: 21002 - port3: 21001 - port4: 21003 - portal: - main: - main: - port: "{{ .Values.port1 }}" - main2: - port: "{{ .Values.port2 }}" - other: - other: - port: "{{ .Values.port3 }}" - other2: - port: "{{ .Values.port4 }}" - service: - main: - enabled: true - type: LoadBalancer - ports: - main: - enabled: true - primary: true - port: 10000 - targetPort: 80 - main2: - enabled: true - port: 10001 - targetPort: 81 - other: - enabled: true - type: LoadBalancer - ports: - other: - enabled: true - primary: true - port: 10002 - targetPort: 80 - other2: - enabled: true - port: 10003 - targetPort: 81 - asserts: - - isKind: - of: ConfigMap - - equal: - path: metadata.name - value: portal - - isSubset: - path: data - content: - port-main-main: "21000" - port-main-main2: "21002" - port-other-other: "21001" - port-other-other2: "21003" diff --git a/.to_be_deleted/common-test/tests/portal/portal_protocol_test.yaml b/.to_be_deleted/common-test/tests/portal/portal_protocol_test.yaml deleted file mode 100644 index d92b019ff3..0000000000 --- a/.to_be_deleted/common-test/tests/portal/portal_protocol_test.yaml +++ /dev/null @@ -1,469 +0,0 @@ -suite: portal protocol test -templates: - - common.yaml -tests: - - it: should pass with default values - documentIndex: &deploymentDoc 0 - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Deployment - - - it: should fail with portal override with invalid protocol - set: - portal: - main: - main: - protocol: tcp - service: - main: - enabled: true - ports: - main: - enabled: true - port: 10000 - targetPort: 80 - asserts: - - failedTemplate: - errorMessage: Invalid protocol (tcp). Only HTTP/HTTPS protocols are allowed for - - - it: should pass with http protocol on single service/port - documentIndex: &portalDoc 2 - set: - service: - main: - enabled: true - ports: - main: - enabled: true - port: 10000 - protocol: HTTP - targetPort: 80 - asserts: - - isKind: - of: ConfigMap - - isAPIVersion: - of: v1 - - equal: - path: metadata.name - value: portal - - isSubset: - path: data - content: - protocol-main-main: http - - - it: should pass with https protocol on single service/port - documentIndex: *portalDoc - set: - service: - main: - enabled: true - ports: - main: - enabled: true - port: 10000 - protocol: HTTPS - targetPort: 80 - asserts: - - isKind: - of: ConfigMap - - isAPIVersion: - of: v1 - - equal: - path: metadata.name - value: portal - - isSubset: - path: data - content: - protocol-main-main: https - - - it: should pass with no protocol on single service/port - documentIndex: *portalDoc - set: - service: - main: - enabled: true - ports: - main: - enabled: true - port: 10000 - targetPort: 80 - asserts: - - isKind: - of: ConfigMap - - isAPIVersion: - of: v1 - - equal: - path: metadata.name - value: portal - - isSubset: - path: data - content: - protocol-main-main: http - - - it: should pass with http protocol on multiple service/port - documentIndex: &dualServicePortalDoc 3 - set: - service: - main: - enabled: true - ports: - main: - enabled: true - primary: true - port: 10000 - protocol: HTTP - targetPort: 80 - main2: - enabled: true - port: 10000 - protocol: HTTP - targetPort: 80 - other: - enabled: true - ports: - other: - enabled: true - primary: true - port: 10000 - protocol: HTTP - targetPort: 80 - other2: - enabled: true - port: 10000 - protocol: HTTP - targetPort: 80 - asserts: - - isKind: - of: ConfigMap - - isAPIVersion: - of: v1 - - equal: - path: metadata.name - value: portal - - isSubset: - path: data - content: - protocol-main-main: http - protocol-main-main2: http - protocol-other-other: http - protocol-other-other2: http - - - it: should pass with https protocol on multiple service/port - documentIndex: &dualServicePortalDoc 3 - set: - service: - main: - enabled: true - ports: - main: - enabled: true - primary: true - port: 10000 - protocol: HTTPS - targetPort: 80 - main2: - enabled: true - port: 10000 - protocol: HTTPS - targetPort: 80 - other: - enabled: true - ports: - other: - enabled: true - primary: true - port: 10000 - protocol: HTTPS - targetPort: 80 - other2: - enabled: true - port: 10000 - protocol: HTTPS - targetPort: 80 - asserts: - - isKind: - of: ConfigMap - - isAPIVersion: - of: v1 - - equal: - path: metadata.name - value: portal - - isSubset: - path: data - content: - protocol-main-main: https - protocol-main-main2: https - protocol-other-other: https - protocol-other-other2: https - - - it: should pass with no protocol on multiple service/port - documentIndex: &dualServicePortalDoc 3 - set: - service: - main: - enabled: true - ports: - main: - enabled: true - primary: true - port: 10000 - targetPort: 80 - main2: - enabled: true - port: 10000 - targetPort: 80 - other: - enabled: true - ports: - other: - enabled: true - primary: true - port: 10000 - targetPort: 80 - other2: - enabled: true - port: 10000 - targetPort: 80 - asserts: - - isKind: - of: ConfigMap - - isAPIVersion: - of: v1 - - equal: - path: metadata.name - value: portal - - isSubset: - path: data - content: - protocol-main-main: http - protocol-main-main2: http - protocol-other-other: http - protocol-other-other2: http - - - it: should pass with https protocol on multiple service/port and override on single - documentIndex: &dualServicePortalDoc 3 - set: - portal: - other: - other: - protocol: http - service: - main: - enabled: true - ports: - main: - enabled: true - primary: true - port: 10000 - protocol: HTTPS - targetPort: 80 - main2: - enabled: true - port: 10000 - protocol: HTTPS - targetPort: 80 - other: - enabled: true - ports: - other: - enabled: true - primary: true - port: 10000 - protocol: HTTPS - targetPort: 80 - other2: - enabled: true - port: 10000 - protocol: HTTPS - targetPort: 80 - asserts: - - isKind: - of: ConfigMap - - isAPIVersion: - of: v1 - - equal: - path: metadata.name - value: portal - - isSubset: - path: data - content: - protocol-main-main: https - protocol-main-main2: https - protocol-other-other: http - protocol-other-other2: https - - - it: should pass with https protocol on multiple service/port and override on single (caps) - documentIndex: *dualServicePortalDoc - set: - portal: - other: - other: - protocol: HTTP - service: - main: - enabled: true - ports: - main: - enabled: true - primary: true - port: 10000 - protocol: HTTPS - targetPort: 80 - main2: - enabled: true - port: 10000 - protocol: HTTPS - targetPort: 80 - other: - enabled: true - ports: - other: - enabled: true - primary: true - port: 10000 - protocol: HTTPS - targetPort: 80 - other2: - enabled: true - port: 10000 - protocol: HTTPS - targetPort: 80 - asserts: - - isKind: - of: ConfigMap - - isAPIVersion: - of: v1 - - equal: - path: metadata.name - value: portal - - isSubset: - path: data - content: - protocol-main-main: https - protocol-main-main2: https - protocol-other-other: http - protocol-other-other2: https - - - it: should pass with https protocol on multiple service/port and override on multiple - documentIndex: *dualServicePortalDoc - set: - portal: - main: - main: - protocol: http - main2: - protocol: http - other: - other: - protocol: http - other2: - protocol: http - service: - main: - enabled: true - ports: - main: - enabled: true - primary: true - port: 10000 - protocol: HTTPS - targetPort: 80 - main2: - enabled: true - port: 10000 - protocol: HTTPS - targetPort: 80 - other: - enabled: true - ports: - other: - enabled: true - primary: true - port: 10000 - protocol: HTTPS - targetPort: 80 - other2: - enabled: true - port: 10000 - protocol: HTTPS - targetPort: 80 - asserts: - - isKind: - of: ConfigMap - - isAPIVersion: - of: v1 - - equal: - path: metadata.name - value: portal - - isSubset: - path: data - content: - protocol-main-main: http - protocol-main-main2: http - protocol-other-other: http - protocol-other-other2: http - - - it: should pass with https protocol on multiple service/port and override on multiple from tpl - documentIndex: *dualServicePortalDoc - set: - protocol1: http - protocol2: http - protocol3: http - protocol4: http - portal: - main: - main: - protocol: "{{ .Values.protocol1 }}" - main2: - protocol: "{{ .Values.protocol2 }}" - other: - other: - protocol: "{{ .Values.protocol3 }}" - other2: - protocol: "{{ .Values.protocol4 }}" - service: - main: - enabled: true - ports: - main: - enabled: true - primary: true - port: 10000 - protocol: HTTPS - targetPort: 80 - main2: - enabled: true - port: 10000 - protocol: HTTPS - targetPort: 80 - other: - enabled: true - ports: - other: - enabled: true - primary: true - port: 10000 - protocol: HTTPS - targetPort: 80 - other2: - enabled: true - port: 10000 - protocol: HTTPS - targetPort: 80 - asserts: - - isKind: - of: ConfigMap - - isAPIVersion: - of: v1 - - equal: - path: metadata.name - value: portal - - isSubset: - path: data - content: - protocol-main-main: http - protocol-main-main2: http - protocol-other-other: http - protocol-other-other2: http diff --git a/.to_be_deleted/common-test/tests/portal/portal_test.yaml b/.to_be_deleted/common-test/tests/portal/portal_test.yaml deleted file mode 100644 index 168752a39f..0000000000 --- a/.to_be_deleted/common-test/tests/portal/portal_test.yaml +++ /dev/null @@ -1,120 +0,0 @@ -suite: portal port test -templates: - - common.yaml -chart: - appVersion: &appVer v1.2.3 -tests: - - it: should pass with default values - documentIndex: &portalDoc 2 - asserts: - - hasDocuments: - count: 3 - - isKind: - of: ConfigMap - - isAPIVersion: - of: v1 - - - it: should pass with portal disabled - set: - portal: - enabled: false - asserts: - - hasDocuments: - count: 2 - - - it: should pass with default labels - documentIndex: *portalDoc - asserts: - - equal: - path: metadata.labels - value: - app: common-test - app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: common-test - app.kubernetes.io/version: *appVer - helm-revision: "0" - helm.sh/chart: common-test-1.0.0 - release: RELEASE-NAME - - - it: should pass with global labels - documentIndex: *portalDoc - set: - global: - labels: - some_key: some_value - some_key1: some_value1 - asserts: - - equal: - path: metadata.labels - value: - app: common-test - app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: common-test - app.kubernetes.io/version: *appVer - helm-revision: "0" - helm.sh/chart: common-test-1.0.0 - release: RELEASE-NAME - some_key: some_value - some_key1: some_value1 - - - it: should pass with global labels from tpl - documentIndex: *portalDoc - set: - k1: some_value - k2: some_value1 - global: - labels: - some_key: "{{ .Values.k1 }}" - some_key1: "{{ .Values.k2 }}" - asserts: - - equal: - path: metadata.labels - value: - app: common-test - app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: common-test - app.kubernetes.io/version: *appVer - helm-revision: "0" - helm.sh/chart: common-test-1.0.0 - release: RELEASE-NAME - some_key: some_value - some_key1: some_value1 - - - it: should pass with default annotations - documentIndex: *portalDoc - asserts: - - isNull: - path: metadata.annotations - - - it: should pass with global annotations - documentIndex: *portalDoc - set: - global: - annotations: - some_key: some_value - some_key1: some_value1 - asserts: - - equal: - path: metadata.annotations - value: - some_key: some_value - some_key1: some_value1 - - - it: should pass with global annotations from tpl - documentIndex: *portalDoc - set: - k1: some_value - k2: some_value1 - global: - annotations: - some_key: "{{ .Values.k1 }}" - some_key1: "{{ .Values.k2 }}" - asserts: - - equal: - path: metadata.annotations - value: - some_key: some_value - some_key1: some_value1 diff --git a/.to_be_deleted/common-test/tests/pvc/pvc_test.yaml b/.to_be_deleted/common-test/tests/pvc/pvc_test.yaml deleted file mode 100644 index 51f0e3bbd2..0000000000 --- a/.to_be_deleted/common-test/tests/pvc/pvc_test.yaml +++ /dev/null @@ -1,693 +0,0 @@ -suite: pvc test -templates: - - common.yaml -chart: - appVersion: &appVer v1.2.3 -tests: - - it: should pass with default values - documentIndex: &deploymentDoc 0 - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Deployment - - - it: should fail with SCALE-ZFS storageClass but not scaleZFSStorageClass in global - set: - globalDefaults: - scaleZFSStorageClass: "" - persistence: - vol1: - enabled: true - type: pvc - storageClass: SCALE-ZFS - mountPath: /somepath - asserts: - - failedTemplate: - errorMessage: A storageClass must be defined in globalDefaults.scaleZFSStorageClass - - - it: should fail with invalid accessMode - set: - persistence: - vol1: - enabled: true - type: pvc - accessMode: invalid_mode - mountPath: /somepath - asserts: - - failedTemplate: - errorMessage: Invalid option (invalid_mode). Valid options are ReadWriteOnce, ReadOnlyMany, ReadWriteMany and ReadWriteOncePod - - - it: should pass with correct name - documentIndex: &pvcDoc 2 - set: - persistence: - vol1: - enabled: true - type: pvc - mountPath: /somepath - asserts: - - isKind: - of: PersistentVolumeClaim - - isAPIVersion: - of: v1 - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-vol1 - - isNull: - path: spec.storageClassName - - isNull: - path: spec.volumeName - - - it: should pass with force name defined - documentIndex: *pvcDoc - set: - persistence: - vol1: - enabled: true - type: pvc - mountPath: /somepath - forceName: forced_name - asserts: - - equal: - path: metadata.name - value: forced_name - - isNull: - path: spec.storageClassName - - isNull: - path: spec.volumeName - - - it: should pass with force name defined from tpl - documentIndex: *pvcDoc - set: - some_name: forced_name - persistence: - vol1: - enabled: true - type: pvc - mountPath: /somepath - forceName: "{{ .Values.some_name }}" - asserts: - - equal: - path: metadata.name - value: forced_name - - isNull: - path: spec.storageClassName - - isNull: - path: spec.volumeName - - - it: should pass with nameOverride defined - documentIndex: *pvcDoc - set: - persistence: - vol1: - enabled: true - type: pvc - mountPath: /somepath - nameOverride: some_name - asserts: - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-some_name - - isNull: - path: spec.storageClassName - - isNull: - path: spec.volumeName - - - it: should pass without type explicitly set to pvc - documentIndex: *pvcDoc - set: - persistence: - vol1: - enabled: true - mountPath: /somepath - asserts: - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-vol1 - - isNull: - path: spec.storageClassName - - isNull: - path: spec.volumeName - - - it: should pass without accessMode explicitly set to ReadWriteOnce - documentIndex: *pvcDoc - set: - persistence: - vol1: - enabled: true - mountPath: /somepath - asserts: - - equal: - path: spec - value: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 1Gi - - isNull: - path: spec.storageClassName - - isNull: - path: spec.volumeName - - - it: should pass with accessMode changed - documentIndex: *pvcDoc - set: - persistence: - vol1: - enabled: true - mountPath: /somepath - accessMode: ReadOnlyMany - asserts: - - equal: - path: spec - value: - accessModes: - - ReadOnlyMany - resources: - requests: - storage: 1Gi - - isNull: - path: spec.storageClassName - - isNull: - path: spec.volumeName - - - it: should pass with accessMode changed from tpl - documentIndex: *pvcDoc - set: - mode: ReadOnlyMany - persistence: - vol1: - enabled: true - mountPath: /somepath - accessMode: "{{ .Values.mode }}" - asserts: - - equal: - path: spec - value: - accessModes: - - ReadOnlyMany - resources: - requests: - storage: 1Gi - - isNull: - path: spec.storageClassName - - isNull: - path: spec.volumeName - - - it: should pass without size explicitly set to 1Gi - documentIndex: *pvcDoc - set: - persistence: - vol1: - enabled: true - mountPath: /somepath - asserts: - - equal: - path: spec - value: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 1Gi - - isNull: - path: spec.storageClassName - - isNull: - path: spec.volumeName - - - it: should pass with size changed - documentIndex: *pvcDoc - set: - persistence: - vol1: - enabled: true - mountPath: /somepath - size: 2Gi - asserts: - - equal: - path: spec - value: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 2Gi - - isNull: - path: spec.storageClassName - - isNull: - path: spec.volumeName - - - it: should pass with size changed from tpl - documentIndex: *pvcDoc - set: - size: 2Gi - persistence: - vol1: - enabled: true - mountPath: /somepath - size: "{{ .Values.size }}" - asserts: - - equal: - path: spec - value: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 2Gi - - isNull: - path: spec.storageClassName - - isNull: - path: spec.volumeName - - - it: should pass with storageClass set to SCALE-ZFS - documentIndex: *pvcDoc - set: - globalDefaults: - scaleZFSStorageClass: something - persistence: - vol1: - enabled: true - mountPath: /somepath - storageClass: SCALE-ZFS - asserts: - - equal: - path: spec - value: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 1Gi - storageClassName: something - - - it: should pass with storageClass set to SCALE-ZFS from tpl - documentIndex: *pvcDoc - set: - key: something - globalDefaults: - scaleZFSStorageClass: "{{ .Values.key }}" - persistence: - vol1: - enabled: true - mountPath: /somepath - storageClass: SCALE-ZFS - asserts: - - equal: - path: spec - value: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 1Gi - storageClassName: something - - - it: should pass with storageClass set to "-" - documentIndex: *pvcDoc - set: - persistence: - vol1: - enabled: true - mountPath: /somepath - storageClass: "-" - asserts: - - equal: - path: spec - value: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 1Gi - storageClassName: "" - - isNotNull: - path: spec.storageClassName - - - it: should pass with storageClass set to something - documentIndex: *pvcDoc - set: - persistence: - vol1: - enabled: true - mountPath: /somepath - storageClass: something - asserts: - - equal: - path: spec - value: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 1Gi - storageClassName: something - - - it: should pass with storageClass set to something from tpl - documentIndex: *pvcDoc - set: - scName: something - persistence: - vol1: - enabled: true - mountPath: /somepath - storageClass: "{{ .Values.scName }}" - asserts: - - equal: - path: spec - value: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 1Gi - storageClassName: something - - - it: should pass with storageClass defined globally - documentIndex: *pvcDoc - set: - globalDefaults: - storageClass: something - persistence: - vol1: - enabled: true - mountPath: /somepath - asserts: - - equal: - path: spec - value: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 1Gi - storageClassName: something - - - it: should pass with volumeName set to something - documentIndex: *pvcDoc - set: - persistence: - vol1: - enabled: true - mountPath: /somepath - volumeName: something - asserts: - - equal: - path: spec - value: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 1Gi - volumeName: something - - isNull: - path: spec.storageClassName - - - it: should pass with volumeName set to something from tpl - documentIndex: *pvcDoc - set: - vName: something - persistence: - vol1: - enabled: true - mountPath: /somepath - volumeName: "{{ .Values.vName }}" - asserts: - - equal: - path: spec - value: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 1Gi - volumeName: something - - isNull: - path: spec.storageClassName - - - it: should pass with custom spec is applied - documentIndex: *pvcDoc - set: - persistence: - vol1: - enabled: true - mountPath: /somepath - spec: - some: - value: custom - asserts: - - equal: - path: spec - value: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 1Gi - some: - value: custom - - isNull: - path: spec.storageClassName - - isNull: - path: spec.volumeName - - - it: should pass with custom spec is applied with tpl - documentIndex: *pvcDoc - set: - key: custom - persistence: - vol1: - enabled: true - mountPath: /somepath - spec: - some: - value: "{{ .Values.key }}" - asserts: - - equal: - path: spec - value: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 1Gi - some: - value: custom - - isNull: - path: spec.storageClassName - - isNull: - path: spec.volumeName - - - it: should pass with multiple persistence enabled - documentIndex: *pvcDoc - set: - persistence: - vol1: - enabled: true - mountPath: /somepath - vol2: - enabled: true - mountPath: /somepath - asserts: - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-vol1 - - equal: - path: spec - value: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 1Gi - - isNull: - path: spec.storageClassName - - isNull: - path: spec.volumeName - - - it: should pass with multiple persistence enabled (other pvcDoc) - documentIndex: &otherPvcDoc 3 - set: - persistence: - vol1: - enabled: true - mountPath: /somepath - vol2: - enabled: true - mountPath: /somepath - asserts: - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-vol2 - - equal: - path: spec - value: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 1Gi - - isNull: - path: spec.storageClassName - - isNull: - path: spec.volumeName - - - it: should pass with labels - documentIndex: *pvcDoc - set: - persistence: - vol1: - enabled: true - mountPath: /somepath - labels: - some_key: value - some_key1: value1 - asserts: - - equal: - path: metadata.labels - value: - app: common-test - app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: common-test - app.kubernetes.io/version: *appVer - helm-revision: "0" - helm.sh/chart: common-test-1.0.0 - release: RELEASE-NAME - some_key: value - some_key1: value1 - - - it: should pass with labels and global labels - documentIndex: *pvcDoc - set: - global: - labels: - some_key2: value2 - some_key3: value3 - persistence: - vol1: - enabled: true - mountPath: /somepath - labels: - some_key: value - some_key1: value1 - asserts: - - equal: - path: metadata.labels - value: - app: common-test - app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: common-test - app.kubernetes.io/version: *appVer - helm-revision: "0" - helm.sh/chart: common-test-1.0.0 - release: RELEASE-NAME - some_key: value - some_key1: value1 - some_key2: value2 - some_key3: value3 - - - it: should pass with annotations - documentIndex: *pvcDoc - set: - persistence: - vol1: - enabled: true - mountPath: /somepath - annotations: - some_key: value - some_key1: value1 - asserts: - - equal: - path: metadata.annotations - value: - some_key: value - some_key1: value1 - - - it: should pass with annotations and global annotations - documentIndex: *pvcDoc - set: - global: - annotations: - some_key2: value2 - some_key3: value3 - persistence: - vol1: - enabled: true - mountPath: /somepath - annotations: - some_key: value - some_key1: value1 - asserts: - - equal: - path: metadata.annotations - value: - some_key: value - some_key1: value1 - some_key2: value2 - some_key3: value3 - - - it: should pass with annotations and global retain true - documentIndex: *pvcDoc - set: - globalDefaults: - PVCRetain: true - persistence: - vol1: - enabled: true - mountPath: /somepath - annotations: - some_key: value - some_key1: value1 - asserts: - - equal: - path: metadata.annotations - value: - "helm.sh/resource-policy": keep - some_key: value - some_key1: value1 - - - it: should pass with annotations and global retain true and pvc object to false - documentIndex: *pvcDoc - set: - globalDefaults: - PVCRetain: true - persistence: - vol1: - enabled: true - mountPath: /somepath - retain: false - annotations: - some_key: value - some_key1: value1 - asserts: - - equal: - path: metadata.annotations - value: - some_key: value - some_key1: value1 - - - it: should pass with annotations and global retain false and pvc object to true - documentIndex: *pvcDoc - set: - globalDefaults: - PVCRetain: false - persistence: - vol1: - enabled: true - mountPath: /somepath - retain: true - annotations: - some_key: value - some_key1: value1 - asserts: - - equal: - path: metadata.annotations - value: - "helm.sh/resource-policy": keep - some_key: value - some_key1: value1 diff --git a/.to_be_deleted/common-test/tests/rbac/rbac_test.yaml b/.to_be_deleted/common-test/tests/rbac/rbac_test.yaml deleted file mode 100644 index 1bbd2d870b..0000000000 --- a/.to_be_deleted/common-test/tests/rbac/rbac_test.yaml +++ /dev/null @@ -1,1212 +0,0 @@ - -suite: rbac test -templates: - - common.yaml -chart: - appVersion: &appVer v1.2.3 -release: - namespace: &ns some_name_space -tests: - - it: should pass with default values - documentIndex: &deploymentDoc 0 - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Deployment - - - it: should fail with multiple rbac, without any set as primary - set: - rbac: - main: - enabled: true - primary: false - main2: - enabled: true - primary: false - asserts: - - failedTemplate: - errorMessage: At least one RBAC must be set as primary - - - it: should fail with no rules in rbac - set: - rbac: - main: - enabled: true - rules: [] - subjects: &subjects - - kind: something - name: something - apiGroup: something - asserts: - - failedTemplate: - errorMessage: cannot be empty in RBAC. - - - it: should fail with no apiGroups in rules - set: - rbac: - main: - enabled: true - rules: - - apiGroups: [] - resources: - - something - verbs: - - something - subjects: *subjects - asserts: - - failedTemplate: - errorMessage: cannot be empty in RBAC rules. - - - it: should fail with no resources in rules - set: - rbac: - main: - enabled: true - rules: - - apiGroups: - - something - resources: [] - verbs: - - something - subjects: *subjects - asserts: - - failedTemplate: - errorMessage: cannot be empty in RBAC rules. - - - it: should fail with no verbs in rules - set: - rbac: - main: - enabled: true - rules: - - apiGroups: - - something - resources: - - something - verbs: [] - subjects: *subjects - asserts: - - failedTemplate: - errorMessage: cannot be empty in RBAC rules. - - - it: should fail with no kind in subjects - set: - rbac: - main: - enabled: true - rules: &rules - - apiGroups: - - something - resources: - - something - verbs: - - something - subjects: - - kind: "" - asserts: - - failedTemplate: - errorMessage: cannot be empty in RBAC subjects. - - - it: should fail with no name in subjects - set: - rbac: - main: - enabled: true - rules: *rules - subjects: - - kind: something - name: "" - asserts: - - failedTemplate: - errorMessage: cannot be empty in RBAC subjects. - - - it: should fail with no apiGroup in subjects - set: - rbac: - main: - enabled: true - rules: *rules - subjects: - - kind: something - name: something - apiGroup: "" - asserts: - - failedTemplate: - errorMessage: cannot be empty in RBAC subjects. - - - it: should pass with rbac account enabled (Role) - documentIndex: &roleDoc 0 - set: - rbac: - main: - enabled: true - rules: *rules - subjects: *subjects - asserts: - - isKind: - of: Role - - isAPIVersion: - of: rbac.authorization.k8s.io/v1 - - equal: - path: metadata.name - value: RELEASE-NAME-common-test - - equal: - path: metadata.namespace - value: *ns - - - it: should pass with rbac account enabled (RoleBinding) - documentIndex: &roleBindingDoc 1 - set: - rbac: - main: - enabled: true - rules: *rules - subjects: *subjects - asserts: - - isKind: - of: RoleBinding - - isAPIVersion: - of: rbac.authorization.k8s.io/v1 - - equal: - path: metadata.name - value: RELEASE-NAME-common-test - - equal: - path: metadata.namespace - value: *ns - - equal: - path: roleRef - value: - apiGroup: rbac.authorization.k8s.io - kind: Role - name: RELEASE-NAME-common-test - - - it: should pass with rbac account enabled (ClusterRole) - documentIndex: &roleDoc 0 - set: - rbac: - main: - enabled: true - clusterWide: true - rules: *rules - subjects: *subjects - asserts: - - isKind: - of: ClusterRole - - isAPIVersion: - of: rbac.authorization.k8s.io/v1 - - equal: - path: metadata.name - value: RELEASE-NAME-common-test - - - it: should pass with rbac account enabled (ClusterRoleBinding) - documentIndex: &roleBindingDoc 1 - set: - rbac: - main: - enabled: true - clusterWide: true - rules: *rules - subjects: *subjects - asserts: - - isKind: - of: ClusterRoleBinding - - isAPIVersion: - of: rbac.authorization.k8s.io/v1 - - equal: - path: metadata.name - value: RELEASE-NAME-common-test - - equal: - path: roleRef - value: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: RELEASE-NAME-common-test - - - it: should pass with primary rbac enabled and nameOverride defined (Role) - documentIndex: *roleDoc - set: - rbac: - main: - enabled: true - nameOverride: some-name - rules: *rules - subjects: *subjects - asserts: - - isKind: - of: Role - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-some-name - - - it: should pass with primary rbac enabled and nameOverride defined (RoleBinding) - documentIndex: *roleBindingDoc - set: - rbac: - main: - enabled: true - nameOverride: some-name - rules: *rules - subjects: *subjects - asserts: - - isKind: - of: RoleBinding - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-some-name - - - it: should pass with primary rbac enabled and nameOverride defined (ClusterRole) - documentIndex: *roleDoc - set: - rbac: - main: - enabled: true - nameOverride: some-name - clusterWide: true - rules: *rules - subjects: *subjects - asserts: - - isKind: - of: ClusterRole - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-some-name - - - it: should pass with primary rbac enabled and nameOverride defined (ClusterRoleBinding) - documentIndex: *roleBindingDoc - set: - rbac: - main: - enabled: true - nameOverride: some-name - clusterWide: true - rules: *rules - subjects: *subjects - asserts: - - isKind: - of: ClusterRoleBinding - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-some-name - - - it: should pass with primary rbac enabled annotations and labels added (Role) - documentIndex: *roleDoc - set: - rbac: - main: - enabled: true - annotations: - key1: value1 - key2: value2 - labels: - key3: value3 - key4: value4 - rules: *rules - subjects: *subjects - asserts: - - isKind: - of: Role - - equal: - path: metadata.name - value: RELEASE-NAME-common-test - - equal: - path: metadata.annotations - value: - key1: value1 - key2: value2 - - equal: - path: metadata.labels - value: - app: common-test - app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: common-test - app.kubernetes.io/version: *appVer - helm-revision: "0" - helm.sh/chart: common-test-1.0.0 - release: RELEASE-NAME - key3: value3 - key4: value4 - - - it: should pass with primary rbac enabled annotations and labels added (RoleBinding) - documentIndex: *roleBindingDoc - set: - rbac: - main: - enabled: true - annotations: - key1: value1 - key2: value2 - labels: - key3: value3 - key4: value4 - rules: *rules - subjects: *subjects - asserts: - - isKind: - of: RoleBinding - - equal: - path: metadata.name - value: RELEASE-NAME-common-test - - equal: - path: metadata.annotations - value: - key1: value1 - key2: value2 - - equal: - path: metadata.labels - value: - app: common-test - app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: common-test - app.kubernetes.io/version: *appVer - helm-revision: "0" - helm.sh/chart: common-test-1.0.0 - release: RELEASE-NAME - key3: value3 - key4: value4 - - - it: should pass with primary rbac enabled annotations and labels added (ClusterRole) - documentIndex: *roleDoc - set: - rbac: - main: - enabled: true - clusterWide: true - annotations: - key1: value1 - key2: value2 - labels: - key3: value3 - key4: value4 - rules: *rules - subjects: *subjects - asserts: - - isKind: - of: ClusterRole - - equal: - path: metadata.name - value: RELEASE-NAME-common-test - - equal: - path: metadata.annotations - value: - key1: value1 - key2: value2 - - equal: - path: metadata.labels - value: - app: common-test - app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: common-test - app.kubernetes.io/version: *appVer - helm-revision: "0" - helm.sh/chart: common-test-1.0.0 - release: RELEASE-NAME - key3: value3 - key4: value4 - - - it: should pass with primary rbac enabled annotations and labels added (ClusterRoleBinding) - documentIndex: *roleBindingDoc - set: - rbac: - main: - enabled: true - clusterWide: true - annotations: - key1: value1 - key2: value2 - labels: - key3: value3 - key4: value4 - rules: *rules - subjects: *subjects - asserts: - - isKind: - of: ClusterRoleBinding - - equal: - path: metadata.name - value: RELEASE-NAME-common-test - - equal: - path: metadata.annotations - value: - key1: value1 - key2: value2 - - equal: - path: metadata.labels - value: - app: common-test - app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: common-test - app.kubernetes.io/version: *appVer - helm-revision: "0" - helm.sh/chart: common-test-1.0.0 - release: RELEASE-NAME - key3: value3 - key4: value4 - - - it: should pass with primary rbac enabled annotations and labels added from tpl (Role) - documentIndex: *roleDoc - set: - k1: value1 - k2: value2 - k3: value3 - k4: value4 - rbac: - main: - enabled: true - annotations: - key1: "{{ .Values.k1 }}" - key2: "{{ .Values.k2 }}" - labels: - key3: "{{ .Values.k3 }}" - key4: "{{ .Values.k4 }}" - rules: *rules - subjects: *subjects - asserts: - - isKind: - of: Role - - equal: - path: metadata.name - value: RELEASE-NAME-common-test - - equal: - path: metadata.annotations - value: - key1: value1 - key2: value2 - - equal: - path: metadata.labels - value: - app: common-test - app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: common-test - app.kubernetes.io/version: *appVer - helm-revision: "0" - helm.sh/chart: common-test-1.0.0 - release: RELEASE-NAME - key3: value3 - key4: value4 - - - it: should pass with primary rbac enabled annotations and labels added from tpl (RoleBinding) - documentIndex: *roleBindingDoc - set: - k1: value1 - k2: value2 - k3: value3 - k4: value4 - rbac: - main: - enabled: true - annotations: - key1: "{{ .Values.k1 }}" - key2: "{{ .Values.k2 }}" - labels: - key3: "{{ .Values.k3 }}" - key4: "{{ .Values.k4 }}" - rules: *rules - subjects: *subjects - asserts: - - isKind: - of: RoleBinding - - equal: - path: metadata.name - value: RELEASE-NAME-common-test - - equal: - path: metadata.annotations - value: - key1: value1 - key2: value2 - - equal: - path: metadata.labels - value: - app: common-test - app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: common-test - app.kubernetes.io/version: *appVer - helm-revision: "0" - helm.sh/chart: common-test-1.0.0 - release: RELEASE-NAME - key3: value3 - key4: value4 - - - it: should pass with primary rbac enabled annotations and labels added (ClusterRole) - documentIndex: *roleDoc - set: - k1: value1 - k2: value2 - k3: value3 - k4: value4 - rbac: - main: - enabled: true - clusterWide: true - annotations: - key1: "{{ .Values.k1 }}" - key2: "{{ .Values.k2 }}" - labels: - key3: "{{ .Values.k3 }}" - key4: "{{ .Values.k4 }}" - rules: *rules - subjects: *subjects - asserts: - - isKind: - of: ClusterRole - - equal: - path: metadata.name - value: RELEASE-NAME-common-test - - equal: - path: metadata.annotations - value: - key1: value1 - key2: value2 - - equal: - path: metadata.labels - value: - app: common-test - app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: common-test - app.kubernetes.io/version: *appVer - helm-revision: "0" - helm.sh/chart: common-test-1.0.0 - release: RELEASE-NAME - key3: value3 - key4: value4 - - - it: should pass with primary rbac enabled annotations and labels added (ClusterRoleBinding) - documentIndex: *roleBindingDoc - set: - k1: value1 - k2: value2 - k3: value3 - k4: value4 - rbac: - main: - enabled: true - clusterWide: true - annotations: - key1: "{{ .Values.k1 }}" - key2: "{{ .Values.k2 }}" - labels: - key3: "{{ .Values.k3 }}" - key4: "{{ .Values.k4 }}" - rules: *rules - subjects: *subjects - asserts: - - isKind: - of: ClusterRoleBinding - - equal: - path: metadata.name - value: RELEASE-NAME-common-test - - equal: - path: metadata.annotations - value: - key1: value1 - key2: value2 - - equal: - path: metadata.labels - value: - app: common-test - app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: common-test - app.kubernetes.io/version: *appVer - helm-revision: "0" - helm.sh/chart: common-test-1.0.0 - release: RELEASE-NAME - key3: value3 - key4: value4 - - - - it: should pass with non-primary rbac enabled and nameOverride defined (Role - main) - documentIndex: *roleDoc - set: - rbac: - main: - enabled: true - primary: true - rules: *rules - subjects: *subjects - other: - enabled: true - primary: false - nameOverride: some-name - rules: *rules - subjects: *subjects - asserts: - - isKind: - of: Role - - equal: - path: metadata.name - value: RELEASE-NAME-common-test - - - it: should pass with non-primary rbac enabled and nameOverride defined (RoleBinding - main) - documentIndex: *roleBindingDoc - set: - rbac: - main: - enabled: true - primary: true - rules: *rules - subjects: *subjects - other: - enabled: true - primary: false - nameOverride: some-name - rules: *rules - subjects: *subjects - asserts: - - isKind: - of: RoleBinding - - equal: - path: metadata.name - value: RELEASE-NAME-common-test - - - it: should pass with non-primary rbac enabled and nameOverride defined (Role - main) - documentIndex: &otherRoleDoc 2 - set: - rbac: - main: - enabled: true - primary: true - rules: *rules - subjects: *subjects - other: - enabled: true - primary: false - nameOverride: some-name - rules: *rules - subjects: *subjects - asserts: - - isKind: - of: Role - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-some-name - - - it: should pass with non-primary rbac enabled and nameOverride defined (RoleBinding - other) - documentIndex: &otherRoleBindingDoc 3 - set: - rbac: - main: - enabled: true - primary: true - rules: *rules - subjects: *subjects - other: - enabled: true - primary: false - nameOverride: some-name - rules: *rules - subjects: *subjects - asserts: - - isKind: - of: RoleBinding - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-some-name - - - it: should pass with non-primary rbac enabled and nameOverride defined (ClusterRole - other) - documentIndex: &otherRoleDoc 2 - set: - rbac: - main: - enabled: true - primary: true - rules: *rules - subjects: *subjects - other: - enabled: true - primary: false - clusterWide: true - nameOverride: some-name - rules: *rules - subjects: *subjects - asserts: - - isKind: - of: ClusterRole - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-some-name - - - it: should pass with non-primary rbac enabled and nameOverride defined (ClusterRoleBinding - other) - documentIndex: &otherRoleBindingDoc 3 - set: - rbac: - main: - enabled: true - primary: true - rules: *rules - subjects: *subjects - other: - enabled: true - primary: false - clusterWide: true - nameOverride: some-name - rules: *rules - subjects: *subjects - asserts: - - isKind: - of: ClusterRoleBinding - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-some-name - - - it: should pass with "" in apiGroups in rules - documentIndex: *roleDoc - set: - rbac: - main: - enabled: true - rules: - - apiGroups: - - "" - resources: - - something - verbs: - - something - subjects: *subjects - asserts: - - isKind: - of: Role - - equal: - path: rules - value: - - apiGroups: - - "" - resources: - - something - verbs: - - something - - - it: should pass with "" in apiGroups in rules, multiple entries - documentIndex: *roleDoc - set: - rbac: - main: - enabled: true - rules: - - apiGroups: - - "" - resources: - - something - verbs: - - something - - apiGroups: - - "" - resources: - - something_else - verbs: - - something_else - subjects: *subjects - asserts: - - isKind: - of: Role - - equal: - path: rules - value: - - apiGroups: - - "" - resources: - - something - verbs: - - something - - apiGroups: - - "" - resources: - - something_else - verbs: - - something_else - - - it: should pass with * in rules - documentIndex: *roleDoc - set: - rbac: - main: - enabled: true - rules: - - apiGroups: - - "*" - resources: - - "*" - verbs: - - "*" - subjects: *subjects - asserts: - - isKind: - of: Role - - equal: - path: rules - value: - - apiGroups: - - "*" - resources: - - "*" - verbs: - - "*" - - - it: should pass with * in rules, multiple entries - documentIndex: *roleDoc - set: - rbac: - main: - enabled: true - rules: - - apiGroups: - - "*" - resources: - - "*" - verbs: - - "*" - - apiGroups: - - "*" - resources: - - "*" - verbs: - - "*" - subjects: *subjects - asserts: - - isKind: - of: Role - - equal: - path: rules - value: - - apiGroups: - - "*" - resources: - - "*" - verbs: - - "*" - - apiGroups: - - "*" - resources: - - "*" - verbs: - - "*" - - - it: should pass with rules from tpl - documentIndex: *roleDoc - set: - k1: "*" - k2: value2 - k3: value3 - rbac: - main: - enabled: true - rules: - - apiGroups: - - "{{ .Values.k1 }}" - resources: - - "{{ .Values.k2 }}" - verbs: - - "{{ .Values.k3 }}" - subjects: *subjects - asserts: - - isKind: - of: Role - - equal: - path: rules - value: - - apiGroups: - - "*" - resources: - - value2 - verbs: - - value3 - - - it: should pass with rules from tpl, multiple entries - documentIndex: *roleDoc - set: - k1: "*" - k2: value2 - k3: value3 - k4: "*" - k5: value5 - k6: value6 - rbac: - main: - enabled: true - rules: - - apiGroups: - - "{{ .Values.k1 }}" - resources: - - "{{ .Values.k2 }}" - verbs: - - "{{ .Values.k3 }}" - - apiGroups: - - "{{ .Values.k4 }}" - resources: - - "{{ .Values.k5 }}" - verbs: - - "{{ .Values.k6 }}" - subjects: *subjects - asserts: - - isKind: - of: Role - - equal: - path: rules - value: - - apiGroups: - - "*" - resources: - - value2 - verbs: - - value3 - - apiGroups: - - "*" - resources: - - value5 - verbs: - - value6 - - - it: should pass with rules from tpl, multiple entries (ClusterRole) - documentIndex: *roleDoc - set: - k1: "*" - k2: value2 - k3: value3 - k4: "*" - k5: value5 - k6: value6 - rbac: - main: - enabled: true - clusterWide: true - rules: - - apiGroups: - - "{{ .Values.k1 }}" - resources: - - "{{ .Values.k2 }}" - verbs: - - "{{ .Values.k3 }}" - - apiGroups: - - "{{ .Values.k4 }}" - resources: - - "{{ .Values.k5 }}" - verbs: - - "{{ .Values.k6 }}" - subjects: *subjects - asserts: - - isKind: - of: ClusterRole - - equal: - path: rules - value: - - apiGroups: - - "*" - resources: - - value2 - verbs: - - value3 - - apiGroups: - - "*" - resources: - - value5 - verbs: - - value6 - - - it: should pass with subjects set - documentIndex: *roleBindingDoc - set: - rbac: - main: - enabled: true - rules: *rules - subjects: - - kind: value1 - name: value2 - apiGroup: value3 - asserts: - - isKind: - of: RoleBinding - - equal: - path: subjects - value: - - kind: ServiceAccount - name: default - namespace: *ns - - kind: value1 - name: value2 - apiGroup: value3 - - - it: should pass with subjects set, multiple entries - documentIndex: *roleBindingDoc - set: - rbac: - main: - enabled: true - rules: *rules - subjects: - - kind: value1 - name: value2 - apiGroup: value3 - - kind: value4 - name: value5 - apiGroup: value6 - asserts: - - isKind: - of: RoleBinding - - equal: - path: subjects - value: - - kind: ServiceAccount - name: default - namespace: *ns - - kind: value1 - name: value2 - apiGroup: value3 - - kind: value4 - name: value5 - apiGroup: value6 - - - it: should pass with subjects set, multiple entries from tpl - documentIndex: *roleBindingDoc - set: - k1: value1 - k2: value2 - k3: value3 - k4: value4 - k5: value5 - k6: value6 - rbac: - main: - enabled: true - rules: *rules - subjects: - - kind: "{{ .Values.k1 }}" - name: "{{ .Values.k2 }}" - apiGroup: "{{ .Values.k3 }}" - - kind: "{{ .Values.k4 }}" - name: "{{ .Values.k5 }}" - apiGroup: "{{ .Values.k6 }}" - asserts: - - isKind: - of: RoleBinding - - equal: - path: subjects - value: - - kind: ServiceAccount - name: default - namespace: *ns - - kind: value1 - name: value2 - apiGroup: value3 - - kind: value4 - name: value5 - apiGroup: value6 - - - it: should pass with subjects set, multiple entries from tpl (ClusterRoleBinding) - documentIndex: *roleBindingDoc - set: - k1: value1 - k2: value2 - k3: value3 - k4: value4 - k5: value5 - k6: value6 - rbac: - main: - enabled: true - clusterWide: true - rules: *rules - subjects: - - kind: "{{ .Values.k1 }}" - name: "{{ .Values.k2 }}" - apiGroup: "{{ .Values.k3 }}" - - kind: "{{ .Values.k4 }}" - name: "{{ .Values.k5 }}" - apiGroup: "{{ .Values.k6 }}" - asserts: - - isKind: - of: ClusterRoleBinding - - equal: - path: subjects - value: - - kind: ServiceAccount - name: default - namespace: *ns - - kind: value1 - name: value2 - apiGroup: value3 - - kind: value4 - name: value5 - apiGroup: value6 - - - it: should pass with subjects set, multiple entries and 2 service account 1 primary and nameOverride - documentIndex: &roleBindingDoc 3 - set: - rbac: - main: - enabled: true - rules: *rules - subjects: - - kind: value1 - name: value2 - apiGroup: value3 - - kind: value4 - name: value5 - apiGroup: value6 - serviceAccount: - main: - enabled: true - primary: true - nameOverride: the-main - other: - enabled: true - primary: false - asserts: - - isKind: - of: RoleBinding - - equal: - path: subjects - value: - - kind: ServiceAccount - name: RELEASE-NAME-common-test-the-main - namespace: *ns - - kind: value1 - name: value2 - apiGroup: value3 - - kind: value4 - name: value5 - apiGroup: value6 - - - it: should pass with subjects set, multiple entries and 2 service account 1 primary - documentIndex: *roleBindingDoc - set: - rbac: - main: - enabled: true - rules: *rules - subjects: - - kind: value1 - name: value2 - apiGroup: value3 - - kind: value4 - name: value5 - apiGroup: value6 - serviceAccount: - main: - enabled: true - primary: true - other: - enabled: true - primary: false - asserts: - - isKind: - of: RoleBinding - - equal: - path: subjects - value: - - kind: ServiceAccount - name: RELEASE-NAME-common-test - namespace: *ns - - kind: value1 - name: value2 - apiGroup: value3 - - kind: value4 - name: value5 - apiGroup: value6 diff --git a/.to_be_deleted/common-test/tests/secret/secret_test.yaml b/.to_be_deleted/common-test/tests/secret/secret_test.yaml deleted file mode 100644 index d2f6cea7b7..0000000000 --- a/.to_be_deleted/common-test/tests/secret/secret_test.yaml +++ /dev/null @@ -1,679 +0,0 @@ -suite: secret test -templates: - - common.yaml -chart: - appVersion: &appVer v1.2.3 -tests: - - it: should pass with default values - documentIndex: &deploymentDoc 0 - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Deployment - - - it: should fail without a dict in secret - set: - secret: - enabled: true - content: - key: value - asserts: - - failedTemplate: - errorMessage: key must have at least one dict. Found (bool) - - - it: should fail with uppercase in name in secret - set: - secret: - someName: - enabled: true - content: - key: value - asserts: - - failedTemplate: - errorMessage: Secret has invalid name (someName). Name must be lowercase. - - - it: should fail with underscore in name in secret - set: - secret: - some_name: - enabled: true - content: - key: value - asserts: - - failedTemplate: - errorMessage: Secret has invalid name (some_name). Name cannot contain underscores (_). - - - it: should fail with empty content in secret - set: - secret: - somename: - enabled: true - content: - asserts: - - failedTemplate: - errorMessage: Content of Secret (somename) are empty. Please disable or add content. - - - it: should fail with string in content in secret - set: - secret: - somename: - enabled: true - content: something - asserts: - - failedTemplate: - errorMessage: Content of Secret (somename) are string. Must be in key/value format. Value can be scalar too. - - - it: should pass with 1 secret created with parseAsEnv set - documentIndex: &secretDoc 0 - set: - secret: - some-name: - enabled: true - parseAsEnv: true - content: - key1: 123 - key2: value2 - asserts: - - hasDocuments: - count: 4 - - isKind: - of: Secret - - equal: - path: type - value: Opaque - - isAPIVersion: - of: v1 - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-some-name - - equal: - path: stringData - value: - key1: "123" - key2: value2 - - isNull: - path: metadata.annotations - - equal: - path: metadata.labels - value: - app: common-test - app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: common-test - app.kubernetes.io/version: *appVer - helm-revision: "0" - helm.sh/chart: common-test-1.0.0 - release: RELEASE-NAME - - - it: should pass with empty key in content in secret - documentIndex: *secretDoc - set: - secret: - somename: - enabled: true - content: - key: "" - asserts: - - equal: - path: stringData - value: - key: "" - - - it: should pass with 1 secret created with parseAsEnv and values set from tpl - documentIndex: *secretDoc - set: - k1: 123 - k2: value2 - secret: - some-name: - enabled: true - parseAsEnv: true - content: - key1: "{{ .Values.k1 }}" - key2: "{{ .Values.k2 }}" - asserts: - - equal: - path: stringData - value: - key1: "123" - key2: value2 - - - it: should pass with 1 secret created with nameOverride set - documentIndex: *secretDoc - set: - k1: true - k2: value2 - secret: - some-name: - enabled: true - parseAsEnv: true - nameOverride: some-new-name - content: - key1: "{{ .Values.k1 }}" - key2: "{{ .Values.k2 }}" - asserts: - - equal: - path: stringData - value: - key1: "true" - key2: value2 - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-some-new-name - - - it: should pass with multiple secret created with parseAsEnv set (1/2) and values from tpl - documentIndex: *secretDoc - set: - k1: value1 - k2: value2 - k3: value3 - k4: value4 - secret: - some-name: - enabled: true - parseAsEnv: true - content: - key1: "{{ .Values.k1 }}" - key2: "{{ .Values.k2 }}" - some-other-name: - enabled: true - parseAsEnv: true - content: - key3: "{{ .Values.k3 }}" - key4: "{{ .Values.k4 }}" - asserts: - - hasDocuments: - count: 5 - - isKind: - of: Secret - - isAPIVersion: - of: v1 - - equal: - path: type - value: Opaque - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-some-name - - equal: - path: stringData - value: - key1: value1 - key2: value2 - - isNull: - path: metadata.annotations - - equal: - path: metadata.labels - value: - app: common-test - app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: common-test - app.kubernetes.io/version: *appVer - helm-revision: "0" - helm.sh/chart: common-test-1.0.0 - release: RELEASE-NAME - - - it: should pass with multiple secret created with parseAsEnv set (2/2) and values from tpl - documentIndex: &otherSecretDoc 1 - set: - secret: - some-name: - enabled: true - parseAsEnv: true - content: - key1: value1 - key2: value2 - some-other-name: - enabled: true - parseAsEnv: true - content: - key3: value3 - key4: value4 - asserts: - - hasDocuments: - count: 5 - - isKind: - of: Secret - - equal: - path: type - value: Opaque - - isAPIVersion: - of: v1 - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-some-other-name - - equal: - path: stringData - value: - key3: value3 - key4: value4 - - isNull: - path: metadata.annotations - - equal: - path: metadata.labels - value: - app: common-test - app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: common-test - app.kubernetes.io/version: *appVer - helm-revision: "0" - helm.sh/chart: common-test-1.0.0 - release: RELEASE-NAME - - - it: should pass with multiple secret created with scalar in contents and tpl (1/2) - documentIndex: *secretDoc - set: - k1: value1 - k2: 80 - k3: pair - k4: value2 - k5: 81 - k6: pair2 - secret: - some-name: - enabled: true - content: - nginx.conf1: | - alias {{ .Values.k1 }} - listen {{ .Values.k2 }} - - function { - # some json - "key": { - "key2": "value", - "key3": "value2" - } - } - key: "{{ .Values.k3 }}" - some-other-name: - enabled: true - content: - key: "{{ .Values.k6 }}" - nginx.conf2: | - alias {{ .Values.k4 }} - listen {{ .Values.k5 }} - - function { - # some json - "key": { - "key2": "value", - "key3": "value2" - } - } - asserts: - - equal: - path: stringData - value: - key: pair - nginx.conf1: | - alias value1 - listen 80 - - function { - # some json - "key": { - "key2": "value", - "key3": "value2" - } - } - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-some-name - - - it: should pass with multiple secret created with scalar in contents and tpl (2/2) - documentIndex: *otherSecretDoc - set: - k1: value1 - k2: 80 - k3: pair - k4: value2 - k5: 81 - k6: pair2 - secret: - some-name: - enabled: true - content: - key: "{{ .Values.k3 }}" - nginx.conf1: | - alias {{ .Values.k1 }} - listen {{ .Values.k2 }} - - function { - # some json - "key": { - "key2": "value", - "key3": "value2" - } - } - some-other-name: - enabled: true - content: - key: "{{ .Values.k6 }}" - nginx.conf2: | - alias {{ .Values.k4 }} - listen {{ .Values.k5 }} - - function { - # some json - "key": { - "key2": "value", - "key3": "value2" - } - } - asserts: - - equal: - path: stringData - value: - key: pair2 - nginx.conf2: | - alias value2 - listen 81 - - function { - # some json - "key": { - "key2": "value", - "key3": "value2" - } - } - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-some-other-name - - - it: should pass with multiple secret created and labels and global labels added from tpl (1/2) - documentIndex: *secretDoc - set: - l1: lab1 - l2: lab2 - l5: lab5 - l6: lab6 - global: - labels: - gl1: glab1 - gl2: glab2 - secret: - some-name: - enabled: true - labels: - label1: "{{ .Values.l1 }}" - label2: "{{ .Values.l2 }}" - label3: lab3 - label4: lab4 - content: - key1: value1 - key2: value2 - some-other-name: - enabled: true - labels: - label5: "{{ .Values.l5 }}" - label6: "{{ .Values.l6 }}" - label7: lab7 - label8: lab8 - content: - key1: value1 - key2: value2 - asserts: - - hasDocuments: - count: 5 - - isKind: - of: Secret - - equal: - path: type - value: Opaque - - isNull: - path: metadata.annotations - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-some-name - - equal: - path: metadata.labels - value: - app: common-test - app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: common-test - app.kubernetes.io/version: *appVer - helm-revision: "0" - helm.sh/chart: common-test-1.0.0 - release: RELEASE-NAME - label1: lab1 - label2: lab2 - label3: lab3 - label4: lab4 - gl1: glab1 - gl2: glab2 - - - it: should pass with multiple secret created and labels and global labels added from tpl (2/2) - documentIndex: *otherSecretDoc - set: - l1: lab1 - l2: lab2 - l5: lab5 - l6: lab6 - global: - labels: - gl1: glab1 - gl2: glab2 - secret: - some-name: - enabled: true - labels: - label1: "{{ .Values.l1 }}" - label2: "{{ .Values.l2 }}" - label3: lab3 - label4: lab4 - content: - key1: value1 - key2: value2 - some-other-name: - enabled: true - labels: - label5: "{{ .Values.l5 }}" - label6: "{{ .Values.l6 }}" - label7: lab7 - label8: lab8 - content: - key1: value1 - key2: value2 - asserts: - - hasDocuments: - count: 5 - - isKind: - of: Secret - - equal: - path: type - value: Opaque - - isNull: - path: metadata.annotations - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-some-other-name - - equal: - path: metadata.labels - value: - app: common-test - app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: common-test - app.kubernetes.io/version: *appVer - helm-revision: "0" - helm.sh/chart: common-test-1.0.0 - release: RELEASE-NAME - label5: lab5 - label6: lab6 - label7: lab7 - label8: lab8 - gl1: glab1 - gl2: glab2 - - - it: should pass with multiple secret created and annotations and global annotations added from tpl (1/2) - documentIndex: *secretDoc - set: - a1: anno1 - a2: anno2 - a5: anno5 - a6: anno6 - global: - annotations: - ga1: ganno1 - ga2: ganno2 - secret: - some-name: - enabled: true - annotations: - annotation1: "{{ .Values.a1 }}" - annotation2: "{{ .Values.a2 }}" - annotation3: anno3 - annotation4: anno4 - content: - key1: value1 - key2: value2 - some-other-name: - enabled: true - annotations: - annotation5: "{{ .Values.a5 }}" - annotation6: "{{ .Values.a6 }}" - annotation7: anno7 - annotation8: anno8 - content: - key1: value1 - key2: value2 - asserts: - - hasDocuments: - count: 5 - - isKind: - of: Secret - - equal: - path: type - value: Opaque - - equal: - path: metadata.annotations - value: - annotation1: anno1 - annotation2: anno2 - annotation3: anno3 - annotation4: anno4 - ga1: ganno1 - ga2: ganno2 - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-some-name - - equal: - path: metadata.labels - value: - app: common-test - app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: common-test - app.kubernetes.io/version: *appVer - helm-revision: "0" - helm.sh/chart: common-test-1.0.0 - release: RELEASE-NAME - - - it: should pass with multiple secret created and annotations and global annotations added from tpl (2/2) - documentIndex: *otherSecretDoc - set: - a1: anno1 - a2: anno2 - a5: anno5 - a6: anno6 - global: - annotations: - ga1: ganno1 - ga2: ganno2 - secret: - some-name: - enabled: true - annotations: - annotation1: "{{ .Values.a1 }}" - annotation2: "{{ .Values.a2 }}" - annotation3: anno3 - annotation4: anno4 - content: - key1: value1 - key2: value2 - some-other-name: - enabled: true - annotations: - annotation5: "{{ .Values.a5 }}" - annotation6: "{{ .Values.a6 }}" - annotation7: anno7 - annotation8: anno8 - content: - key1: value1 - key2: value2 - asserts: - - hasDocuments: - count: 5 - - isKind: - of: Secret - - equal: - path: type - value: Opaque - - equal: - path: metadata.annotations - value: - annotation5: anno5 - annotation6: anno6 - annotation7: anno7 - annotation8: anno8 - ga1: ganno1 - ga2: ganno2 - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-some-other-name - - equal: - path: metadata.labels - value: - app: common-test - app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: common-test - app.kubernetes.io/version: *appVer - helm-revision: "0" - helm.sh/chart: common-test-1.0.0 - release: RELEASE-NAME - - - it: should pass with 1 secret created with custom type set - documentIndex: &secretDoc 0 - set: - secret: - some-name: - enabled: true - secretType: myCustomType - content: - key1: false - key2: value2 - asserts: - - hasDocuments: - count: 4 - - isKind: - of: Secret - - isAPIVersion: - of: v1 - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-some-name - - equal: - path: type - value: myCustomType - - equal: - path: stringData - value: - key1: "false" - key2: value2 - - isNull: - path: metadata.annotations - - equal: - path: metadata.labels - value: - app: common-test - app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: common-test - app.kubernetes.io/version: *appVer - helm-revision: "0" - helm.sh/chart: common-test-1.0.0 - release: RELEASE-NAME diff --git a/.to_be_deleted/common-test/tests/service/service_test.yaml b/.to_be_deleted/common-test/tests/service/service_test.yaml deleted file mode 100644 index 8986e6f4d4..0000000000 --- a/.to_be_deleted/common-test/tests/service/service_test.yaml +++ /dev/null @@ -1,401 +0,0 @@ -suite: service test -templates: - - common.yaml -chart: - appVersion: &appVer v1.2.3 -tests: - - it: should pass with default values - documentIndex: &deploymentDoc 0 - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Deployment - - - it: should fail with multiple services, without any set as primary - set: - service: - main: - enabled: true - primary: false - ports: - main: - enabled: true - port: 65535 - main2: - enabled: true - primary: false - ports: - main2: - enabled: true - port: 65534 - asserts: - - failedTemplate: - errorMessage: At least one Service must be set as primary - - - it: should fail without externalName on ExternalName service - set: - service: - main: - type: ExternalName - externalName: "" - asserts: - - failedTemplate: - errorMessage: is required when service type is set to ExternalName - - - it: should fail with invalid externalTrafficPolicy - set: - service: - main: - type: LoadBalancer - externalTrafficPolicy: invalid_traffic_policy - asserts: - - failedTemplate: - errorMessage: Invalid option (invalid_traffic_policy) for . Valid options are Cluster and Local - - - it: should fail with invalid sessionAffinity - set: - service: - main: - sessionAffinity: invalid_affinity - asserts: - - failedTemplate: - errorMessage: Invalid option (invalid_affinity) for . Valid options are ClientIP and None - - - it: should fail with invalid timeoutSeconds in sessionAffinityConfig negative - set: - service: - main: - sessionAffinity: ClientIP - sessionAffinityConfig: - clientIP: - timeoutSeconds: -1 - asserts: - - failedTemplate: - errorMessage: Invalid value (-1) for . Valid values must be with 0 and 86400 - - - it: should fail with invalid timeoutSeconds in sessionAffinityConfig too high - set: - service: - main: - sessionAffinity: ClientIP - sessionAffinityConfig: - clientIP: - timeoutSeconds: 86401 - asserts: - - failedTemplate: - errorMessage: Invalid value (86401) for . Valid values must be with 0 and 86400 - - - it: should fail with invalid ipFamilyPolicy - set: - service: - main: - ipFamilyPolicy: invalid_fam_policy - asserts: - - failedTemplate: - errorMessage: Invalid option (invalid_fam_policy) for . Valid options are SingleStack, PreferDualStack, RequireDualStack - - - it: should fail with invalid ipFamily - set: - service: - main: - ipFamilies: - - invalid_family - asserts: - - failedTemplate: - errorMessage: Invalid option (invalid_family) for . Valid options are IPv4 and IPv6 - - - it: should fail with externalIP type but no externalIP defined - set: - service: - main: - type: ExternalIP - externalIP: [] - asserts: - - failedTemplate: - errorMessage: Service type is set to ExternalIP, but no externalIP is defined. - - - it: should pass with correct apiVersion - documentIndex: &serviceDoc 1 - asserts: - - isKind: - of: Service - - isAPIVersion: - of: v1 - - - it: should pass with correct name - documentIndex: *serviceDoc - asserts: - - equal: - path: metadata.name - value: RELEASE-NAME-common-test - - - it: should pass with nameOverride on other service - documentIndex: &otherServiceDoc 2 - set: - service: - other: - enabled: true - nameOverride: something - ports: - other: - enabled: true - port: 80 - asserts: - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-something - - - it: should pass with addAnnotations set to true - documentIndex: *serviceDoc - set: - addAnnotations: - traefik: true - metallb: true - service: - main: - type: LoadBalancer - ports: - main: - protocol: HTTPS - asserts: - - equal: - path: metadata.annotations - value: - traefik.ingress.kubernetes.io/service.serversscheme: https - metallb.universe.tf/allow-shared-ip: RELEASE-NAME-common-test - - - it: should pass with addAnnotations set to false - documentIndex: *serviceDoc - set: - addAnnotations: - traefik: false - metallb: false - service: - main: - type: LoadBalancer - ports: - main: - protocol: HTTPS - asserts: - - isNull: - path: metadata.annotations - - - it: should pass with addAnnotations set to true and annotations - documentIndex: *serviceDoc - set: - addAnnotations: - traefik: true - metallb: true - service: - main: - type: LoadBalancer - annotations: - some_key: value - some_key1: value1 - ports: - main: - protocol: HTTPS - asserts: - - equal: - path: metadata.annotations - value: - traefik.ingress.kubernetes.io/service.serversscheme: https - metallb.universe.tf/allow-shared-ip: RELEASE-NAME-common-test - some_key: value - some_key1: value1 - - - it: should pass with addAnnotations set to true and global annotations - documentIndex: *serviceDoc - set: - global: - annotations: - some_key: value - some_key1: value1 - addAnnotations: - traefik: true - metallb: true - service: - main: - type: LoadBalancer - ports: - main: - protocol: HTTPS - asserts: - - equal: - path: metadata.annotations - value: - traefik.ingress.kubernetes.io/service.serversscheme: https - metallb.universe.tf/allow-shared-ip: RELEASE-NAME-common-test - some_key: value - some_key1: value1 - - - it: should pass with addAnnotations set to true and overridden metalLBSharedKey - documentIndex: *serviceDoc - set: - addAnnotations: - traefik: true - metallb: true - service: - main: - type: LoadBalancer - metalLBSharedKey: custom-shared-key - ports: - main: - protocol: HTTPS - asserts: - - equal: - path: metadata.annotations - value: - traefik.ingress.kubernetes.io/service.serversscheme: https - metallb.universe.tf/allow-shared-ip: custom-shared-key - - - it: should pass with labels - documentIndex: *serviceDoc - set: - service: - main: - labels: - some_key: value - some_key1: value1 - asserts: - - equal: - path: metadata.labels - value: - app: common-test - app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: common-test - app.kubernetes.io/version: *appVer - helm-revision: "0" - helm.sh/chart: common-test-1.0.0 - release: RELEASE-NAME - some_key: value - some_key1: value1 - - - it: should pass with labels and global labels - documentIndex: *serviceDoc - set: - global: - labels: - some_key2: value2 - some_key3: value3 - service: - main: - labels: - some_key: value - some_key1: value1 - asserts: - - equal: - path: metadata.labels - value: - app: common-test - app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: common-test - app.kubernetes.io/version: *appVer - helm-revision: "0" - helm.sh/chart: common-test-1.0.0 - release: RELEASE-NAME - some_key: value - some_key1: value1 - some_key2: value2 - some_key3: value3 - - - it: should pass with labels (Endpoints) - documentIndex: &endpointsDoc 2 - set: - service: - main: - type: ExternalIP - externalIP: 10.10.10.100 - labels: - some_key: value - some_key1: value1 - asserts: - - isKind: - of: Endpoints - - isAPIVersion: - of: v1 - - equal: - path: metadata.labels - value: - app: common-test - app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: common-test - app.kubernetes.io/version: *appVer - helm-revision: "0" - helm.sh/chart: common-test-1.0.0 - release: RELEASE-NAME - some_key: value - some_key1: value1 - - - it: should pass with labels and global labels (Endpoints) - documentIndex: *endpointsDoc - set: - global: - labels: - some_key2: value2 - some_key3: value3 - service: - main: - type: ExternalIP - externalIP: 10.10.10.100 - labels: - some_key: value - some_key1: value1 - asserts: - - equal: - path: metadata.labels - value: - app: common-test - app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: common-test - app.kubernetes.io/version: *appVer - helm-revision: "0" - helm.sh/chart: common-test-1.0.0 - release: RELEASE-NAME - some_key: value - some_key1: value1 - some_key2: value2 - some_key3: value3 - - - it: should pass with annotations (Endpoints) - documentIndex: *endpointsDoc - set: - addAnnotations: - traefik: true - metallb: true - service: - main: - type: ExternalIP - externalIP: 10.10.10.100 - annotations: - some_key: value - some_key1: value1 - asserts: - - equal: - path: metadata.annotations - value: - some_key: value - some_key1: value1 - - - it: should pass with global annotations (Endpoints) - documentIndex: *endpointsDoc - set: - global: - annotations: - some_key: value - some_key1: value1 - service: - main: - type: ExternalIP - externalIP: 10.10.10.100 - asserts: - - equal: - path: metadata.annotations - value: - some_key: value - some_key1: value1 diff --git a/.to_be_deleted/common-test/tests/service/service_test_ClusterIP.yaml b/.to_be_deleted/common-test/tests/service/service_test_ClusterIP.yaml deleted file mode 100644 index 1994f833b8..0000000000 --- a/.to_be_deleted/common-test/tests/service/service_test_ClusterIP.yaml +++ /dev/null @@ -1,294 +0,0 @@ - -suite: service test clusterIP -templates: - - common.yaml -chart: - appVersion: &appVer v1.2.3 -tests: - - it: should pass with default values - documentIndex: &deploymentDoc 0 - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Deployment - - - it: should pass with correct apiVersion - documentIndex: &serviceDoc 1 - asserts: - - isKind: - of: Service - - isAPIVersion: - of: v1 - - - it: should pass with ClusterIP service type - documentIndex: *serviceDoc - set: - service: - main: - type: ClusterIP - asserts: - - equal: - path: spec - value: - type: ClusterIP - ports: &defaultPort - - name: main - port: 65535 - protocol: TCP - targetPort: main - publishNotReadyAddresses: false - selector: &defaultSelector - app: common-test - app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/name: common-test - release: RELEASE-NAME - - - it: should pass with ClusterIP service type and clusterIP set - documentIndex: *serviceDoc - set: - service: - main: - type: ClusterIP - clusterIP: 172.16.0.12 - asserts: - - equal: - path: spec - value: - type: ClusterIP - clusterIP: 172.16.0.12 - publishNotReadyAddresses: false - ports: *defaultPort - selector: *defaultSelector - - - it: should pass with ClusterIP service type and externalTrafficPolicy - documentIndex: *serviceDoc - set: - service: - main: - type: ClusterIP - externalTrafficPolicy: Cluster - asserts: - - equal: - path: spec - value: - type: ClusterIP - ports: *defaultPort - publishNotReadyAddresses: false - selector: *defaultSelector - - isNull: - path: spec.externalTrafficPolicy - - - it: should pass with ClusterIP service type and sessionAffinity set to None - documentIndex: *serviceDoc - set: - service: - main: - type: ClusterIP - sessionAffinity: None - sessionAffinityConfig: - ClientIP: - timeoutSeconds: 1000 - asserts: - - equal: - path: spec - value: - type: ClusterIP - ports: *defaultPort - publishNotReadyAddresses: false - selector: *defaultSelector - sessionAffinity: None - - isNull: - path: spec.sessionAffinityConfig - - - it: should pass with ClusterIP service type and sessionAffinity set to ClientIP - documentIndex: *serviceDoc - set: - service: - main: - type: ClusterIP - sessionAffinity: ClientIP - sessionAffinityConfig: - clientIP: - timeoutSeconds: 1000 - asserts: - - equal: - path: spec - value: - type: ClusterIP - ports: *defaultPort - publishNotReadyAddresses: false - selector: *defaultSelector - sessionAffinity: ClientIP - sessionAffinityConfig: - clientIP: - timeoutSeconds: 1000 - - - it: should pass with ClusterIP service type and sessionAffinity set to ClientIP from tpl - documentIndex: *serviceDoc - set: - timeout: 1000 - service: - main: - type: ClusterIP - sessionAffinity: ClientIP - sessionAffinityConfig: - clientIP: - timeoutSeconds: 1000 - asserts: - - equal: - path: spec - value: - type: ClusterIP - ports: *defaultPort - publishNotReadyAddresses: false - selector: *defaultSelector - sessionAffinity: ClientIP - sessionAffinityConfig: - clientIP: - timeoutSeconds: 1000 - - - it: should pass with ClusterIP service type and externalIPs - documentIndex: *serviceDoc - set: - service: - main: - type: ClusterIP - externalIPs: - - 192.168.1.20 - - 192.168.1.21 - - 192.168.1.22 - asserts: - - equal: - path: spec - value: - type: ClusterIP - ports: *defaultPort - publishNotReadyAddresses: false - selector: *defaultSelector - externalIPs: - - 192.168.1.20 - - 192.168.1.21 - - 192.168.1.22 - - - it: should pass with ClusterIP service type and externalIPs from tpl - documentIndex: *serviceDoc - set: - ip1: 192.168.1.20 - ip2: 192.168.1.21 - ip3: 192.168.1.22 - service: - main: - type: ClusterIP - externalIPs: - - "{{ .Values.ip1 }}" - - "{{ .Values.ip2 }}" - - "{{ .Values.ip3 }}" - asserts: - - equal: - path: spec - value: - type: ClusterIP - ports: *defaultPort - publishNotReadyAddresses: false - selector: *defaultSelector - externalIPs: - - 192.168.1.20 - - 192.168.1.21 - - 192.168.1.22 - - - it: should pass with ClusterIP service type and publishNotReadyAddresses - documentIndex: *serviceDoc - set: - service: - main: - type: ClusterIP - publishNotReadyAddresses: true - asserts: - - equal: - path: spec - value: - type: ClusterIP - ports: *defaultPort - selector: *defaultSelector - publishNotReadyAddresses: true - - - it: should pass with ClusterIP service type and ipFamilyPolicy - documentIndex: *serviceDoc - set: - service: - main: - type: ClusterIP - ipFamilyPolicy: SingleStack - asserts: - - equal: - path: spec - value: - type: ClusterIP - ports: *defaultPort - publishNotReadyAddresses: false - selector: *defaultSelector - ipFamilyPolicy: SingleStack - - - it: should pass with ClusterIP service type and ipFamilies - documentIndex: *serviceDoc - set: - service: - main: - type: ClusterIP - ipFamilies: - - IPv6 - - IPv4 - asserts: - - equal: - path: spec - value: - type: ClusterIP - ports: *defaultPort - publishNotReadyAddresses: false - selector: *defaultSelector - ipFamilies: - - IPv6 - - IPv4 - - - it: should pass with ClusterIP service type and custom selector - documentIndex: *serviceDoc - set: - service: - main: - type: ClusterIP - selector: - some_key: some_value - some_key1: some_value1 - asserts: - - equal: - path: spec - value: - type: ClusterIP - ports: *defaultPort - publishNotReadyAddresses: false - selector: - some_key: some_value - some_key1: some_value1 - - - it: should pass with ClusterIP service type and custom selector from tpl - documentIndex: *serviceDoc - set: - k1: some_value - k2: some_value1 - service: - main: - type: ClusterIP - selector: - some_key: "{{ .Values.k1 }}" - some_key1: "{{ .Values.k2 }}" - asserts: - - equal: - path: spec - value: - type: ClusterIP - ports: *defaultPort - publishNotReadyAddresses: false - selector: - some_key: some_value - some_key1: some_value1 diff --git a/.to_be_deleted/common-test/tests/service/service_test_ExternalIP.yaml b/.to_be_deleted/common-test/tests/service/service_test_ExternalIP.yaml deleted file mode 100644 index 27d71203e2..0000000000 --- a/.to_be_deleted/common-test/tests/service/service_test_ExternalIP.yaml +++ /dev/null @@ -1,269 +0,0 @@ -suite: service test ExternalIP -templates: - - common.yaml -chart: - appVersion: &appVer v1.2.3 -tests: - - it: should pass with default values - documentIndex: &deploymentDoc 0 - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Deployment - - - it: should pass with correct apiVersion - documentIndex: &serviceDoc 1 - asserts: - - isKind: - of: Service - - isAPIVersion: - of: v1 - - - it: should pass with ExternalIP service type - documentIndex: *serviceDoc - set: - service: - main: - type: ExternalIP - externalIP: 10.10.10.100 - asserts: - - equal: - path: spec - value: - publishNotReadyAddresses: false - ports: &defaultPort - - name: main - port: 65535 - protocol: TCP - targetPort: main - - isNull: - path: spec.selector - - isNull: - path: spec.type - - - it: should pass with ExternalIP service type (Endpoint) - documentIndex: &endpointDoc 2 - set: - service: - main: - type: ExternalIP - externalIP: 10.10.10.100 - asserts: - - isKind: - of: Endpoints - - isAPIVersion: - of: v1 - - equal: - path: metadata.name - value: RELEASE-NAME-common-test - - equal: - path: subsets[0] - value: - addresses: - - 10.10.10.100 - ports: - - port: 65535 - name: main - - - it: should pass with ExternalIP service type with multiple ports (Endpoint) - documentIndex: &endpointDoc 2 - set: - service: - main: - type: ExternalIP - externalIP: 10.10.10.100 - ports: - main: - enabled: true - port: 65535 - main2: - enabled: true - port: 65534 - asserts: - - isKind: - of: Endpoints - - isAPIVersion: - of: v1 - - equal: - path: subsets[0] - value: - addresses: - - 10.10.10.100 - ports: - - port: 65535 - name: main - - port: 65534 - name: main2 - - - it: should pass with ExternalIP service type and externalTrafficPolicy - documentIndex: *serviceDoc - set: - service: - main: - type: ExternalIP - externalIP: 10.10.10.100 - externalTrafficPolicy: Cluster - asserts: - - equal: - path: spec - value: - publishNotReadyAddresses: false - ports: *defaultPort - externalTrafficPolicy: Cluster - - isNull: - path: spec.selector - - isNull: - path: spec.type - - - it: should pass with ExternalIP service type and sessionAffinity set to None - documentIndex: *serviceDoc - set: - service: - main: - type: ExternalIP - externalIP: 10.10.10.100 - sessionAffinity: None - sessionAffinityConfig: - ClientIP: - timeoutSeconds: 1000 - asserts: - - equal: - path: spec - value: - publishNotReadyAddresses: false - ports: *defaultPort - sessionAffinity: None - - isNull: - path: spec.sessionAffinityConfig - - isNull: - path: spec.selector - - isNull: - path: spec.type - - - it: should pass with ExternalIP service type and sessionAffinity set to ClientIP - documentIndex: *serviceDoc - set: - service: - main: - type: ExternalIP - externalIP: 10.10.10.100 - sessionAffinity: ClientIP - sessionAffinityConfig: - clientIP: - timeoutSeconds: 1000 - asserts: - - equal: - path: spec - value: - publishNotReadyAddresses: false - ports: *defaultPort - sessionAffinity: ClientIP - sessionAffinityConfig: - clientIP: - timeoutSeconds: 1000 - - isNull: - path: spec.selector - - isNull: - path: spec.type - - - it: should pass with ExternalIP service type and sessionAffinity set to ClientIP from tpl - documentIndex: *serviceDoc - set: - timeout: 1000 - service: - main: - type: ExternalIP - externalIP: 10.10.10.100 - sessionAffinity: ClientIP - sessionAffinityConfig: - clientIP: - timeoutSeconds: 1000 - asserts: - - equal: - path: spec - value: - publishNotReadyAddresses: false - ports: *defaultPort - sessionAffinity: ClientIP - sessionAffinityConfig: - clientIP: - timeoutSeconds: 1000 - - isNull: - path: spec.selector - - isNull: - path: spec.type - - - it: should pass with ExternalIP service type and externalIPs - documentIndex: *serviceDoc - set: - service: - main: - type: ExternalIP - externalIP: 10.10.10.100 - externalIPs: - - 192.168.1.20 - - 192.168.1.21 - - 192.168.1.22 - asserts: - - equal: - path: spec - value: - publishNotReadyAddresses: false - ports: *defaultPort - externalIPs: - - 192.168.1.20 - - 192.168.1.21 - - 192.168.1.22 - - isNull: - path: spec.selector - - isNull: - path: spec.type - - - it: should pass with ExternalIP service type and externalIPs from tpl - documentIndex: *serviceDoc - set: - ip1: 192.168.1.20 - ip2: 192.168.1.21 - ip3: 192.168.1.22 - service: - main: - type: ExternalIP - externalIP: 10.10.10.100 - externalIPs: - - "{{ .Values.ip1 }}" - - "{{ .Values.ip2 }}" - - "{{ .Values.ip3 }}" - asserts: - - equal: - path: spec - value: - publishNotReadyAddresses: false - ports: *defaultPort - externalIPs: - - 192.168.1.20 - - 192.168.1.21 - - 192.168.1.22 - - isNull: - path: spec.selector - - isNull: - path: spec.type - - - it: should pass with ExternalIP service type and publishNotReadyAddresses - documentIndex: *serviceDoc - set: - service: - main: - type: ExternalIP - externalIP: 10.10.10.100 - publishNotReadyAddresses: true - asserts: - - equal: - path: spec - value: - ports: *defaultPort - publishNotReadyAddresses: true - - isNull: - path: spec.selector - - isNull: - path: spec.type diff --git a/.to_be_deleted/common-test/tests/service/service_test_ExternalName.yaml b/.to_be_deleted/common-test/tests/service/service_test_ExternalName.yaml deleted file mode 100644 index 245810151e..0000000000 --- a/.to_be_deleted/common-test/tests/service/service_test_ExternalName.yaml +++ /dev/null @@ -1,247 +0,0 @@ -suite: service test ExternalName -templates: - - common.yaml -chart: - appVersion: &appVer v1.2.3 -tests: - - it: should pass with default values - documentIndex: &deploymentDoc 0 - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Deployment - - - it: should pass with correct apiVersion - documentIndex: &serviceDoc 1 - asserts: - - isKind: - of: Service - - isAPIVersion: - of: v1 - - - it: should pass with ExternalName service type - documentIndex: *serviceDoc - set: - service: - main: - type: ExternalName - externalName: some_hostname - asserts: - - equal: - path: spec - value: - type: ExternalName - externalName: some_hostname - publishNotReadyAddresses: false - ports: &defaultPort - - name: main - port: 65535 - protocol: TCP - targetPort: main - - isNull: - path: spec.selector - - isNull: - path: spec.ipFamilies - - isNull: - path: spec.ipFamilyPolicy - - - it: should pass with ExternalName service type and externalTrafficPolicy - documentIndex: *serviceDoc - set: - service: - main: - type: ExternalName - externalTrafficPolicy: Cluster - externalName: some_hostname - asserts: - - equal: - path: spec - value: - type: ExternalName - externalName: some_hostname - ports: *defaultPort - publishNotReadyAddresses: false - externalTrafficPolicy: Cluster - - isNull: - path: spec.selector - - isNull: - path: spec.ipFamilies - - isNull: - path: spec.ipFamilyPolicy - - - it: should pass with ExternalName service type and sessionAffinity set to None - documentIndex: *serviceDoc - set: - service: - main: - type: ExternalName - externalName: some_hostname - sessionAffinity: None - sessionAffinityConfig: - ClientIP: - timeoutSeconds: 1000 - asserts: - - equal: - path: spec - value: - type: ExternalName - externalName: some_hostname - ports: *defaultPort - publishNotReadyAddresses: false - sessionAffinity: None - - isNull: - path: spec.sessionAffinityConfig - - isNull: - path: spec.selector - - isNull: - path: spec.ipFamilies - - isNull: - path: spec.ipFamilyPolicy - - - it: should pass with ExternalName service type and sessionAffinity set to ClientIP - documentIndex: *serviceDoc - set: - service: - main: - type: ExternalName - externalName: some_hostname - sessionAffinity: ClientIP - sessionAffinityConfig: - clientIP: - timeoutSeconds: 1000 - asserts: - - equal: - path: spec - value: - type: ExternalName - externalName: some_hostname - ports: *defaultPort - publishNotReadyAddresses: false - sessionAffinity: ClientIP - sessionAffinityConfig: - clientIP: - timeoutSeconds: 1000 - - isNull: - path: spec.selector - - isNull: - path: spec.ipFamilies - - isNull: - path: spec.ipFamilyPolicy - - - it: should pass with ExternalName service type and sessionAffinity set to ClientIP from tpl - documentIndex: *serviceDoc - set: - timeout: 1000 - service: - main: - type: ExternalName - externalName: some_hostname - sessionAffinity: ClientIP - sessionAffinityConfig: - clientIP: - timeoutSeconds: 1000 - asserts: - - equal: - path: spec - value: - type: ExternalName - externalName: some_hostname - ports: *defaultPort - publishNotReadyAddresses: false - sessionAffinity: ClientIP - sessionAffinityConfig: - clientIP: - timeoutSeconds: 1000 - - isNull: - path: spec.selector - - isNull: - path: spec.ipFamilies - - isNull: - path: spec.ipFamilyPolicy - - - it: should pass with ExternalName service type and externalIPs - documentIndex: *serviceDoc - set: - service: - main: - type: ExternalName - externalName: some_hostname - externalIPs: - - 192.168.1.20 - - 192.168.1.21 - - 192.168.1.22 - asserts: - - equal: - path: spec - value: - type: ExternalName - externalName: some_hostname - ports: *defaultPort - publishNotReadyAddresses: false - externalIPs: - - 192.168.1.20 - - 192.168.1.21 - - 192.168.1.22 - - isNull: - path: spec.selector - - isNull: - path: spec.ipFamilies - - isNull: - path: spec.ipFamilyPolicy - - - it: should pass with ExternalName service type and externalIPs from tpl - documentIndex: *serviceDoc - set: - ip1: 192.168.1.20 - ip2: 192.168.1.21 - ip3: 192.168.1.22 - service: - main: - type: ExternalName - externalName: some_hostname - externalIPs: - - "{{ .Values.ip1 }}" - - "{{ .Values.ip2 }}" - - "{{ .Values.ip3 }}" - asserts: - - equal: - path: spec - value: - type: ExternalName - externalName: some_hostname - ports: *defaultPort - publishNotReadyAddresses: false - externalIPs: - - 192.168.1.20 - - 192.168.1.21 - - 192.168.1.22 - - isNull: - path: spec.selector - - isNull: - path: spec.ipFamilies - - isNull: - path: spec.ipFamilyPolicy - - - it: should pass with ExternalName service type and publishNotReadyAddresses - documentIndex: *serviceDoc - set: - service: - main: - type: ExternalName - externalName: some_hostname - publishNotReadyAddresses: true - asserts: - - equal: - path: spec - value: - type: ExternalName - externalName: some_hostname - ports: *defaultPort - publishNotReadyAddresses: true - - isNull: - path: spec.selector - - isNull: - path: spec.ipFamilies - - isNull: - path: spec.ipFamilyPolicy diff --git a/.to_be_deleted/common-test/tests/service/service_test_LoadBalancer.yaml b/.to_be_deleted/common-test/tests/service/service_test_LoadBalancer.yaml deleted file mode 100644 index 326a6c1166..0000000000 --- a/.to_be_deleted/common-test/tests/service/service_test_LoadBalancer.yaml +++ /dev/null @@ -1,378 +0,0 @@ -suite: service test LoadBalancer -templates: - - common.yaml -chart: - appVersion: &appVer v1.2.3 -tests: - - it: should pass with default values - documentIndex: &deploymentDoc 0 - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Deployment - - - it: should pass with correct apiVersion - documentIndex: &serviceDoc 1 - asserts: - - isKind: - of: Service - - isAPIVersion: - of: v1 - - - it: should pass with LoadBalancer service type - documentIndex: *serviceDoc - set: - service: - main: - type: LoadBalancer - asserts: - - equal: - path: spec - value: - type: LoadBalancer - ports: &defaultPort - - name: main - port: 65535 - protocol: TCP - targetPort: main - publishNotReadyAddresses: false - selector: &defaultSelector - app: common-test - app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/name: common-test - release: RELEASE-NAME - - - it: should pass with LoadBalancer service type and loadBalancerIP set - documentIndex: *serviceDoc - set: - service: - main: - type: LoadBalancer - loadBalancerIP: 10.16.0.12 - asserts: - - equal: - path: spec - value: - type: LoadBalancer - loadBalancerIP: 10.16.0.12 - ports: *defaultPort - publishNotReadyAddresses: false - selector: *defaultSelector - - - it: should pass with LoadBalancer service type and loadBalancerSourceRanges set - documentIndex: *serviceDoc - set: - service: - main: - type: LoadBalancer - loadBalancerSourceRanges: - - 10.16.0.14 - - 10.16.0.15 - asserts: - - equal: - path: spec - value: - type: LoadBalancer - loadBalancerSourceRanges: - - 10.16.0.14 - - 10.16.0.15 - ports: *defaultPort - publishNotReadyAddresses: false - selector: *defaultSelector - - - it: should pass with LoadBalancer service type and loadBalancerSourceRanges set from tpl - documentIndex: *serviceDoc - set: - ip1: 10.16.0.14 - ip2: 10.16.0.15 - service: - main: - type: LoadBalancer - loadBalancerSourceRanges: - - "{{ .Values.ip1 }}" - - "{{ .Values.ip2 }}" - asserts: - - equal: - path: spec - value: - type: LoadBalancer - loadBalancerSourceRanges: - - 10.16.0.14 - - 10.16.0.15 - ports: *defaultPort - publishNotReadyAddresses: false - selector: *defaultSelector - - - it: should pass with LoadBalancer service type, loadBalancerIP and loadBalancerSourceRanges set from tpl - documentIndex: *serviceDoc - set: - ip1: 10.16.0.14 - ip2: 10.16.0.15 - service: - main: - type: LoadBalancer - loadBalancerIP: 10.16.0.12 - loadBalancerSourceRanges: - - "{{ .Values.ip1 }}" - - "{{ .Values.ip2 }}" - asserts: - - equal: - path: spec - value: - type: LoadBalancer - loadBalancerIP: 10.16.0.12 - loadBalancerSourceRanges: - - 10.16.0.14 - - 10.16.0.15 - ports: *defaultPort - publishNotReadyAddresses: false - selector: *defaultSelector - - - it: should pass with LoadBalancer service type and clusterIP set - documentIndex: *serviceDoc - set: - service: - main: - type: LoadBalancer - clusterIP: 172.16.0.12 - asserts: - - equal: - path: spec - value: - type: LoadBalancer - clusterIP: 172.16.0.12 - ports: *defaultPort - publishNotReadyAddresses: false - selector: *defaultSelector - - - it: should pass with LoadBalancer service type and externalTrafficPolicy - documentIndex: *serviceDoc - set: - service: - main: - type: LoadBalancer - externalTrafficPolicy: Cluster - asserts: - - equal: - path: spec - value: - type: LoadBalancer - ports: *defaultPort - publishNotReadyAddresses: false - selector: *defaultSelector - externalTrafficPolicy: Cluster - - - it: should pass with LoadBalancer service type and sessionAffinity set to None - documentIndex: *serviceDoc - set: - service: - main: - type: LoadBalancer - sessionAffinity: None - sessionAffinityConfig: - ClientIP: - timeoutSeconds: 1000 - asserts: - - equal: - path: spec - value: - type: LoadBalancer - ports: *defaultPort - publishNotReadyAddresses: false - selector: *defaultSelector - sessionAffinity: None - - isNull: - path: spec.sessionAffinityConfig - - - it: should pass with LoadBalancer service type and sessionAffinity set to ClientIP - documentIndex: *serviceDoc - set: - service: - main: - type: LoadBalancer - sessionAffinity: ClientIP - sessionAffinityConfig: - clientIP: - timeoutSeconds: 1000 - asserts: - - equal: - path: spec - value: - type: LoadBalancer - ports: *defaultPort - publishNotReadyAddresses: false - selector: *defaultSelector - sessionAffinity: ClientIP - sessionAffinityConfig: - clientIP: - timeoutSeconds: 1000 - - - it: should pass with LoadBalancer service type and sessionAffinity set to ClientIP from tpl - documentIndex: *serviceDoc - set: - timeout: 1000 - service: - main: - type: LoadBalancer - sessionAffinity: ClientIP - sessionAffinityConfig: - clientIP: - timeoutSeconds: 1000 - asserts: - - equal: - path: spec - value: - type: LoadBalancer - ports: *defaultPort - publishNotReadyAddresses: false - selector: *defaultSelector - sessionAffinity: ClientIP - sessionAffinityConfig: - clientIP: - timeoutSeconds: 1000 - - - it: should pass with LoadBalancer service type and externalIPs - documentIndex: *serviceDoc - set: - service: - main: - type: LoadBalancer - externalIPs: - - 192.168.1.20 - - 192.168.1.21 - - 192.168.1.22 - asserts: - - equal: - path: spec - value: - type: LoadBalancer - ports: *defaultPort - publishNotReadyAddresses: false - selector: *defaultSelector - externalIPs: - - 192.168.1.20 - - 192.168.1.21 - - 192.168.1.22 - - - it: should pass with LoadBalancer service type and externalIPs from tpl - documentIndex: *serviceDoc - set: - ip1: 192.168.1.20 - ip2: 192.168.1.21 - ip3: 192.168.1.22 - service: - main: - type: LoadBalancer - externalIPs: - - "{{ .Values.ip1 }}" - - "{{ .Values.ip2 }}" - - "{{ .Values.ip3 }}" - asserts: - - equal: - path: spec - value: - type: LoadBalancer - ports: *defaultPort - publishNotReadyAddresses: false - selector: *defaultSelector - externalIPs: - - 192.168.1.20 - - 192.168.1.21 - - 192.168.1.22 - - - it: should pass with LoadBalancer service type and publishNotReadyAddresses - documentIndex: *serviceDoc - set: - service: - main: - type: LoadBalancer - publishNotReadyAddresses: true - asserts: - - equal: - path: spec - value: - type: LoadBalancer - ports: *defaultPort - selector: *defaultSelector - publishNotReadyAddresses: true - - - it: should pass with LoadBalancer service type and ipFamilyPolicy - documentIndex: *serviceDoc - set: - service: - main: - type: LoadBalancer - ipFamilyPolicy: SingleStack - asserts: - - equal: - path: spec - value: - type: LoadBalancer - ports: *defaultPort - publishNotReadyAddresses: false - selector: *defaultSelector - ipFamilyPolicy: SingleStack - - - it: should pass with LoadBalancer service type and ipFamilies - documentIndex: *serviceDoc - set: - service: - main: - type: LoadBalancer - ipFamilies: - - IPv6 - - IPv4 - asserts: - - equal: - path: spec - value: - type: LoadBalancer - ports: *defaultPort - publishNotReadyAddresses: false - selector: *defaultSelector - ipFamilies: - - IPv6 - - IPv4 - - - it: should pass with LoadBalancer service type and custom selector - documentIndex: *serviceDoc - set: - service: - main: - type: LoadBalancer - selector: - some_key: some_value - some_key1: some_value1 - asserts: - - equal: - path: spec - value: - type: LoadBalancer - ports: *defaultPort - publishNotReadyAddresses: false - selector: - some_key: some_value - some_key1: some_value1 - - - it: should pass with LoadBalancer service type and custom selector from tpl - documentIndex: *serviceDoc - set: - k1: some_value - k2: some_value1 - service: - main: - type: LoadBalancer - selector: - some_key: "{{ .Values.k1 }}" - some_key1: "{{ .Values.k2 }}" - asserts: - - equal: - path: spec - value: - type: LoadBalancer - ports: *defaultPort - publishNotReadyAddresses: false - selector: - some_key: some_value - some_key1: some_value1 diff --git a/.to_be_deleted/common-test/tests/service/service_test_NodePort.yaml b/.to_be_deleted/common-test/tests/service/service_test_NodePort.yaml deleted file mode 100644 index 5d4ff76a0e..0000000000 --- a/.to_be_deleted/common-test/tests/service/service_test_NodePort.yaml +++ /dev/null @@ -1,344 +0,0 @@ -suite: service test NodePort -templates: - - common.yaml -chart: - appVersion: &appVer v1.2.3 -tests: - - it: should pass with default values - documentIndex: &deploymentDoc 0 - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Deployment - - - it: should fail with nodePort less than the minimum allowed - set: - service: - main: - type: NodePort - ports: - main: - nodePort: 8999 - asserts: - - failedTemplate: - errorMessage: Port number (8999) for (main) is too low. The minimum port for Node Port is (9000) - - - it: should pass with correct apiVersion - documentIndex: &serviceDoc 1 - asserts: - - isKind: - of: Service - - isAPIVersion: - of: v1 - - - it: should pass with NodePort service type - documentIndex: *serviceDoc - set: - service: - main: - type: NodePort - ports: - main: - nodePort: 35000 - asserts: - - equal: - path: spec - value: - type: NodePort - ports: &defaultPort - - name: main - port: 65535 - protocol: TCP - targetPort: main - nodePort: 35000 - publishNotReadyAddresses: false - selector: &defaultSelector - app: common-test - app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/name: common-test - release: RELEASE-NAME - - - it: should pass with NodePort service type and clusterIP set - documentIndex: *serviceDoc - set: - service: - main: - type: NodePort - ports: - main: - nodePort: 35000 - clusterIP: 172.16.0.12 - asserts: - - equal: - path: spec - value: - type: NodePort - clusterIP: 172.16.0.12 - ports: *defaultPort - publishNotReadyAddresses: false - selector: *defaultSelector - - - it: should pass with NodePort service type and externalTrafficPolicy - documentIndex: *serviceDoc - set: - service: - main: - type: NodePort - externalTrafficPolicy: Cluster - ports: - main: - nodePort: 35000 - asserts: - - equal: - path: spec - value: - type: NodePort - ports: *defaultPort - publishNotReadyAddresses: false - selector: *defaultSelector - externalTrafficPolicy: Cluster - - - it: should pass with NodePort service type and sessionAffinity set to None - documentIndex: *serviceDoc - set: - service: - main: - type: NodePort - ports: - main: - nodePort: 35000 - sessionAffinity: None - sessionAffinityConfig: - ClientIP: - timeoutSeconds: 1000 - asserts: - - equal: - path: spec - value: - type: NodePort - ports: *defaultPort - publishNotReadyAddresses: false - selector: *defaultSelector - sessionAffinity: None - - isNull: - path: spec.sessionAffinityConfig - - - it: should pass with NodePort service type and sessionAffinity set to ClientIP - documentIndex: *serviceDoc - set: - service: - main: - type: NodePort - ports: - main: - nodePort: 35000 - sessionAffinity: ClientIP - sessionAffinityConfig: - clientIP: - timeoutSeconds: 1000 - asserts: - - equal: - path: spec - value: - type: NodePort - ports: *defaultPort - publishNotReadyAddresses: false - selector: *defaultSelector - sessionAffinity: ClientIP - sessionAffinityConfig: - clientIP: - timeoutSeconds: 1000 - - - it: should pass with NodePort service type and sessionAffinity set to ClientIP from tpl - documentIndex: *serviceDoc - set: - timeout: 1000 - service: - main: - type: NodePort - ports: - main: - nodePort: 35000 - sessionAffinity: ClientIP - sessionAffinityConfig: - clientIP: - timeoutSeconds: 1000 - asserts: - - equal: - path: spec - value: - type: NodePort - ports: *defaultPort - publishNotReadyAddresses: false - selector: *defaultSelector - sessionAffinity: ClientIP - sessionAffinityConfig: - clientIP: - timeoutSeconds: 1000 - - - it: should pass with NodePort service type and externalIPs - documentIndex: *serviceDoc - set: - service: - main: - type: NodePort - ports: - main: - nodePort: 35000 - externalIPs: - - 192.168.1.20 - - 192.168.1.21 - - 192.168.1.22 - asserts: - - equal: - path: spec - value: - type: NodePort - ports: *defaultPort - publishNotReadyAddresses: false - selector: *defaultSelector - externalIPs: - - 192.168.1.20 - - 192.168.1.21 - - 192.168.1.22 - - - it: should pass with NodePort service type and externalIPs from tpl - documentIndex: *serviceDoc - set: - ip1: 192.168.1.20 - ip2: 192.168.1.21 - ip3: 192.168.1.22 - service: - main: - type: NodePort - ports: - main: - nodePort: 35000 - externalIPs: - - "{{ .Values.ip1 }}" - - "{{ .Values.ip2 }}" - - "{{ .Values.ip3 }}" - asserts: - - equal: - path: spec - value: - type: NodePort - ports: *defaultPort - publishNotReadyAddresses: false - selector: *defaultSelector - externalIPs: - - 192.168.1.20 - - 192.168.1.21 - - 192.168.1.22 - - - it: should pass with NodePort service type and publishNotReadyAddresses - documentIndex: *serviceDoc - set: - service: - main: - type: NodePort - ports: - main: - nodePort: 35000 - publishNotReadyAddresses: true - asserts: - - equal: - path: spec - value: - type: NodePort - ports: *defaultPort - selector: *defaultSelector - publishNotReadyAddresses: true - - - it: should pass with NodePort service type and ipFamilyPolicy - documentIndex: *serviceDoc - set: - service: - main: - type: NodePort - ports: - main: - nodePort: 35000 - ipFamilyPolicy: SingleStack - asserts: - - equal: - path: spec - value: - type: NodePort - ports: *defaultPort - publishNotReadyAddresses: false - selector: *defaultSelector - ipFamilyPolicy: SingleStack - - - it: should pass with NodePort service type and ipFamilies - documentIndex: *serviceDoc - set: - service: - main: - type: NodePort - ports: - main: - nodePort: 35000 - ipFamilies: - - IPv6 - - IPv4 - asserts: - - equal: - path: spec - value: - type: NodePort - ports: *defaultPort - publishNotReadyAddresses: false - selector: *defaultSelector - ipFamilies: - - IPv6 - - IPv4 - - - it: should pass with NodePort service type and custom selector - documentIndex: *serviceDoc - set: - service: - main: - type: NodePort - ports: - main: - nodePort: 35000 - selector: - some_key: some_value - some_key1: some_value1 - asserts: - - equal: - path: spec - value: - type: NodePort - ports: *defaultPort - publishNotReadyAddresses: false - selector: - some_key: some_value - some_key1: some_value1 - - - it: should pass with NodePort service type and custom selector from tpl - documentIndex: *serviceDoc - set: - k1: some_value - k2: some_value1 - service: - main: - type: NodePort - ports: - main: - nodePort: 35000 - selector: - some_key: "{{ .Values.k1 }}" - some_key1: "{{ .Values.k2 }}" - asserts: - - equal: - path: spec - value: - type: NodePort - ports: *defaultPort - publishNotReadyAddresses: false - selector: - some_key: some_value - some_key1: some_value1 diff --git a/.to_be_deleted/common-test/tests/service/service_test_hostNet.yaml b/.to_be_deleted/common-test/tests/service/service_test_hostNet.yaml deleted file mode 100644 index 489ff85740..0000000000 --- a/.to_be_deleted/common-test/tests/service/service_test_hostNet.yaml +++ /dev/null @@ -1,73 +0,0 @@ - -suite: service test hostNetwork -templates: - - common.yaml -chart: - appVersion: &appVer v1.2.3 -tests: - - it: should pass with default values - documentIndex: &deploymentDoc 0 - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Deployment - - - it: should pass with correct apiVersion - documentIndex: &serviceDoc 1 - asserts: - - isKind: - of: Service - - isAPIVersion: - of: v1 - - - it: should pass with hostNetwork enabled - documentIndex: *serviceDoc - set: - hostNetwork: true - service: - main: - type: LoadBalancer - asserts: - - equal: - path: spec - value: - type: ClusterIP - ports: &defaultPort - - name: main - port: 65535 - protocol: TCP - targetPort: main - publishNotReadyAddresses: false - selector: &defaultSelector - app: common-test - app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/name: common-test - release: RELEASE-NAME - - - it: should pass with hostPort defined, should be forced to ClusterIP - documentIndex: *serviceDoc - set: - service: - main: - type: LoadBalancer - ports: - main: - port: 65535 - hostPort: 12345 - asserts: - - equal: - path: spec - value: - type: ClusterIP - ports: &defaultPort - - name: main - port: 65535 - protocol: TCP - targetPort: main - publishNotReadyAddresses: false - selector: &defaultSelector - app: common-test - app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/name: common-test - release: RELEASE-NAME diff --git a/.to_be_deleted/common-test/tests/serviceAccount/serviceAccount_test.yaml b/.to_be_deleted/common-test/tests/serviceAccount/serviceAccount_test.yaml deleted file mode 100644 index 79c6120293..0000000000 --- a/.to_be_deleted/common-test/tests/serviceAccount/serviceAccount_test.yaml +++ /dev/null @@ -1,164 +0,0 @@ - -suite: service account test -templates: - - common.yaml -chart: - appVersion: &appVer v1.2.3 -tests: - - it: should pass with default values - documentIndex: &deploymentDoc 0 - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Deployment - - - it: should fail with multiple service accounts, without any set as primary - set: - serviceAccount: - main: - enabled: true - primary: false - main2: - enabled: true - primary: false - asserts: - - failedTemplate: - errorMessage: At least one Service Account must be set as primary - - - it: should pass with service account enabled - documentIndex: &serviceAccountDoc 0 - set: - serviceAccount: - main: - enabled: true - asserts: - - isKind: - of: ServiceAccount - - isAPIVersion: - of: v1 - - equal: - path: metadata.name - value: RELEASE-NAME-common-test - - equal: - path: automountServiceAccountToken - value: true - - - it: should pass with service account enabled - documentIndex: *serviceAccountDoc - set: - serviceAccount: - main: - enabled: true - automountServiceAccountToken: false - asserts: - - equal: - path: metadata.name - value: RELEASE-NAME-common-test - - equal: - path: automountServiceAccountToken - value: false - - - it: should pass with primary service account enabled and nameOverride defined - documentIndex: *serviceAccountDoc - set: - serviceAccount: - main: - enabled: true - nameOverride: some-name - asserts: - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-some-name - - - it: should pass with primary service account enabled annotations and labels added - documentIndex: *serviceAccountDoc - set: - serviceAccount: - main: - enabled: true - annotations: - key1: value1 - key2: value2 - labels: - key3: value3 - key4: value4 - asserts: - - equal: - path: metadata.name - value: RELEASE-NAME-common-test - - equal: - path: metadata.annotations - value: - key1: value1 - key2: value2 - - equal: - path: metadata.labels - value: - app: common-test - app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: common-test - app.kubernetes.io/version: *appVer - helm-revision: "0" - helm.sh/chart: common-test-1.0.0 - release: RELEASE-NAME - key3: value3 - key4: value4 - - - it: should pass with primary service account enabled annotations and labels added from tpl - documentIndex: *serviceAccountDoc - set: - k1: value1 - k2: value2 - k3: value3 - k4: value4 - serviceAccount: - main: - enabled: true - annotations: - key1: "{{ .Values.k1 }}" - key2: "{{ .Values.k2 }}" - labels: - key3: "{{ .Values.k3 }}" - key4: "{{ .Values.k4 }}" - asserts: - - equal: - path: metadata.name - value: RELEASE-NAME-common-test - - equal: - path: metadata.labels - value: - app: common-test - app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: common-test - app.kubernetes.io/version: *appVer - helm-revision: "0" - helm.sh/chart: common-test-1.0.0 - release: RELEASE-NAME - key3: value3 - key4: value4 - - equal: - path: metadata.annotations - value: - key1: value1 - key2: value2 - - - it: should pass with non-primary service account enabled and nameOverride defined - documentIndex: &serviceAccountDocExtra 1 - set: - serviceAccount: - main: - enabled: true - primary: true - other: - enabled: true - primary: false - nameOverride: some-name - asserts: - - isKind: - of: ServiceAccount - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-some-name diff --git a/.to_be_deleted/common-test/tests/statefulset/annotations_test.yaml b/.to_be_deleted/common-test/tests/statefulset/annotations_test.yaml deleted file mode 100644 index ff8ef48952..0000000000 --- a/.to_be_deleted/common-test/tests/statefulset/annotations_test.yaml +++ /dev/null @@ -1,60 +0,0 @@ -suite: statefulset annotation test -templates: - - common.yaml -tests: - - it: should pass with default values - documentIndex: &statefulsetDoc 0 - set: - controller.type: StatefulSet - asserts: - - hasDocuments: - count: 3 - - isKind: - of: StatefulSet - - isNull: - path: metadata.annotations - - matchRegex: - path: spec.template.metadata.annotations.rollme - pattern: "^[a-zA-Z0-9]{5}$" - - - it: should pass with controller and global annotations - documentIndex: *statefulsetDoc - set: - controller.type: StatefulSet - some_key: some_value - controller: - annotations: - controller_key: controller_value - controller_key2: "{{ .Values.some_key }}" - global: - annotations: - global_key: global_value - global_key2: "{{ .Values.some_key }}" - asserts: - - equal: - path: metadata.annotations - value: - controller_key: controller_value - controller_key2: some_value - global_key: global_value - global_key2: some_value - - isNull: - path: metadata.annotations.rollme - - matchRegex: - path: spec.template.metadata.annotations.rollme - pattern: "^[a-zA-Z0-9]{5}$" - - - it: should pass with podAnnotations set - documentIndex: *statefulsetDoc - set: - controller.type: StatefulSet - some_key: some_value2 - podAnnotations: - test: some_value - test2: "{{ .Values.some_key }}" - asserts: - - isSubset: - path: spec.template.metadata.annotations - content: - test2: some_value2 - test: some_value diff --git a/.to_be_deleted/common-test/tests/statefulset/controller_test.yaml b/.to_be_deleted/common-test/tests/statefulset/controller_test.yaml deleted file mode 100644 index 4e2ec7e9ba..0000000000 --- a/.to_be_deleted/common-test/tests/statefulset/controller_test.yaml +++ /dev/null @@ -1,74 +0,0 @@ -suite: statefulset strategy test -templates: - - common.yaml -tests: - - it: should pass with strategy changed in StatefulSet - documentIndex: &statefulsetDoc 0 - set: - controller: - type: StatefulSet - strategy: OnDelete - rollingUpdate: - partition: 5 - unavailable: 6 - asserts: - - hasDocuments: - count: 3 - - isKind: - of: StatefulSet - - equal: - path: spec.updateStrategy - value: - type: OnDelete - - isNull: - path: spec.updateStrategy.rollingUpdate - - - it: should pass with strategy changed in StatefulSet - documentIndex: *statefulsetDoc - set: - controller: - type: StatefulSet - strategy: RollingUpdate - rollingUpdate: - partition: 5 - unavailable: 6 - asserts: - - equal: - path: spec.updateStrategy - value: - type: RollingUpdate - rollingUpdate: - partition: 5 - maxUnavailable: 6 - - - it: should fail with wrong strategy - documentIndex: *statefulsetDoc - set: - controller: - type: StatefulSet - strategy: not_valid_strategy - asserts: - - failedTemplate: - errorMessage: Not a valid strategy type for StatefulSet (not_valid_strategy) - - - it: should pass with revisionHistoryLimit changed - documentIndex: *statefulsetDoc - set: - controller: - type: StatefulSet - revisionHistoryLimit: 1 - asserts: - - equal: - path: spec.revisionHistoryLimit - value: 1 - - - it: should pass with replicas changed - documentIndex: *statefulsetDoc - set: - controller: - type: StatefulSet - replicas: 6 - asserts: - - equal: - path: spec.replicas - value: 6 diff --git a/.to_be_deleted/common-test/tests/statefulset/default_test.yaml b/.to_be_deleted/common-test/tests/statefulset/default_test.yaml deleted file mode 100644 index 15226780bb..0000000000 --- a/.to_be_deleted/common-test/tests/statefulset/default_test.yaml +++ /dev/null @@ -1,126 +0,0 @@ -suite: statefulset default test -templates: - - common.yaml -tests: - - it: should pass with controller set to StatefulSet - documentIndex: &statefulsetDoc 0 - set: - controller.type: StatefulSet - asserts: - - hasDocuments: - count: 3 - - isKind: - of: StatefulSet - - isAPIVersion: - of: apps/v1 - - equal: - path: spec.serviceName - value: RELEASE-NAME-common-test - - equal: - path: spec.revisionHistoryLimit - value: 3 - - equal: - path: spec.replicas - value: 1 - - equal: - path: spec.updateStrategy.type - value: RollingUpdate - - equal: - path: spec.template.spec.serviceAccountName - value: default - - equal: - path: spec.template.spec.hostNetwork - value: false - - equal: - path: spec.template.spec.terminationGracePeriodSeconds - value: 10 - - equal: - path: spec.template.spec.enableServiceLinks - value: false - - equal: - path: spec.template.spec.terminationGracePeriodSeconds - value: 10 - - isNull: - path: spec.template.spec.hostname - - equal: - path: spec.template.spec.dnsPolicy - value: ClusterFirst - - isNull: - path: spec.template.spec.dnsConfig - - isNull: - path: spec.template.spec.priorityClassName - - isNull: - path: spec.template.spec.schedulerName - - isNull: - path: spec.template.spec.hostAliases - - isNull: - path: spec.template.spec.nodeSelector - - isNull: - path: spec.template.spec.tolerations - - isNull: - path: spec.template.spec.imagePullSecrets - - isNull: - path: spec.template.spec.runtimeClassName - - equal: - path: spec.template.spec.containers[0].name - value: RELEASE-NAME-common-test - - equal: - path: spec.template.spec.containers[0].image - value: repo:tag - - isNull: - path: spec.template.spec.containers[0].command - - isNull: - path: spec.template.spec.containers[0].args - - equal: - path: spec.template.spec.containers[0].tty - value: false - - equal: - path: spec.template.spec.containers[0].stdin - value: false - - isNull: - path: spec.template.spec.containers[0].lifecycle - - isNull: - path: spec.template.spec.containers[0].terminationMessagePath - - isNull: - path: spec.template.spec.containers[0].terminationMessagePolicy - - equal: - path: spec.template.spec.securityContext - value: - fsGroup: 568 - fsGroupChangePolicy: OnRootMismatch - supplementalGroups: [] - - equal: - path: spec.template.spec.containers[0].securityContext - value: - allowPrivilegeEscalation: false - privileged: false - readOnlyRootFilesystem: true - runAsNonRoot: true - runAsUser: 568 - runAsGroup: 568 - capabilities: - add: [] - drop: - - ALL - - equal: - path: spec.template.spec.containers[0].env - value: - - name: TZ - value: UTC - - name: UMASK - value: "002" - - name: UMASK_SET - value: "002" - - name: NVIDIA_VISIBLE_DEVICES - value: void - - name: S6_READ_ONLY_ROOT - value: "1" - - equal: - path: spec.template.spec.containers[0].volumeMounts - value: - - mountPath: /shared - name: shared - - mountPath: /tmp - name: tmp - - mountPath: /var/logs - name: varlogs diff --git a/.to_be_deleted/common-test/tests/statefulset/generic_test.yaml b/.to_be_deleted/common-test/tests/statefulset/generic_test.yaml deleted file mode 100644 index a539f745fb..0000000000 --- a/.to_be_deleted/common-test/tests/statefulset/generic_test.yaml +++ /dev/null @@ -1,229 +0,0 @@ -suite: statefulset generic test -templates: - - common.yaml -tests: - - it: should pass with controller set to StatefulSet - documentIndex: &statefulsetDoc 0 - set: - controller.type: StatefulSet - asserts: - - hasDocuments: - count: 3 - - isKind: - of: StatefulSet - - isAPIVersion: - of: apps/v1 - - - - it: should pass with podSecurityContext changed - documentIndex: *statefulsetDoc - set: - controller.type: StatefulSet - podSecurityContext: - fsGroup: 0 - fsGroupChangePolicy: Always - supplementalGroups: - - 1000 - asserts: - - equal: - path: spec.template.spec.securityContext - value: - fsGroup: 0 - fsGroupChangePolicy: Always - supplementalGroups: - - 1000 - - - - it: should pass with podSecurityContext changed - documentIndex: *statefulsetDoc - set: - controller.type: StatefulSet - securityContext: - runAsUser: 1000 - runAsGroup: 1000 - capabilities: - add: - - something - asserts: - - equal: - path: spec.template.spec.containers[0].securityContext - value: - allowPrivilegeEscalation: false - privileged: false - readOnlyRootFilesystem: true - runAsNonRoot: true - runAsUser: 1000 - runAsGroup: 1000 - capabilities: - add: - - something - drop: - - ALL - - - it: should pass with multiple envs defined via tpl - documentIndex: *statefulsetDoc - set: - controller.type: StatefulSet - some_string: a_string - some_int: 123 - some_bool: false - env: - ENVVAR: "{{ .Values.some_string }}" - ENVVAR2: "{{ .Values.some_int }}" - ENVVAR3: "{{ .Values.some_bool }}" - asserts: - - equal: - path: spec.template.spec.containers[0].env - value: - - name: TZ - value: "UTC" - - name: UMASK - value: "002" - - name: UMASK_SET - value: "002" - - name: NVIDIA_VISIBLE_DEVICES - value: "void" - - name: S6_READ_ONLY_ROOT - value: "1" - - name: ENVVAR - value: "a_string" - - name: ENVVAR2 - value: "123" - - name: ENVVAR3 - value: "false" - - - it: should pass with image defined in init containers - documentIndex: *statefulsetDoc - set: - controller.type: StatefulSet - image: - repository: some-repo - tag: some-tag - pullPolicy: Always - someImage: - repository: some-other-repo - tag: some-other-tag - pullPolicy: Never - additionalContainers: - some-name: - imageSelector: someImage - pullPolicy: Never - initContainers: - some-name: - imageSelector: someImage - pullPolicy: Never - systemContainers: - some-name: - imageSelector: someImage - pullPolicy: Never - installContainers: - some-name: - imageSelector: someImage - pullPolicy: Never - asserts: - - isSubset: - path: spec.template.spec.containers[0] - content: - image: some-repo:some-tag - imagePullPolicy: Always - - lengthEqual: - path: spec.template.spec.containers - count: 2 - - lengthEqual: - path: spec.template.spec.initContainers - count: 3 - - - it: should pass with added persistence - documentIndex: *statefulsetDoc - set: - controller.type: StatefulSet - persistence: - volume0: - type: pvc - enabled: true - mountPath: /pvc/path - volume1: - enabled: true - type: nfs - server: some.server.local - path: /nfs/path - mountPath: /nfs - volume2: - enabled: true - type: ixVolume - datasetName: ix-app - mountPath: /ixVol - volume3: - enabled: true - type: hostPath - hostPath: /mnt/pool/test - mountPath: /some/path - volume4: - enabled: true - type: emptyDir - medium: Memory - sizeLimit: 1Gi - mountPath: /temp-path - volume5: - type: secret - enabled: true - objectName: some_object_name - defaultMode: "0777" - mountPath: /secret-path - volume6: - type: configMap - enabled: true - objectName: some_object_name - defaultMode: "0777" - mountPath: /configmap-path - ixVolumes: - - /mnt/pool/ix-applications/ix-app - asserts: - - hasDocuments: - count: 4 - - contains: - path: spec.template.spec.volumes - content: - name: volume0 - persistentVolumeClaim: - claimName: RELEASE-NAME-common-test-volume0 - - contains: - path: spec.template.spec.volumes - content: - name: volume1 - nfs: - path: /nfs/path - server: some.server.local - - contains: - path: spec.template.spec.volumes - content: - name: volume2 - hostPath: - path: /mnt/pool/ix-applications/ix-app - - contains: - path: spec.template.spec.volumes - content: - name: volume3 - hostPath: - path: /mnt/pool/test - - contains: - path: spec.template.spec.volumes - content: - name: volume4 - emptyDir: - medium: Memory - sizeLimit: 1Gi - - contains: - path: spec.template.spec.volumes - content: - name: volume5 - secret: - defaultMode: 511 - secretName: some_object_name - - contains: - path: spec.template.spec.volumes - content: - name: volume6 - configMap: - defaultMode: 511 - name: some_object_name diff --git a/.to_be_deleted/common-test/tests/statefulset/label_test.yaml b/.to_be_deleted/common-test/tests/statefulset/label_test.yaml deleted file mode 100644 index 2a4fac55ff..0000000000 --- a/.to_be_deleted/common-test/tests/statefulset/label_test.yaml +++ /dev/null @@ -1,79 +0,0 @@ -suite: statefulset label test -templates: - - common.yaml -chart: - appVersion: &appVer v1.2.3 -tests: - - it: should pass with default values - documentIndex: &statefulsetDoc 0 - set: - controller.type: StatefulSet - asserts: - - hasDocuments: - count: 3 - - isKind: - of: StatefulSet - - equal: - path: metadata.labels - value: - app: common-test - app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: common-test - app.kubernetes.io/version: *appVer - helm-revision: "0" - helm.sh/chart: common-test-1.0.0 - release: RELEASE-NAME - - equal: - path: spec.selector.matchLabels - value: - app: common-test - app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/name: common-test - release: RELEASE-NAME - - - it: should pass with controller and global labels - documentIndex: *statefulsetDoc - set: - controller.type: StatefulSet - some_key: some_value - controller: - labels: - controller_key: controller_value - controller_key2: "{{ .Values.some_key }}" - global: - labels: - global_key: global_value - global_key2: "{{ .Values.some_key }}" - asserts: - - equal: - path: metadata.labels - value: - controller_key: controller_value - controller_key2: some_value - global_key: global_value - global_key2: some_value - app: common-test - app.kubernetes.io/instance: RELEASE-NAME - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: common-test - app.kubernetes.io/version: *appVer - helm-revision: "0" - helm.sh/chart: common-test-1.0.0 - release: RELEASE-NAME - - - it: should pass with podLabels set - documentIndex: *statefulsetDoc - set: - controller.type: StatefulSet - some_key: some_value2 - podLabels: - test: some_value - test2: "{{ .Values.some_key }}" - asserts: - - equal: - path: spec.template.metadata.labels.test2 - value: some_value2 - - equal: - path: spec.template.metadata.labels.test - value: some_value diff --git a/.to_be_deleted/common-test/tests/statefulset/names_test.yaml b/.to_be_deleted/common-test/tests/statefulset/names_test.yaml deleted file mode 100644 index ecff8151a6..0000000000 --- a/.to_be_deleted/common-test/tests/statefulset/names_test.yaml +++ /dev/null @@ -1,38 +0,0 @@ -suite: statefulset name test -templates: - - common.yaml -tests: - - it: should pass with default values - documentIndex: &statefulsetDoc 0 - set: - controller.type: StatefulSet - asserts: - - hasDocuments: - count: 3 - - isKind: - of: StatefulSet - - equal: - path: metadata.name - value: RELEASE-NAME-common-test - - - it: should pass with nameOverride - documentIndex: *statefulsetDoc - set: - controller.type: StatefulSet - nameOverride: overrodename - asserts: - - equal: - path: metadata.name - value: RELEASE-NAME-overrodename - - - it: should pass with global.nameOverride - documentIndex: *statefulsetDoc - set: - controller.type: StatefulSet - nameOverride: overrodename - global: - nameOverride: globaloverrodename - asserts: - - equal: - path: metadata.name - value: RELEASE-NAME-globaloverrodename diff --git a/.to_be_deleted/common-test/tests/statefulset/vct_test.yaml b/.to_be_deleted/common-test/tests/statefulset/vct_test.yaml deleted file mode 100644 index 195f8bdc29..0000000000 --- a/.to_be_deleted/common-test/tests/statefulset/vct_test.yaml +++ /dev/null @@ -1,125 +0,0 @@ -suite: statefulset vct test -templates: - - common.yaml -tests: - - it: should pass with vct defined in StatefulSet - documentIndex: &statefulsetDoc 0 - set: - controller.type: StatefulSet - volumeClaimTemplates: - data: - enabled: true - mountPath: "/bitnami/mariadb" - asserts: - - isKind: - of: StatefulSet - - equal: - path: spec.volumeClaimTemplates[0] - value: - metadata: - name: data - spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 999Gi - - - it: should pass with multiple vct defined in StatefulSet - documentIndex: *statefulsetDoc - set: - controller.type: StatefulSet - volumeClaimTemplates: - data: - enabled: true - mountPath: "/bitnami/mariadb" - other-data: - enabled: true - mountPath: "/bitnami/mariadb" - asserts: - - isKind: - of: StatefulSet - - equal: - path: spec.volumeClaimTemplates[0] - value: - metadata: - name: data - spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 999Gi - - equal: - path: spec.volumeClaimTemplates[1] - value: - metadata: - name: other-data - spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 999Gi - - equal: - path: spec.template.spec.containers[0].volumeMounts - value: - - mountPath: /shared - name: shared - - mountPath: /tmp - name: tmp - - mountPath: /var/logs - name: varlogs - - mountPath: /bitnami/mariadb - name: data - - mountPath: /bitnami/mariadb - name: other-data - - - it: should pass with vct size changed in StatefulSet - documentIndex: *statefulsetDoc - set: - controller.type: StatefulSet - volumeClaimTemplates: - data: - enabled: true - size: 10Gi - mountPath: "/bitnami/mariadb" - asserts: - - isKind: - of: StatefulSet - - equal: - path: spec.volumeClaimTemplates[0] - value: - metadata: - name: data - spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 10Gi - - - it: should pass with accessMode changed in StatefulSet - documentIndex: *statefulsetDoc - set: - controller.type: StatefulSet - volumeClaimTemplates: - data: - enabled: true - size: 10Gi - accessMode: ReadWriteMany - mountPath: "/bitnami/mariadb" - asserts: - - isKind: - of: StatefulSet - - equal: - path: spec.volumeClaimTemplates[0] - value: - metadata: - name: data - spec: - accessModes: - - ReadWriteMany - resources: - requests: - storage: 10Gi diff --git a/.to_be_deleted/common-test/tests/utils/utils_primary_port_test.yaml b/.to_be_deleted/common-test/tests/utils/utils_primary_port_test.yaml deleted file mode 100644 index d661f0e3c7..0000000000 --- a/.to_be_deleted/common-test/tests/utils/utils_primary_port_test.yaml +++ /dev/null @@ -1,116 +0,0 @@ - -suite: primary port utils test -templates: - - common.yaml -tests: - - it: should pass with default values - documentIndex: &deploymentDoc 0 - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Deployment - - equal: - path: spec.template.spec.containers[0].livenessProbe - value: - httpGet: - path: / - port: 65535 - scheme: HTTP - failureThreshold: 5 - initialDelaySeconds: 10 - periodSeconds: 10 - timeoutSeconds: 5 - - - it: should pass with no port set as primary - documentIndex: *deploymentDoc - set: - service: - main: - ports: - main: - primary: false - protocol: TCP - port: 12345 - probes: - liveness: - type: auto - asserts: - - equal: - path: spec.template.spec.containers[0].livenessProbe - value: - tcpSocket: - port: 12345 - initialDelaySeconds: 10 - failureThreshold: 5 - timeoutSeconds: 5 - periodSeconds: 10 - - - it: should pass with main port set as primary and other not - documentIndex: *deploymentDoc - set: - service: - main: - ports: - main: - primary: true - protocol: TCP - port: 12345 - other: - primary: false - protocol: TCP - probes: - liveness: - type: auto - asserts: - - equal: - path: spec.template.spec.containers[0].livenessProbe - value: - tcpSocket: - port: 12345 - initialDelaySeconds: 10 - failureThreshold: 5 - timeoutSeconds: 5 - periodSeconds: 10 - - - it: should pass with different port set as primary - documentIndex: *deploymentDoc - set: - service: - main: - ports: - main: - primary: false - other: - enabled: true - primary: true - protocol: TCP - port: 12345 - probes: - liveness: - type: auto - asserts: - - equal: - path: spec.template.spec.containers[0].livenessProbe - value: - tcpSocket: - port: 12345 - initialDelaySeconds: 10 - failureThreshold: 5 - timeoutSeconds: 5 - periodSeconds: 10 - - - it: should fail with more than 1 primary ports - set: - service: - main: - ports: - main: - primary: true - other_port: - enabled: true - primary: true - port: 1234 - asserts: - - failedTemplate: - errorMessage: More than one ports are set as primary in the primary service. This is not supported. diff --git a/.to_be_deleted/common-test/tests/utils/utils_primary_rbac_test.yaml b/.to_be_deleted/common-test/tests/utils/utils_primary_rbac_test.yaml deleted file mode 100644 index 3ed0215e2a..0000000000 --- a/.to_be_deleted/common-test/tests/utils/utils_primary_rbac_test.yaml +++ /dev/null @@ -1,485 +0,0 @@ - -suite: primary rbac utils test -templates: - - common.yaml -tests: - - it: should pass with default values - asserts: - - hasDocuments: - count: 3 - - - it: should fail with more than 1 primary rbac - set: - rbac: - main: - enabled: true - primary: true - rules: &rules - - apiGroups: - - something - resources: - - something - verbs: - - something - subjects: &subjects - - kind: something - name: something - apiGroup: something - other: - enabled: true - primary: true - rules: *rules - subjects: *subjects - asserts: - - failedTemplate: - errorMessage: More than one RBACS are set as primary. This is not supported. - - - it: should pass with no rbac set as primary (Role) - documentIndex: &roleDoc 0 - set: - rbac: - main: - enabled: true - primary: false - rules: *rules - subjects: *subjects - asserts: - - hasDocuments: - count: 5 - - isKind: - of: Role - - equal: - path: metadata.name - value: RELEASE-NAME-common-test - - - it: should pass with no rbac set as primary (RoleBinding) - documentIndex: &roleBindingDoc 1 - set: - rbac: - main: - enabled: true - primary: false - rules: *rules - subjects: *subjects - asserts: - - hasDocuments: - count: 5 - - isKind: - of: RoleBinding - - equal: - path: metadata.name - value: RELEASE-NAME-common-test - - - it: should pass with no rbac set as primary (ClusterRole) - documentIndex: *roleDoc - set: - rbac: - main: - enabled: true - primary: false - clusterWide: true - rules: *rules - subjects: *subjects - asserts: - - hasDocuments: - count: 5 - - isKind: - of: ClusterRole - - equal: - path: metadata.name - value: RELEASE-NAME-common-test - - - it: should pass with no rbac set as primary (ClusterRoleBinding) - documentIndex: *roleBindingDoc - set: - rbac: - main: - enabled: true - primary: false - clusterWide: true - rules: *rules - subjects: *subjects - asserts: - - hasDocuments: - count: 5 - - isKind: - of: ClusterRoleBinding - - equal: - path: metadata.name - value: RELEASE-NAME-common-test - - - it: should pass with main rbac set as primary and other not (Role - main) - documentIndex: *roleDoc - set: - rbac: - main: - enabled: true - primary: true - rules: *rules - subjects: *subjects - other: - enabled: true - primary: false - rules: *rules - subjects: *subjects - asserts: - - hasDocuments: - count: 7 - - isKind: - of: Role - - equal: - path: metadata.name - value: RELEASE-NAME-common-test - - - it: should pass with main rbac set as primary and other not (Role - other) - documentIndex: &otherRoleDoc 2 - set: - rbac: - main: - enabled: true - primary: true - rules: *rules - subjects: *subjects - other: - enabled: true - primary: false - rules: *rules - subjects: *subjects - asserts: - - hasDocuments: - count: 7 - - isKind: - of: Role - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-other - - - it: should pass with main rbac set as primary and other not (RoleBinding - main) - documentIndex: *roleBindingDoc - set: - rbac: - main: - enabled: true - primary: true - rules: *rules - subjects: *subjects - other: - enabled: true - primary: false - rules: *rules - subjects: *subjects - asserts: - - hasDocuments: - count: 7 - - isKind: - of: RoleBinding - - equal: - path: metadata.name - value: RELEASE-NAME-common-test - - - it: should pass with main rbac set as primary and other not (RoleBinding - other) - documentIndex: &otherRoleBindingDoc 3 - set: - rbac: - main: - enabled: true - primary: true - rules: *rules - subjects: *subjects - other: - enabled: true - primary: false - rules: *rules - subjects: *subjects - asserts: - - hasDocuments: - count: 7 - - isKind: - of: RoleBinding - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-other - - - it: should pass with main rbac set as primary and other not (ClusterRole - main) - documentIndex: *roleDoc - set: - rbac: - main: - enabled: true - primary: true - clusterWide: true - rules: *rules - subjects: *subjects - other: - enabled: true - primary: false - rules: *rules - subjects: *subjects - asserts: - - hasDocuments: - count: 7 - - isKind: - of: ClusterRole - - equal: - path: metadata.name - value: RELEASE-NAME-common-test - - - it: should pass with main rbac set as primary and other not (ClusterRole - other) - documentIndex: *otherRoleDoc - set: - rbac: - main: - enabled: true - primary: true - rules: *rules - subjects: *subjects - other: - enabled: true - primary: false - clusterWide: true - rules: *rules - subjects: *subjects - asserts: - - hasDocuments: - count: 7 - - isKind: - of: ClusterRole - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-other - - - it: should pass with main rbac set as primary and other not (ClusterRoleBinding - main) - documentIndex: *roleBindingDoc - set: - rbac: - main: - enabled: true - primary: true - clusterWide: true - rules: *rules - subjects: *subjects - other: - enabled: true - primary: false - rules: *rules - subjects: *subjects - asserts: - - hasDocuments: - count: 7 - - isKind: - of: ClusterRoleBinding - - equal: - path: metadata.name - value: RELEASE-NAME-common-test - - - it: should pass with main rbac set as primary and other not (ClusterRoleBinding - other) - documentIndex: *otherRoleBindingDoc - set: - rbac: - main: - enabled: true - primary: true - rules: *rules - subjects: *subjects - other: - enabled: true - primary: false - clusterWide: true - rules: *rules - subjects: *subjects - asserts: - - hasDocuments: - count: 7 - - isKind: - of: ClusterRoleBinding - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-other - - - it: should pass with other rbac set as primary and main not (Role - main) - documentIndex: *roleDoc - set: - rbac: - main: - enabled: true - primary: false - rules: *rules - subjects: *subjects - other: - enabled: true - primary: true - rules: *rules - subjects: *subjects - asserts: - - hasDocuments: - count: 7 - - isKind: - of: Role - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-main - - - it: should pass with other rbac set as primary and main not (Role - other) - documentIndex: &otherRoleDoc 2 - set: - rbac: - main: - enabled: true - primary: false - rules: *rules - subjects: *subjects - other: - enabled: true - primary: true - rules: *rules - subjects: *subjects - asserts: - - hasDocuments: - count: 7 - - isKind: - of: Role - - equal: - path: metadata.name - value: RELEASE-NAME-common-test - - - it: should pass with other rbac set as primary and main not (RoleBinding - main) - documentIndex: *roleBindingDoc - set: - rbac: - main: - enabled: true - primary: false - rules: *rules - subjects: *subjects - other: - enabled: true - primary: true - rules: *rules - subjects: *subjects - asserts: - - hasDocuments: - count: 7 - - isKind: - of: RoleBinding - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-main - - - it: should pass with other rbac set as primary and main not (RoleBinding - other) - documentIndex: &otherRoleBindingDoc 3 - set: - rbac: - main: - enabled: true - primary: false - rules: *rules - subjects: *subjects - other: - enabled: true - primary: true - rules: *rules - subjects: *subjects - asserts: - - hasDocuments: - count: 7 - - isKind: - of: RoleBinding - - equal: - path: metadata.name - value: RELEASE-NAME-common-test - - - it: should pass with other rbac set as primary and main not (ClusterRole - main) - documentIndex: *roleDoc - set: - rbac: - main: - enabled: true - primary: false - clusterWide: true - rules: *rules - subjects: *subjects - other: - enabled: true - primary: true - rules: *rules - subjects: *subjects - asserts: - - hasDocuments: - count: 7 - - isKind: - of: ClusterRole - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-main - - - it: should pass with other rbac set as primary and main not (ClusterRole - other) - documentIndex: *otherRoleDoc - set: - rbac: - main: - enabled: true - primary: false - rules: *rules - subjects: *subjects - other: - enabled: true - primary: true - clusterWide: true - rules: *rules - subjects: *subjects - asserts: - - hasDocuments: - count: 7 - - isKind: - of: ClusterRole - - equal: - path: metadata.name - value: RELEASE-NAME-common-test - - - it: should pass with other rbac set as primary and main not (ClusterRoleBinding - main) - documentIndex: *roleBindingDoc - set: - rbac: - main: - enabled: true - primary: false - clusterWide: true - rules: *rules - subjects: *subjects - other: - enabled: true - primary: true - rules: *rules - subjects: *subjects - asserts: - - hasDocuments: - count: 7 - - isKind: - of: ClusterRoleBinding - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-main - - - it: should pass with other rbac set as primary and main not (ClusterRoleBinding - other) - documentIndex: *otherRoleBindingDoc - set: - rbac: - main: - enabled: true - primary: false - rules: *rules - subjects: *subjects - other: - enabled: true - primary: true - clusterWide: true - rules: *rules - subjects: *subjects - asserts: - - hasDocuments: - count: 7 - - isKind: - of: ClusterRoleBinding - - equal: - path: metadata.name - value: RELEASE-NAME-common-test diff --git a/.to_be_deleted/common-test/tests/utils/utils_primary_serviceAccount_test.yaml b/.to_be_deleted/common-test/tests/utils/utils_primary_serviceAccount_test.yaml deleted file mode 100644 index 0a653960fe..0000000000 --- a/.to_be_deleted/common-test/tests/utils/utils_primary_serviceAccount_test.yaml +++ /dev/null @@ -1,114 +0,0 @@ - -suite: primary serviceAccount utils test -templates: - - common.yaml -tests: - - it: should pass with default values - asserts: - - hasDocuments: - count: 3 - - - it: should fail with more than 1 primary serviceAccounts - set: - serviceAccount: - main: - enabled: true - primary: true - other: - enabled: true - primary: true - asserts: - - failedTemplate: - errorMessage: More than one serviceAccounts are set as primary. This is not supported. - - - it: should pass with no serviceAccount set as primary - documentIndex: &serviceAccountDoc 0 - set: - serviceAccount: - main: - enabled: true - primary: false - asserts: - - hasDocuments: - count: 4 - - isKind: - of: ServiceAccount - - equal: - path: metadata.name - value: RELEASE-NAME-common-test - - - it: should pass with main serviceAccount set as primary and other not (check name on main) - documentIndex: *serviceAccountDoc - set: - serviceAccount: - main: - enabled: true - primary: true - other: - enabled: true - primary: false - asserts: - - hasDocuments: - count: 5 - - isKind: - of: ServiceAccount - - equal: - path: metadata.name - value: RELEASE-NAME-common-test - - - it: should pass with main serviceAccount set as primary and other not (check name on other) - documentIndex: &otherServiceAccountDoc 1 - set: - serviceAccount: - main: - enabled: true - primary: true - other: - enabled: true - primary: false - asserts: - - hasDocuments: - count: 5 - - isKind: - of: ServiceAccount - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-other - - - it: should pass with different serviceAccount set as primary (check name on main) - documentIndex: *serviceAccountDoc - set: - serviceAccount: - main: - enabled: true - primary: false - other: - enabled: true - primary: true - asserts: - - hasDocuments: - count: 5 - - isKind: - of: ServiceAccount - - equal: - path: metadata.name - value: RELEASE-NAME-common-test-main - - - it: should pass with different serviceAccount set as primary (check name on other) - documentIndex: *otherServiceAccountDoc - set: - serviceAccount: - main: - enabled: true - primary: false - other: - enabled: true - primary: true - asserts: - - hasDocuments: - count: 5 - - isKind: - of: ServiceAccount - - equal: - path: metadata.name - value: RELEASE-NAME-common-test diff --git a/.to_be_deleted/common-test/tests/utils/utils_primary_service_test.yaml b/.to_be_deleted/common-test/tests/utils/utils_primary_service_test.yaml deleted file mode 100644 index 290d99c4d6..0000000000 --- a/.to_be_deleted/common-test/tests/utils/utils_primary_service_test.yaml +++ /dev/null @@ -1,121 +0,0 @@ - -suite: primary service utils test -templates: - - common.yaml -tests: - - it: should pass with default values - documentIndex: &deploymentDoc 0 - asserts: - - hasDocuments: - count: 3 - - isKind: - of: Deployment - - equal: - path: spec.template.spec.containers[0].livenessProbe - value: - httpGet: - path: / - port: 65535 - scheme: HTTP - failureThreshold: 5 - initialDelaySeconds: 10 - periodSeconds: 10 - timeoutSeconds: 5 - - - it: should fail with more than 1 primary services - set: - service: - main: - primary: true - other: - enabled: true - primary: true - ports: - other: - enabled: true - port: 80 - asserts: - - failedTemplate: - errorMessage: More than one services are set as primary. This is not supported. - - - - it: should pass with main service set as primary and other not - documentIndex: *deploymentDoc - set: - service: - main: - primary: true - ports: - main: - protocol: TCP - port: 12345 - other: - primary: false - ports: - main: - protocol: TCP - probes: - liveness: - type: auto - asserts: - - equal: - path: spec.template.spec.containers[0].livenessProbe - value: - tcpSocket: - port: 12345 - initialDelaySeconds: 10 - failureThreshold: 5 - timeoutSeconds: 5 - periodSeconds: 10 - - - it: should pass with no service set as primary - documentIndex: *deploymentDoc - set: - service: - main: - primary: false - ports: - main: - protocol: TCP - port: 12345 - probes: - liveness: - type: auto - asserts: - - equal: - path: spec.template.spec.containers[0].livenessProbe - value: - tcpSocket: - port: 12345 - initialDelaySeconds: 10 - failureThreshold: 5 - timeoutSeconds: 5 - periodSeconds: 10 - - - it: should pass with different service set as primary - documentIndex: *deploymentDoc - set: - service: - main: - primary: false - other: - enabled: true - primary: true - ports: - other: - enabled: true - protocol: TCP - port: 12345 - probes: - liveness: - type: auto - asserts: - - equal: - path: spec.template.spec.containers[0].livenessProbe - value: - tcpSocket: - port: 12345 - initialDelaySeconds: 10 - failureThreshold: 5 - timeoutSeconds: 5 - periodSeconds: 10 diff --git a/.to_be_deleted/common-test/values.yaml b/.to_be_deleted/common-test/values.yaml deleted file mode 100644 index 67cebbb6ff..0000000000 --- a/.to_be_deleted/common-test/values.yaml +++ /dev/null @@ -1,5 +0,0 @@ -service: - main: - ports: - main: - port: 65535 diff --git a/.to_be_deleted/common/values/annotations.md b/.to_be_deleted/common/values/annotations.md deleted file mode 100644 index 8b173251f3..0000000000 --- a/.to_be_deleted/common/values/annotations.md +++ /dev/null @@ -1,134 +0,0 @@ -# Annotations - -Annotations can be defined in nearly all resources. - -## Key: addAnnotations - -Info: - -- Type: `dict` -- Default: - - ```yaml - addAnnotations: - traefik: true - metallb: true - ``` - -- Helm Template: ❌ - -Can be defined in: - -- `.Values`.addAnnotations - ---- - -Enables or disables addition of annotations in `Service` objects. - -`metallb: true` adds `metallb.universe.tf/allow-shared-ip: $FULLNAME` annotation. -Only when service type is `LoadBalancer`. - -`traefik: true` adds `traefik.ingress.kubernetes.io/service.serversscheme: https` -annotation. Only when service protocol is `HTTPS` - -Examples: - -```yaml -addAnnotations: - traefik: true - metallb: true -``` - ---- ---- - -## Key: podAnnotations - -Info: - -- Type: `dict` -- Default: `{}` -- Helm Template: - - Key: ❌ - - Value: ✅ - -Can be defined in: - -- `.Values`.podAnnotations - ---- - -Adds the defined annotations to the Pod - -Examples: - -```yaml -podAnnotations: - key: value - key: "{{ .Values.some.path }}" -``` - ---- ---- - -## Key: controller.annotations - -Info: - -- Type: `dict` -- Default: `{}` -- Helm Template: - - Key: ❌ - - Value: ✅ - -Can be defined in: - -- `.Values.controller.`annotations - ---- - -Adds the defined annotations to the controller -(eg Deployment, StatefulSet, DaemonSet, Job, CronJob) - -Examples: - -```yaml -controller: - annotations: - key: value - key: "{{ .Values.some.path }}" -``` - ---- ---- - -## Key: global.annotations - -Info: - -- Type: `dict` -- Default: `{}` -- Helm Template: - - Key: ❌ - - Value: ✅ - -Can be defined in: - -- `.Values.global.`annotations - ---- - -Adds the defined annotations to all the resources - -Examples: - -```yaml -global: - annotations: - key: value - key: "{{ .Values.some.path }}" -``` - -Kubernetes Documentation: - -- [Annotations](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations) diff --git a/.to_be_deleted/common/values/certificates.md b/.to_be_deleted/common/values/certificates.md deleted file mode 100644 index 2fc9cee945..0000000000 --- a/.to_be_deleted/common/values/certificates.md +++ /dev/null @@ -1,80 +0,0 @@ -# Certificates - -## Key: scaleCerts - -Info: - -- Type: `dict` -- Default: `{}` -- Helm Template: - - certPath: ✅ - - keyPath: ✅ - -Can be defined in: - -- `.Values`.scaleCerts - ---- - -Before taking any action, it will check if middleware have populated -the `ixCertificates` list, and that the `id` is included. - -For every item it will create a secret containing -the certificate and the private key. - -Optionally, you can mount certificate, private key or both in the -container as files. - -Examples: - -```yaml -scaleCerts: - some_cert_name: - # ID Comes from the definitions on the GUI - id: 1 - # Optional, Override Name - nameOverride: name_override - # Optional, If populated, it will mount the certificate in the container's path - certPath: /some/path/in/the/container/crt.key - # Optional, If populated, it will mount the private key in the container's path - keyPath: /some/path/in/the/container/key.key -``` - ---- ---- - -## Key: scaleCertsList - -Info: - -- Type: `list` -- Default: `[]` -- Helm Template: - - certPath: ✅ - - keyPath: ✅ - -Can be defined in: - -- `.Values`.scaleCertsList - ---- - -Anything that applies to `scaleCerts` applies here too. - -The only difference is that this is a `list` instead of `dict` - -This list can used for Scale GUI as it's easier to build lists. - -Example: - -```yaml -scaleCertsList: - - name: some_cert_name - id: 1 - # Optional - nameOverride: name_override - # Optional - certPath: - # Optional - keyPath: -``` diff --git a/.to_be_deleted/common/values/command-args.md b/.to_be_deleted/common/values/command-args.md deleted file mode 100644 index dee27dcc53..0000000000 --- a/.to_be_deleted/common/values/command-args.md +++ /dev/null @@ -1,141 +0,0 @@ -# Command / Args - -| Key | Type | Helm Template | Default | Description | -| :-------- | :---------: | :-----------: | :-----: | :---------------------- | -| command | list/string | Yes | `[]` | [command](#command) | -| args | list/string | Yes | `[]` | [args](#args) | -| extraArgs | list/string | Yes | `[]` | [extraArgs](#extraargs) | - -## command - -Overrides the entrypoint of the container - ---- - -Can be defined in: - -- `.Values`.command -- `.Values.lifecycle.preStop`.command -- `.Values.lifecycle.postStart`.command -- `.Values.probes.[probe-name].exec`.command -- `.Values.initContainers.[container-name]`.command -- `.Values.systemContainers.[container-name]`.command -- `.Values.installContainers.[container-name]`.command -- `.Values.upgradeContainers.[container-name]`.command -- `.Values.additionalContainers.[container-name]`.command -- `.Values.additionalContainers.[container-name].lifecycle.preStop`.command -- `.Values.additionalContainers.[container-name].lifecycle.postStart`.command -- `.Values.jobs.[job-name].podSpec.containers.[container-name].[container-name]`.command - ---- - -Examples: - -```yaml -# String / Single command -command: ./custom-script.sh -# String / Single command (tpl) -command: "{{ .Values.customCommand }}" - -# List -command: - - /bin/sh - - -c - - | - echo "Doing things..." -# List (tpl) -command: - - /path/to/executable - - --port - - "{{ .Values.service.main.ports.main.port }}" -``` - ---- - ---- - -## args - -Specify a single or a list of arguments for the entrypoint of the container. - ---- - -Can be defined in: - -- `.Values`.args -- `.Values.additionalContainers.[container-name]`.args -- `.Values.initContainers.[container-name]`.args -- `.Values.installContainers.[container-name]`.args -- `.Values.upgradeContainers.[container-name]`.args -- `.Values.systemContainers.[container-name]`.args -- `.Values.jobs.[job-name].podSpec.containers.[container-name].[container-name]`.args - ---- - -Examples: - -```yaml -# String / Single args -args: worker -# String / Single arg (tpl) -arg: "{{ .Values.mode }}" - -# List -arg: - - --port - - 8080 -# List (tpl) -arg: - - --port - - "{{ .Values.service.main.ports.main.port }}" -``` - ---- - ---- - -## extraArgs - -Specify a single or a list of arguments that will be appended to [args](#args) -This is useful for exposing it on SCALE GUI, so users can append -arguments on top of the ones defined from the chart developer - ---- - -Can be defined in: - -- `.Values`.extraArgs -- `.Values.additionalContainers.[container-name]`.extraArgs -- `.Values.initContainers.[container-name]`.extraArgs -- `.Values.installContainers.[container-name]`.extraArgs -- `.Values.upgradeContainers.[container-name]`.extraArgs -- `.Values.systemContainers.[container-name]`.extraArgs -- `.Values.jobs.[job-name].podSpec.containers.[container-name].[container-name]`.extraArgs - ---- - -Examples: - -```yaml -# String / Single args -extraArgs: some_extra_arg -# String / Single arg (tpl) -extraArgs: "{{ .Values.some_key }}" - -# List -extraArgs: - - --photos_path - - /path/to/photos -# List (tpl) -extraArgs: - - --photos_path - - "{{ .Values.persistence.photos.mountPath }}" -``` - ---- - ---- - -Kubernetes Documentation: - -- [Command / Args](https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#define-a-command-and-arguments-when-you-create-a-pod) diff --git a/.to_be_deleted/common/values/configmap.md b/.to_be_deleted/common/values/configmap.md deleted file mode 100644 index 8d17a6cbf4..0000000000 --- a/.to_be_deleted/common/values/configmap.md +++ /dev/null @@ -1,48 +0,0 @@ -# ConfigMap - -| Key | Type | Helm Template | Default | Description | -| :-------------------------------------------- | :-----: | :-----------: | :-----: | :--------------------------------------------------------------------- | -| configmap | object | Yes | `{}` | [configmap](#configmap) | -| configmap.[configmap-name] | object | Yes | `{}` | [configmap](#configmap) | -| configmap.[configmap-name].enabled | boolean | Yes | unset | Enables or Disables the configmap | -| configmap.[configmap-name].labels | object | Yes | `{}` | Specify labels for the configmap | -| configmap.[configmap-name].annotations | object | Yes | `{}` | Specify annotations for the configmap | -| configmap.[configmap-name].nameOverride | string | Yes | `""` | Specify a name override for the configmap | -| configmap.[configmap-name].parseAsEnv | boolean | Yes | unset | Specify if the `content` should be parsed as envs (for the Dupe Check) | -| configmap.[configmap-name].content | object | Yes | `{}` | Specify the content of the configmap | -| configmap.[configmap-name].content.[key-name] | string | Yes | `""` | Specify the value of the key. String and Scalar is supported | - -## configmap - -Creates a configmap based on the `content` - -> When parseAsEnv is checked, content will be checked against `env`, `envList`, `fixedEnvs` and -> other configmaps / secrets for duplicate envs. This can be useful to prevent overriding other envs -> either by mistake or user not knowing that the env is already set by the app developer - ---- - -Can be defined in: - -- `.Values`.configmap - ---- - -Examples: - -```yaml -configmap: - somename: - enabled: true - content: - somekey: value - otherkey: othervalue - -configmap: - somename: - enabled: true - content: - somekey: value - nginx.conf: | - listen {{ .Values.service.main.ports.main.port }} -``` diff --git a/.to_be_deleted/common/values/controller.md b/.to_be_deleted/common/values/controller.md deleted file mode 100644 index b3b4d69bcd..0000000000 --- a/.to_be_deleted/common/values/controller.md +++ /dev/null @@ -1,63 +0,0 @@ -# Controller - -## Key: controller - -Info: - -- Type: `dict` -- Default: - - ```yaml - controller: - # -- Enable the controller. - enabled: true - # -- Set the controller type. - # Valid options are Deployment | DaemonSet | StatefulSet | CronJob | Job - type: Deployment - # -- Set labels on the Deployment/StatefulSet/DaemonSet/CronJob/Job. - labels: {} - # -- Set annotations on the Deployment/StatefulSet/DaemonSet. - annotations: {} - # -- Revision history limit - revisionHistoryLimit: 3 - # -- Number of desired pods - replicas: 1 - # -- Set the controller upgrade strategy - # For Deployments, valid values are Recreate (default) and RollingUpdate. - # For StatefulSets, valid values are OnDelete and RollingUpdate (default). - # For DaemonSets, valid values are OnDelete and RollingUpdate (default). - # Jobs and CronJobs, ignores this - strategy: "" - # -- Set rollingUpdate strategies - rollingUpdate: - # -- Set RollingUpdate max unavailable - # Deployments | DaemonSet | StatefulSet - unavailable: - # -- Set RollingUpdate max surge - # Deployments | DaemonSet - surge: - # -- Set RollingUpdate partition - # StatefulSet - partition: - ``` - -- Helm Template: - - controller.labels.KEY: ❌ - - controller.labels.VALUE: ✅ - - controller.annotations.KEY: ❌ - - controller.annotations.VALUE: ✅ - -Can be defined in: - -- `.Values`.controller - ---- - -Defines options for the controller (Deployment, StatefulSet, etc) - -In `Deployments` it should not need anything to be defined at all in the Chart. - -> When running a standalone `Job` or `CronJob`, values that you would -> define in `.Values.jobs.[job-name].VALUE`, would go in `.Values.controller`. -> -> Eg. values like `schedule` `restartPolicy`. diff --git a/.to_be_deleted/common/values/dns.md b/.to_be_deleted/common/values/dns.md deleted file mode 100644 index 5df91de0b6..0000000000 --- a/.to_be_deleted/common/values/dns.md +++ /dev/null @@ -1,62 +0,0 @@ -# DNS - -## Key: dnsPolicy - -Info: - -- Type: `string` -- Default: `""` -- Helm Template: ❌ - -Can be defined in: - -- `.Values`.dnsPolicy -- `.Values.jobs.[job-name].podSpec`.dnsPolicy - ---- - -Defines the `dnsPolicy` for the workload. - -You can also set a global default `dnsPolicy` in `.Values.global.defaults.dnsPolicy` - -> Assuming it's left empty, it will use the global default, which is `ClusterFirst` -> If hostNetwork is enabled for the Pod, it will automatically switch `ClusterFirstWithHostNet` - -Priority of usage (Highest to Lowest): - -- Per pod definition -- Global definition - -Examples: - -```yaml -dnsPolicy: ClusterFirst -``` - -Kubernetes Documentation: - -- [DNS Policy](https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-s-dns-policy) - ---- ---- - -## Key: dnsConfig - -Info: - -- Type: `dict` -- Default: `{}` -- Helm Template: - - dnsConfig.nameservers.[item]: ✅ - - dnsConfig.searches.[item]: ✅ - - dnsConfig.options.name: ✅ - - dnsConfig.options.value: ✅ - -Can be defined in: - -- `.Values`.dnsConfig -- `.Values.jobs.[job-name].podSpec`.dnsConfig - ---- - -Defines dns configuration for the Pod. diff --git a/.to_be_deleted/common/values/environment_variable.md b/.to_be_deleted/common/values/environment_variable.md deleted file mode 100644 index b05ef0d77c..0000000000 --- a/.to_be_deleted/common/values/environment_variable.md +++ /dev/null @@ -1,341 +0,0 @@ -# Environment Variable - -| Key | Type | Helm Template | Default | Description | -| :----------------------------------- | :-------------: | :-----------: | :-----: | :-------------------------------------------- | -| env | object | Yes | `{}` | [env](#env) | -| env.[env-name] | object / string | Yes | `""` | Specify the value for the `env-name` | -| env.[env-name].secretKeyRef | object | Yes | `{}` | Objects that holds info for the secret ref | -| env.[env-name].secretKeyRef.name | string | Yes | `""` | Specify the secret name | -| env.[env-name].secretKeyRef.key | string | Yes | `""` | Specify the key on the secret | -| env.[env-name].secretKeyRef.optional | boolean | Yes | `false` | Specify if the secret is optional | -| env.[env-name].configMapKeyRef | object | Yes | `{}` | Objects that holds info for the configMap ref | -| env.[env-name].configMapKeyRef.name | string | Yes | `""` | Specify the configMap name | -| env.[env-name].configMapKeyRef.key | string | Yes | `""` | Specify the key on the configMap | -| envList | list | Yes | `[]` | [envlist](#envlist) | -| envList.name | string | Yes | `""` | The name of the env | -| envList.value | string | Yes | `""` | The value of the env | -| envFrom | list | Yes | `[]` | [envfrom](#envfrom) | -| envFrom.secretRef | object | Yes | `{}` | Objects that holds info for the secret ref | -| envFrom.secretRef.name | string | Yes | `""` | The name of the secret | -| envFrom.configMapRef | object | Yes | `{}` | Objects that holds info for the configMap ref | -| envFrom.configMapRef.name | string | Yes | `""` | The name of the configMap | - -## env - -Contains environment variables and can be defined in few different formats - ---- - -Can be defined in: - -- `.Values`.env -- `.Values.initContainers.[container-name]`.env -- `.Values.systemContainers.[container-name]`.env -- `.Values.installContainers.[container-name]`.env -- `.Values.upgradeContainers.[container-name]`.env -- `.Values.additionalContainers.[container-name]`.env -- `.Values.jobs.[job-name].podSpec.containers.[container-name].[container-name]`.env - ---- - -Examples: - -```yaml -env: -# Key/Value pairs - ADMIN_PASS: password -# Key/Value pairs (tpl) - ADMIN_PASS: "{{ .Values.app.password }}" - -# ConfigMap Key Reference - ADMIN_PASS: - configMapKeyRef: - name: configMap_name - key: configMap_key -# ConfigMap Key Reference (tpl) - ADMIN_PASS: - configMapKeyRef: - name: "{{ .Values.config.name }}" - key: "{{ .Values.config.key }}" - -# Secret Key Reference - ADMIN_PASS: - secretKeyRef: - optional: true / false - name: secret_name - key: secret_key -# Secret Key Reference (tpl) - ADMIN_PASS: - secretKeyRef: - optional: true / false - name: "{{ .Values.config.name }}" - key: "{{ .Values.config.key }}" -``` - ---- - ---- - -## envList - -Mainly designed to be used in the SCALE GUI. -So users can pass additional environment variables. - -Can be defined in: - -- `.Values`.envList -- `.Values.additionalContainers.[container-name]`.envList -- `.Values.initContainers.[container-name]`.envList -- `.Values.installContainers.[container-name]`.envList -- `.Values.upgradeContainers.[container-name]`.envList -- `.Values.systemContainers.[container-name]`.envList -- `.Values.jobs.[job-name].podSpec.containers.[container-name].[container-name]`.envList - ---- - -Examples: - -```yaml -envList: - # List entry - - name: ADMIN_PASS - value: password - # List entry (tpl) - - name: "{{ .Values.envName }}" - value: "{{ .Values.password }}" -``` - ---- - ---- - -## envFrom - -Used to load multiple environment variables -from a `configMap` or a `secret`. With a single list entry, -it will load all keys as environment variables -defined in the specified object. - -Can be defined in: - -- `.Values`.envFrom -- `.Values.additionalContainers.[container-name]`.envFrom -- `.Values.initContainers.[container-name]`.envFrom -- `.Values.installContainers.[container-name]`.envFrom -- `.Values.upgradeContainers.[container-name]`.envFrom -- `.Values.systemContainers.[container-name]`.envFrom -- `.Values.jobs.[job-name].podSpec.containers.[container-name].[container-name]`.envFrom - ---- - -Examples: - -```yaml -envFrom: - # List entry - - secretRef: - name: secretName - - configMapRef: - name: configMapName - # List entry (tpl) - - secretRef: - name: "{{ .Values.secretName }}" - - configMapRef: - name: "{{ .Values.configMapName }}" -``` - ---- - ---- - -## Fixed Environment Variables - -### TZ - -Info: - -- Type: `string` -- Default: `UTC` -- Helm Template: ❌ - -Can be defined in: - -- `.Values`.TZ -- `.Values.additionalContainers.[container-name]`.TZ -- `.Values.initContainers.[container-name]`.TZ -- `.Values.installContainers.[container-name]`.TZ -- `.Values.upgradeContainers.[container-name]`.TZ -- `.Values.systemContainers.[container-name]`.TZ -- `.Values.jobs.[job-name].podSpec.containers.[container-name].[container-name]`.TZ - ---- - -Usually defined from the SCALE's GUI dropdown. -It is also injected as environment variable into the container. -It can also be used to pass timezone to other environment variables -an app would use. - -> Only applied used when `injectFixedEnvs` is set to `true`. - -Example: - -```yaml -TZ: UTC - -env: - PHP_TZ: "{{ .Values.TZ }}" -``` - ---- - ---- - -## security - -Info: - -- Type: `dict` -- Default: - - ```yaml - security: - PUID: 568 - UMASK: 002 - ``` - -- Helm Template: ❌ - -Can be defined in: - -- `.Values`.security -- `.Values.additionalContainers.[container-name]`.security -- `.Values.initContainers.[container-name]`.security -- `.Values.installContainers.[container-name]`.security -- `.Values.upgradeContainers.[container-name]`.security -- `.Values.systemContainers.[container-name]`.security -- `.Values.jobs.[job-name].podSpec.containers.[container-name].[container-name]`.security - ---- - -Used to define a default `PUID` and `UMASK` to containers. - -> If not defined it will use the `.Values.global.defaults.security` -> Only applied used when `injectFixedEnvs` is set to `true`. - -Examples: - -```yaml -security: - PUID: 0 - UMASK: 002 -``` - ---- - ---- - -## nvidiaCaps - -Info: - -- Type: `list` -- Default: - - ```yaml - nvidiaCaps: - - all - ``` - -- Helm Template: ❌ - -Can be defined in: - -- `.Values`.nvidiaCaps -- `.Values.additionalContainers.[container-name]`.nvidiaCaps -- `.Values.initContainers.[container-name]`.nvidiaCaps -- `.Values.installContainers.[container-name]`.nvidiaCaps -- `.Values.upgradeContainers.[container-name]`.nvidiaCaps -- `.Values.systemContainers.[container-name]`.nvidiaCaps -- `.Values.jobs.[job-name].podSpec.containers.[container-name].[container-name]`.nvidiaCaps - ---- - -Defines the value of nvidia capabilities variable that will be injected in the container. - -> If it's empty it will use the `.Values.global.defaults.nvidiaCaps` -> Only applied when a GPU is passed through - -Example: - -```yaml -nvidiaCaps: - - compute - - utility -``` - ---- - ---- - -## injectFixedEnvs - -Info: - -- Type: `boolean` -- Default: `true` -- Helm Template: ❌ - -Can be defined in: - -- `.Values`.injectFixedEnvs -- `.Values.additionalContainers.[container-name]`.injectFixedEnvs -- `.Values.initContainers.[container-name]`.injectFixedEnvs -- `.Values.installContainers.[container-name]`.injectFixedEnvs -- `.Values.upgradeContainers.[container-name]`.injectFixedEnvs -- `.Values.systemContainers.[container-name]`.injectFixedEnvs -- `.Values.jobs.[job-name].podSpec.containers.[container-name].[container-name]`.injectFixedEnvs - -If **enabled**, injects environment variables to the container. - -> If not defined, it will use the `.Values.global.defaults.injectFixedEnvs` - -`TZ`: - -> Applied always. No conditions. - -`UMASK`, `UMASK_SET`: - -> Applied always. No conditions. - -`NVIDIA_VISIBLE_DEVICES`: - -> Applied and set to `void`, if container has no GPU pass through. - -`NVIDIA_DRIVER_CAPABILITIES`: - -> Applied when a GPU is passed through to the container. -> Value is defined based on the `nvidiaCaps` key - -`PGID`, `GROUP_ID`, `GID`: - -> Applied when container runs as `root` user or `root` group. -> `PGID`, `GROUP_ID`, `GID` is always equal to `fsGroup`. - -`PUID`, `USER_ID`, `UID`: - -> Applied when container runs as `root` user or `root` group. - -`S6_READ_ONLY_ROOT`: - -> Applied when container runs as `root` user or `root` group -> or has `readOnlyRootFilesystem` set to true - -Example: - -```yaml -injectFixedEnvs: true -``` - -Kubernetes Documentation: - -- [Environment Variables](https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/#define-an-environment-variable-for-a-container) diff --git a/.to_be_deleted/common/values/externalInterfaces.md b/.to_be_deleted/common/values/externalInterfaces.md deleted file mode 100644 index f34a8dad31..0000000000 --- a/.to_be_deleted/common/values/externalInterfaces.md +++ /dev/null @@ -1,67 +0,0 @@ -# External Interfaces - -## Key: externalInterfaces - -Info: - -- Type: `list` -- Default: `[]` -- Helm Template: ❌ - -Can be defined in: - -- `.Values`.externalInterfaces - ---- - -It's used in SCALE GUI. Configuration added in this key (from the GUI), -is parsed from the middleware. Middleware then injects 2 other `lists`. -`ixExternalInterfacesConfiguration` and`ixExternalInterfacesConfigurationNames`. -Which are parsed from the Chart to create the objects. - -Examples: - -```yaml -externalInterfaces: - - hostInterface: ens4 - ipam: - type: dhcp -``` - -With the above example middleware will output something like the bellow: - -```yaml -ixExternalInterfacesConfiguration: [] - - '{"cniVersion": "0.3.1", "name": "ix-RELEASE-NAME-0", "type": "macvlan", "master": "ens4", "ipam": {"type": "dhcp"}}' - -ixExternalInterfacesConfigurationNames: [] - - ix-RELEASE-NAME-0 -``` - -Chart will add an annotation to the deployment like this -`k8s.v1.cni.cncf.io/networks: ix-RELEASE-NAME-0`. - -If more than one `ixExternalInterfacesConfigurationNames` presents, -annotation looks like `k8s.v1.cni.cncf.io/networks: ix-RELEASE-NAME-0, ix-RELEASE-NAME-1`. - -Also for each item in `ixExternalInterfacesConfiguration` will create a -`NetworkAttachmentDefinition` object and adding the item to `spec.config` as is. -Name will be `ix-RELEASE-NAME-$index` - -Other examples: - -```yaml -externalInterfaces: - - hostInterface: ens3 - ipam: - type: static - # Only available when type equals static - staticIPConfigurations: - - 1.2.3.4 - # Only available when type equals static - staticRoutes: - - destination: 1.2.3.4 - gateway: 1.2.3.4 -``` - -`hostInterface` values are generated from the SCALE GUI diff --git a/.to_be_deleted/common/values/global.md b/.to_be_deleted/common/values/global.md deleted file mode 100644 index b1f91ac58f..0000000000 --- a/.to_be_deleted/common/values/global.md +++ /dev/null @@ -1,138 +0,0 @@ -# Global - -## Key: defaults - -- Type: `dict` -- Default: - - ```yaml - global: - defaults: - # If not defined on per pod or in ixChartContext, assume this. - # Empty means NO runtimeClassName - runtimeClassName: "" - # If not defined on the pod, assume this - dnsPolicy: ClusterFirst - # If no restart Policy is defined, assume this - restartPolicy: Always - # If no restart Policy for job is defined, assume this - jobRestartPolicy: Never - # If no port Protocol is defined, assume this - portProtocol: TCP - # Define the minimum NodePort - minimumNodePort: 9000 - # If no service Type is defined, assume this - serviceType: ClusterIP - # If no PVC Size is defined, assume this - PVCSize: 1Gi - # If no VCT Size is defined, assume this - VCTSize: 999Gi - # If no PVC type is defined, assume this - persistenceType: pvc - # If no validateHostPath key exists in the persistence item, assume this - validateHostPath: false - # If no PVC accessMode is defined, assume this - accessMode: ReadWriteOnce - # If no PVC retain key is defined, assume this - # Note, that this adds an annotation for helm whether to delete - # the resource on uninstall, manually deleting the namespace it will delete - # the resource no matter what this is set. - PVCRetain: false - # Define a storageClassName that will be used for all PVCs by default - # Leave empty to rely on the node's default storageClass - storageClass: - # When SCALE-ZFS is set for storageClass, return this name - scaleZFSStorageClass: - # Default security context used for all - # init/install/upgrade/additional - # and main containers if not specified - securityContext: - runAsNonRoot: true - runAsUser: 568 - runAsGroup: 568 - readOnlyRootFilesystem: true - allowPrivilegeEscalation: false - privileged: false - capabilities: - add: [] - drop: - - ALL - # Default podSecurityContext, used if - # no other is specified - podSecurityContext: - fsGroup: 568 - supplementalGroups: [] - fsGroupChangePolicy: OnRootMismatch - # Default Security values, if no others - # are specified - security: - PUID: 568 - UMASK: "002" - # Whether to inject fixedEnvs on containers - # Can be overruled per container - injectFixedEnvs: true - # Default nvidia Caps will be assigned via - # environment variable (requires injectFixedEnvs) - nvidiaCaps: - - all - # Default Resources values, if no others - # are specified, use those - resources: - limits: - cpu: 4000m - memory: 8Gi - requests: - cpu: 10m - memory: 50Mi - # If no probe Type is defined, assume this - probeType: auto - # If no probe Path is defined, assume this - probePath: / - # Default probe timeouts, if no others - # are specified, use those - probes: - liveness: - spec: - initialDelaySeconds: 10 - periodSeconds: 10 - timeoutSeconds: 5 - failureThreshold: 5 - readiness: - spec: - initialDelaySeconds: 10 - periodSeconds: 10 - timeoutSeconds: 5 - failureThreshold: 5 - startup: - spec: - initialDelaySeconds: 10 - periodSeconds: 5 - timeoutSeconds: 2 - failureThreshold: 60 - # Default job/cronjob values - job: - cron: - concurrencyPolicy: Forbid - failedJobsHistoryLimit: 1 - successfulJobsHistoryLimit: 3 - backoffLimit: 6 - completionMode: NonIndexed - ``` - -- Helm Template: ❌ - -Can be defined in: - -- `.Values.global`.defaults - ---- - -Everything here is default values that common will use, -if nothing is provided from the Chart. - -Defaults are there to reduce amount of code needed on each Chart. -It also have default security configuration. Which by default, -aims to result in Chart with the least privileges. - -Changing the global defaults per Chart is something that should be avoided. -Every value in the defaults can be changed per Chart, out of the global context. diff --git a/.to_be_deleted/common/values/gpu.md b/.to_be_deleted/common/values/gpu.md deleted file mode 100644 index bec7e2ba6c..0000000000 --- a/.to_be_deleted/common/values/gpu.md +++ /dev/null @@ -1,48 +0,0 @@ -# GPU - -## key: scaleGPU - -Info: - -- Type: `dict` -- Default: `{}` -- Helm Template: ❌ - -Can be defined in: - -- `.Values`.scaleGPU -- `.Values.additionalContainers.[container-name]`.scaleGPU -- `.Values.initContainers.[container-name]`.scaleGPU -- `.Values.installContainers.[container-name]`.scaleGPU -- `.Values.upgradeContainers.[container-name]`.scaleGPU -- `.Values.systemContainers.[container-name]`.scaleGPU -- `.Values.jobs.[job-name].podSpec.containers.[container-name].[container-name]`.scaleGPU - ---- - -It's used in SCALE GUI. Configuration is parsed by the Chart, -and each key/value pair, is added in the Pod's `spec.template.container.resources.limits`. - -> If a GPU is passed through, it will automatically append the group `44` in `supplementalGroups`. - -Example: - -```yaml -scaleGPU: - gpu.intel.com/i915: "1" - -resources: - limits: - cpu: 4000m -``` - -Will result in: - -```yaml -resources: - limits: - gpu.intel.com/i915: "1" - cpu: 4000m -``` - -`gpu.intel.com/i915` and it's value, are generated from the SCALE GUI and middleware. diff --git a/.to_be_deleted/common/values/hostNetwork.md b/.to_be_deleted/common/values/hostNetwork.md deleted file mode 100644 index c7feed16e9..0000000000 --- a/.to_be_deleted/common/values/hostNetwork.md +++ /dev/null @@ -1,28 +0,0 @@ -# Host Network - -## key: hostNetwork - -Info: - -- Type: `boolean` -- Default: `false` -- Helm Template: ❌ - -Can be defined in: - -- `.Values`.hostNetwork -- `.Values.jobs.[job-name].podSpec`.hostNetwork -- - ---- - -Binds container to the host's network stack - -> All services will be forced to `ClusterIP` when `hostNetwork` is enabled, -> to avoid port conflicts with services requesting the same ports as the container. - -Examples: - -```yaml -hostNetwork: true -``` diff --git a/.to_be_deleted/common/values/host_aliases.md b/.to_be_deleted/common/values/host_aliases.md deleted file mode 100644 index 656a8fe63d..0000000000 --- a/.to_be_deleted/common/values/host_aliases.md +++ /dev/null @@ -1,34 +0,0 @@ -# Host Aliases - -## key: hostAliases - -Info: - -- Type: `list` -- Default: `[]` -- Helm Template: ✅ - -Can be defined in: - -- `.Values`.hostAliases - ---- - -Adds entries to a Pod's `/etc/hosts` file. - -Examples: - -```yaml -hostAliases: - - ip: 10.10.10.100 - hostnames: - - server1.local - - server-nickname.local - - ip: 127.0.0.1 - hostnames: - - example.com -``` - -Kubernetes Documentation: - -- [Host Aliases](https://kubernetes.io/docs/tasks/network/customize-hosts-file-for-pods) diff --git a/.to_be_deleted/common/values/hostname.md b/.to_be_deleted/common/values/hostname.md deleted file mode 100644 index 33f3e06534..0000000000 --- a/.to_be_deleted/common/values/hostname.md +++ /dev/null @@ -1,30 +0,0 @@ -# Hostname - -## key: hostname - -Info: - -- Type: `string` -- Default: `""` -- Helm Template: ✅ - -Can be defined in: - -- `.Values`.hostname - ---- - -Specifies pod's hostname -If left unspecified, Kubernetes will use the Deployment's name. - -Examples: - -```yaml -hostname: some_hostname - -hostname: "{{ .Values.path.to.key }}" -``` - -Kubernetes Documentation: - -- [Hostname](https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-s-hostname-and-subdomain-fields) diff --git a/.to_be_deleted/common/values/image.md b/.to_be_deleted/common/values/image.md deleted file mode 100644 index 5582295a11..0000000000 --- a/.to_be_deleted/common/values/image.md +++ /dev/null @@ -1,110 +0,0 @@ -# Image - -## Key: image - -Info: - -- Type: `dict` -- Default: - - ```yaml - image: - repository: repo - tag: tag - pullPolicy: IfNotPresent - ``` - -- Helm Template: ❌ - -Can be defined in: - -- `.Values`.image - ---- - -Contains info regarding the container image and tag that will be used - -Example: - -```yaml -image: - repository: nginx - tag: 1.16 - pullPolicy: IfNotPresents -``` - -If you want define additional images use the following pattern `nameImage`. -> This pattern is also what tools like `Renovate` look for. - -Example: - -```yaml -nameImage: - repository: some-repo - tag: some-tag - pullPolicy: IfNotPresents -``` - ---- ---- - -## Key: imageSelector - -Info: - -- Type: `string` -- Default: `""` -- Helm Template: ❌ - -Can be defined in: - -- `.Values`.imageSelector -- `.Values.additionalContainers.[container-name]`.imageSelector -- `.Values.initContainers.[container-name]`.imageSelector -- `.Values.installContainers.[container-name]`.imageSelector -- `.Values.upgradeContainers.[container-name]`.imageSelector -- `.Values.systemContainers.[container-name]`.imageSelector -- `.Values.jobs.[job-name].podSpec.containers.[container-name].[container-name]`.imageSelector - ---- - -If left empty, it will fail back to `image`. - -Used for apps/charts that have multiple image variations. -Example, an app that has different image for CPU and GPU workloads. - -This key should contain an name of a `dict` constructed similar to `image`. - -In the below example the gpu image will be used when `imageSelector` is defined, -otherwise it will default to the `image`, which is the cpu image. -Example: - -```yaml -image: - repository: app/repository - tag: cpu-v1 - pullPolicy: IfNotPresents - -gpuImage: - repository: app/repository - tag: gpu-v1 - pullPolicy: IfNotPresents - -imageSelector: gpuImage -``` - -Additionally you should use the imageSelector (only) when defining -additional/init/install/upgrade/system/job containers. - -Example: - -```yaml -additionalContainers: - worker: - imageSelector: workerImage -``` - -Kubernetes Documentation: - -- [Images](https://kubernetes.io/docs/concepts/containers/images) -- [Pull Policy](https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy) diff --git a/.to_be_deleted/common/values/imagePullSecrets.md b/.to_be_deleted/common/values/imagePullSecrets.md deleted file mode 100644 index c278de4201..0000000000 --- a/.to_be_deleted/common/values/imagePullSecrets.md +++ /dev/null @@ -1,35 +0,0 @@ -# Image Pull Secrets - -## key: imagePullCredentials - -Info: - -- Type: `list` -- Default: `[]` -- Helm Template: ❌ - -Can be defined in: - -- `.Values`.imagePullCredentials - ---- - -Every entry here will create a secret of type `kubernetes.io/dockerconfigjson` - -And then it will inject it's name at `spec.template.spec.imagePullSecret` -in the Pod of Deployment/StatefulSet/DaemonSet/CronJob/Job - -All fields are **required**. - -Examples: - -```yaml -imagePullCredentials: - - name: myPrivRegistry - enabled: true - contents: - registry: quay.io - username: someone - password: password - email: someone@host.com -``` diff --git a/.to_be_deleted/common/values/jobs-cronjobs.md b/.to_be_deleted/common/values/jobs-cronjobs.md deleted file mode 100644 index 50aa9fadb7..0000000000 --- a/.to_be_deleted/common/values/jobs-cronjobs.md +++ /dev/null @@ -1,97 +0,0 @@ -# Jobs - CronJobs - -## Key: jobs - -Info: - -- Type: `dict` -- Default `{}` -- Helm Template: ✅|❌ - - Supports almost every key the main container supports, - except probes and lifecycle hooks. - -Can be defined in: - -- `.Values`.jobs - ---- - -For each (cron)job under `jobs` it will spin up a Job or CronJob. - -> Under `container.[container-name]` you can use all keys that you would use -> in a normal container. Except `probes` and `lifecycle` hooks. - -Examples: - -```yaml -jobs: - job-name: - enabled: true - labels: {} - annotations: {} - backoffLimit: 1 - ttlSecondsAfterFinished: 100 - completionMode: NonIndexed - activeDeadLineSeconds: 120 - parallelism: 2 - completions: 1 - podSpec: - podSecurityContext: - fsGroup: 1000 - containers: - main: - imageSelector: imageDict - env: - var: blabla - cron-job-name: - enabled: true - labels: {} - annotations: {} - # All job options still go here - cron: - enabled: true - schedule: "* * * * *" - timezone: UTC - failedJobsHistoryLimit: 2 - successfulJobsHistoryLimit: 3 - startingDeadlineSeconds: 5 - podSpec: - podSecurityContext: - fsGroup: 1000 - containers: - main: - imageSelector: imageDict - env: - var: blabla -``` - ---- ---- - -## Stand alone Jobs - Cron Jobs - -We can also define jobs and cronjobs that are standalone. -No "main" pod required. - -`podSpec` now goes into `.Values` - -Examples: - -```yaml -controller: - type: Job - labels: {} - annotations: {} - backoffLimit: 1 - ttlSecondsAfterFinished: 100 - completionMode: NonIndexed - activeDeadLineSeconds: 120 - parallelism: 2 - completions: 1 - -podSecurityContext: - fsGroup: 1000 - -env: - var: blabla -``` diff --git a/.to_be_deleted/common/values/labels.md b/.to_be_deleted/common/values/labels.md deleted file mode 100644 index 728d9e6541..0000000000 --- a/.to_be_deleted/common/values/labels.md +++ /dev/null @@ -1,94 +0,0 @@ -# Labels - -Labels can be defined in nearly all resources. - -## Key: podLabels - -Info: - -- Type: `dict` -- Default: `{}` -- Helm Template: - - Key: ❌ - - Value: ✅ - -Can be defined in: - -- `.Values`.podLabels - ---- - -Adds the defined labels to the Pod - -Examples: - -```yaml -podLabels: - key: value - key: "{{ .Values.some.path }}" -``` - ---- ---- - -## Key: controller.labels - -Info: - -- Type: `dict` -- Default: `{}` -- Helm Template: - - Key: ❌ - - Value: ✅ - -Can be defined in: - -- `.Values.controller.`labels - ---- - -Adds the defined labels to the controller -(eg Deployment, StatefulSet, DaemonSet, Job, CronJob) - -Examples: - -```yaml -controller: - labels: - key: value - key: "{{ .Values.some.path }}" -``` - ---- ---- - -## Key: global.labels - -Info: - -- Type: `dict` -- Default: `{}` -- Helm Template: - - Key: ❌ - - Value: ✅ - -Can be defined in: - -- `.Values.global.`labels - ---- - -Adds the defined labels to all the resources - -Examples: - -```yaml -global: - labels: - key: value - key: "{{ .Values.some.path }}" -``` - -Kubernetes Documentation: - -- [Labels](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) diff --git a/.to_be_deleted/common/values/lifecycle.md b/.to_be_deleted/common/values/lifecycle.md deleted file mode 100644 index 4ea912751b..0000000000 --- a/.to_be_deleted/common/values/lifecycle.md +++ /dev/null @@ -1,88 +0,0 @@ -# Lifecycle - -| Key | Type | Helm Template | Default | Description | -| :-------------------------- | :---------: | :-----------: | :-----: | :------------------------------- | -| lifecycle | object | Yes | `{}` | [lifecycle](#lifecycle) | -| lifecycle.preStop | object | Yes | `{}` | [preStop](#prestop) | -| lifecycle.preStop.command | list/string | Yes | `[]` | [command](commands-args#command) | -| lifecycle.postStart | object | Yes | `{}` | [postStart](#poststart) | -| lifecycle.postStart.command | list/string | Yes | `[]` | [command](commands-args#command) | - -## lifecycle - -Specify hooks that will run on the container. Like `preStop` or `postStart` - ---- - -Can be defined in: - -- `.Values`.lifecycle -- `.Values.additionalContainers.[container-name]`.lifecycle - ---- - -### preStop - -Examples `preStop`: - -```yaml -# String / Single command -lifecycle: - preStop: - command: ./custom-script.sh -# String / Single command (tpl) -lifecycle: - preStop: - command: "{{ .Values.customCommand }}" - -# List -lifecycle: - preStop: - command: - - /bin/sh - - -c - - | - echo "Doing things..." -# List (tpl) -lifecycle: - preStop: - command: - - /path/to/executable - - --port - - "{{ .Values.service.main.ports.main.port }}" -``` - -### postStart - -Examples `postStart`: - -```yaml -# String / Single command -lifecycle: - postStart: - command: ./custom-script.sh -# String / Single command (tpl) -lifecycle: - postStart: - command: "{{ .Values.customCommand }}" - -# List -lifecycle: - postStart: - command: - - /bin/sh - - -c - - | - echo "Doing things..." -# List (tpl) -lifecycle: - postStart: - command: - - /path/to/executable - - --port - - "{{ .Values.service.main.ports.main.port }}" -``` - -Kubernetes Documentation: - -- [Lifecycle Hooks](https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks) diff --git a/.to_be_deleted/common/values/names.md b/.to_be_deleted/common/values/names.md deleted file mode 100644 index 051f351ec5..0000000000 --- a/.to_be_deleted/common/values/names.md +++ /dev/null @@ -1,50 +0,0 @@ -# Names - -## Key: nameOverride - -Info: - -- Type: `string` -- Default: `""` -- Helm Template: ❌ - -Can be defined in: - -- `.Values`.nameOverride - ---- - -Overrides the name of the workload. - -> This is not the full name, but a part of the full name -> This is something that will only needed in very rare scenarios. -> Should be avoided, unless is absolutely needed. - -Examples: - -```yaml -nameOverride: some_name -``` - ---- ---- - -## Key: fullnameOverride - -Info: - -- Type: `string` -- Default: `""` -- Helm Template: ❌ - -Can be defined in: - -- `.Values`.fullnameOverride - ---- - -Overrides the name of the workload. - -> This affects the full name of the Deployment/StatefulSet/etc -> This is something that will only needed in very rare scenarios. -> Should be avoided, unless is absolutely needed. diff --git a/.to_be_deleted/common/values/nodeSelector.md b/.to_be_deleted/common/values/nodeSelector.md deleted file mode 100644 index c45475c329..0000000000 --- a/.to_be_deleted/common/values/nodeSelector.md +++ /dev/null @@ -1,33 +0,0 @@ -# Node Selector - -## Key: nodeSelector - -Info: - -- Type: `dict` -- Default: `{}` -- Helm Template: - - key: ❌ - - value: ✅ - -Can be defined in: - -- `.Values`.nodeSelector -- `.Values.jobs.[job-name].podSpec`.nodeSelector - ---- - -Defines the nodeSelector(s) that will be used. -Node selector is used to select in which node a workload will be deployed. - -Examples: - -```yaml -nodeSelector: - disktype: ssd - cpu-type: "{{ .Values.some.path }}" -``` - -Kubernetes Documentation: - -- [Node Selector](https://kubernetes.io/docs/tasks/configure-pod-container/assign-pods-nodes/) diff --git a/.to_be_deleted/common/values/persistence.md b/.to_be_deleted/common/values/persistence.md deleted file mode 100644 index 52b65d67b0..0000000000 --- a/.to_be_deleted/common/values/persistence.md +++ /dev/null @@ -1,146 +0,0 @@ -# Persistence - -## Key: persistence - -Info: - -- Type: `dict` -- Default: - - ```yaml - shared: - enabled: true - type: emptyDir - mountPath: /shared - - varlogs: - enabled: true - type: emptyDir - mountPath: /var/logs - - tmp: - enabled: true - type: emptyDir - mountPath: /tmp - ``` - -- Helm Template: ❌ - -Can be defined in: - -- `.Values`.persistence - ---- - -Examples: - -```yaml -persistence: - # emptyDir - emptyDir-vol: - enabled: true - mountPath: /some/container/path - # Optional: When set, it won't automatically - # mount the volume to the main container. - # Useful if the volume is supposed to be mounted on - # another container only, default false - noMount: true - # Optional - mountPropagation: HostToContainer - # Optional - readOnly: false - # Optional, useful for secret and configmap volumes - subPath: subpath - # Above keys apply to all types - type: emptyDir - # Optional: Defaults to Memory - medium: Memory - # Optional: Only applies if set - sizeLimit: 1G - - nfs-vol: - enabled: true - mountPath: /some/container/path - type: nfs - server: 192.168.1.100 - path: /path/to/nfs/share - - hotsPath-vol: - enabled: true - mountPath: /some/container/path - type: hostPath - hostPath: /path/to/host - # Optional - hostPathType: DirectoryOrCreate - # Optional, defaults to .Values.global.defaults.validateHostPath - # It can be overwritten per volume too - validateHostPath: false - - ixVolume-vol: - enabled: true - mountPath: /some/container/path - type: ixVolume - datasetName: populated-from-refs - # Optional - hostPathType: DirectoryOrCreate - - configmap-vol: - enabled: true - mountPath: /some/container/path - type: configmap - # Optional: Must be a string with 4 digits - # If passed as integer, it will result in a different value - # Because of how k8s does the conversion to octal - defaultMode: "0600" - items: - - key: key-from-the-configmap - path: path-in-the-container (usually the filename) - - secret-vol: - enabled: true - mountPath: /some/container/path - type: secret - # Optional: Must be a string with 4 digits - # If passed as integer, it will result in a different value - # Because of how k8s does the conversion to octal - defaultMode: "0600" - items: - - key: key-from-the-secret - path: path-in-the-container (usually the filename) - - pvc-vol: - enabled: true - mountPath: /some/container/path - type: pvc - # PVC Size - size: 1Gi - # Optional: Defaults to .Values.global.defaults.accessMode - defaultAccessMode: ReadWriteOnce - # Optional: Defaults to .Values.global.defaults.PVCRetain - retain: true -``` - -## Key: volumeClaimTemplate - -Info: - -- Type: `dict` -- Default: `{}` -- Helm Template: ❌ - -Can be defined in: - -- `.Values`.volumeClaimTemplate - ---- - -Examples: - -```yaml -# Only applies on StatefulSets -volumeClaimTemplates: - data: - mountPath: /data - accessMode: "ReadWriteOnce" - size: 1Gi -``` diff --git a/.to_be_deleted/common/values/portal.md b/.to_be_deleted/common/values/portal.md deleted file mode 100644 index 6cce2e74bb..0000000000 --- a/.to_be_deleted/common/values/portal.md +++ /dev/null @@ -1,96 +0,0 @@ -# Portal - -## key: portal - -Info: - -- Type: `dict` -- Default: - - ```yaml - portal: - enabled: true - ``` - -- Helm Template: ✅ (Except on the `enabled` key) - -Can be defined in: - -- `.Values`.portal - ---- - -Enables configMap generation for portal. You can also apply overrides for each setting. -(`port`, `host`, `path`, `protocol`), instead of the automatic generation. -Apart from `path` the rest should not be need to be overridden. - -For each service/port combo there is an entry in the configMap. - -Assume a service like this - -```yaml -service: - srvName: - enabled: true - ports: - portName: - port: 10000 - protocol: HTTP -``` - -ConfigMap will look like this: - -```yaml -data: - host-srvName-portName: $node_ip - port-srvName-portName: 10000 - path-srvName-portName: / - protocol-srvName-portName: http -``` - -If you wanted to change the path, you would do: - -```yaml -portal: - srvName: - portName: - path: /different_path -``` - -In questions.yaml, you would use it like that: - -```yaml -portals: - open: - protocols: - - "$kubernetes-resource_configmap_portal_protocol-srvName-portName" - host: - - "$kubernetes-resource_configmap_portal_host-srvName-portName" - ports: - - "$kubernetes-resource_configmap_portal_port-srvName-portName" - path: - - "$kubernetes-resource_configmap_portal_path-srvName-portName" -``` - -Available options on `portal`: - -```yaml -portal: - srvName: - portName: - host: 10.10.10.100 # or truenas.localdomain - port: 10000 - path: /somepath - protocol: https - otherPortName: - host: 10.10.10.100 # or truenas.localdomain - port: 10002 - path: /somepath - protocol: https - otherSrvName: - otherPortName: - host: 10.10.10.100 # or truenas.localdomain - port: 10001 - path: /somepath - protocol: http -``` diff --git a/.to_be_deleted/common/values/priorityClassName.md b/.to_be_deleted/common/values/priorityClassName.md deleted file mode 100644 index b97ab5cbcb..0000000000 --- a/.to_be_deleted/common/values/priorityClassName.md +++ /dev/null @@ -1,30 +0,0 @@ -# Priority Class Name - -## Key: priorityClassName - -Info: - -- Type: `string` -- Default: `""` -- Helm Template: ❌ - -Can be defined in: - -- `.Values`.priorityClassName -- `.Values.jobs.[job-name].podSpec`.priorityClassName - ---- - -Defines the `priorityClassName` for the workloads. - -Leaving it empty it will let Kubernetes resolve the `priorityClassName`. - -Examples: - -```yaml -priorityClassName: some-priority-class-name -``` - -Kubernetes Documentation: - -- [Priority Class](https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/) diff --git a/.to_be_deleted/common/values/probes.md b/.to_be_deleted/common/values/probes.md deleted file mode 100644 index a6d74f9a68..0000000000 --- a/.to_be_deleted/common/values/probes.md +++ /dev/null @@ -1,176 +0,0 @@ -# Probes - -| Key | Type | Helm Template | Default | Description | -| :-------------------------- | :-----: | :-----------: | :-------: | :--------------------------------------------- | -| probes | object | Yes | See below | [probes](#probes) | -| probes.[probe-name] | object | Yes | See below | Allowed values: readiness / liveness / startup | -| probes.[probe-name].enabled | boolean | Yes | `true` | Enables or Disables the probe | -| probes.[probe-name].type | string | Yes | `auto` | [types](#types) | -| probes.[probe-name].spec | object | Yes | See below | Contains timeout values | - -Default probes: - -```yaml -probes: - liveness: - enabled: true - type: auto - spec: - initialDelaySeconds: 10 - failureThreshold: 5 - timeoutSeconds: 5 - periodSeconds: 10 - readiness: - enabled: true - type: auto - spec: - initialDelaySeconds: 10 - failureThreshold: 5 - timeoutSeconds: 5 - periodSeconds: 10 - startup: - enabled: true - type: auto - spec: - initialDelaySeconds: 10 - failureThreshold: 60 - timeoutSeconds: 2 - periodSeconds: 5 -``` - -> `auto` type is only available for the main container. - -## probes - -Can be defined in: - -- `.Values`.probes -- `.Values.additionalContainers.[container-name]`.probes - -### spec - -| Key | Type | Helm Template | Default | Description | -| :---------------------------------------- | :--: | :-----------: | :-----: | :---------- | -| probes.liveness.spec.initialDelaySeconds | int | Yes | 10 | | -| probes.liveness.spec.failureThreshold | int | Yes | 5 | | -| probes.liveness.spec.timeoutSeconds | int | Yes | 5 | | -| probes.liveness.spec.periodSeconds | int | Yes | 10 | | -| probes.readiness.spec.initialDelaySeconds | int | Yes | 10 | | -| probes.startup.spec.initialDelaySeconds | int | Yes | 10 | | -| probes.startup.spec.failureThreshold | int | Yes | 60 | | -| probes.startup.spec.timeoutSeconds | int | Yes | 2 | | -| probes.startup.spec.periodSeconds | int | Yes | 5 | | -| probes.readiness.spec.failureThreshold | int | Yes | 5 | | -| probes.readiness.spec.timeoutSeconds | int | Yes | 5 | | -| probes.readiness.spec.periodSeconds | int | Yes | 10 | | - -`spec` contains the timeouts for the probe. -If not defined it will use the defaults from `.Values.global.defaults.probes.[probe-name].spec`. - -## Types - -Allowed values: auto / http / https / tcp / grpc / exec / custom - -### http / https - -| Key | Type | Helm Template | Default | Description | -| :------------------------------ | :----: | :-----------: | :-----: | :--------------------------- | -| probes.[probe-name].port | int | Yes | unset | Sets the probe's port | -| probes.[probe-name].path | string | Yes | `/` | Sets the probe's path | -| probes.[probe-name].httpHeaders | object | Yes | `{}` | Sets the probe's httpHeaders | - -> If type is set to `auto`, `port` defaults the the primary service's targetPort, -> if not `targetPort` is defined, fail-backs to `port` -> scheme is set based on the `type` (http / https) - -Example: - -```yaml -probes: - probe-name: - enabled: true - type: http - path: "/" - port: 80 - httpHeaders: {} - spec: - initialDelaySeconds: 10 - periodSeconds: 10 - timeoutSeconds: 5 - failureThreshold: 5 -``` - ---- - -### tcp - -| Key | Type | Helm Template | Default | Description | -| :----------------------- | :--: | :-----------: | :-----: | :-------------------- | -| probes.[probe-name].port | int | Yes | unset | Sets the probe's port | - -> If type is set to `auto`, `port` defaults the the primary service's targetPort, -> if not `targetPort` is defined, fail-backs to `port` - -Example: - -```yaml -probes: - probe-name: - enabled: true - type: tcp - port: 80 - spec: - initialDelaySeconds: 10 - periodSeconds: 10 - timeoutSeconds: 5 - failureThreshold: 5 -``` - -### grpc - -| Key | Type | Helm Template | Default | Description | -| :----------------------- | :--: | :-----------: | :-----: | :-------------------- | -| probes.[probe-name].grpc | int | Yes | unset | Sets the probe's port | - -> If type is set to `auto`, `port` defaults the the primary service's targetPort, -> if not `targetPort` is defined, fail-backs to `port` - -Example: - -```yaml -probes: - probe-name: - enabled: true - type: grpc - port: 80 - spec: - initialDelaySeconds: 10 - periodSeconds: 10 - timeoutSeconds: 5 - failureThreshold: 5 -``` - -### exec - -| Key | Type | Helm Template | Default | Description | -| :-------------------------- | :---------: | :-----------: | :-----: | :--------------------------------- | -| probes.[probe-name].command | list/string | Yes | `{}` | [command](command-args.md#command) | - -Example: - -```yaml -probes: - probe-name: - enabled: true - type: exec - command: - - /bin/sh - - -c - - | - curl ... - spec: - initialDelaySeconds: 10 - periodSeconds: 10 - timeoutSeconds: 5 - failureThreshold: 5 -``` diff --git a/.to_be_deleted/common/values/rbac.md b/.to_be_deleted/common/values/rbac.md deleted file mode 100644 index 9e61eb253c..0000000000 --- a/.to_be_deleted/common/values/rbac.md +++ /dev/null @@ -1,87 +0,0 @@ -# RBAC - -## Key: rbac - -Info: - -- Type: `dict` -- Default: - - ```yaml - rbac: - main: - enabled: false - primary: true - clusterWide: false - ``` - -- Helm Template: - - rbac.NAME.labels - keys ❌ - - rbac.NAME.labels - values ✅ - - rbac.NAME.annotations - keys ❌ - - rbac.NAME.annotations - values ✅ - - rbac.NAME.rules[].apiGroups - entries ✅ - - rbac.NAME.rules[].resources - entries ✅ - - rbac.NAME.rules[].verbs - entries ✅ - - rbac.NAME.subjects[].kind ✅ - - rbac.NAME.subjects[].name ✅ - - rbac.NAME.subjects[].apiGroup ✅ - -Can be defined in: - -- `.Values`.rbac - ---- - -For every `rbac.[NAME]` that is enabled it will create a `Role` and a `RoleBinding` -or a `ClusterRole` and a `ClusterRoleBinding` if `clusterWide` flag is set. - -You can define the rules under the `rules` key, the same way -you would do in a normal kubernetes object. -Rules will be pass to the `Role` or `ClusterRole` object. - -You can define the subjects under the `subjects` key, the same way -you would do in a normal kubernetes object. -Subjects will be pass to the `RoleBinding` or `ClusterRoleBinding` object. - -`subjects` key is optional - -The following subject is always assigned - -```yaml -- kind: ServiceAccount - name: {{ $saName }} - namespace: {{ .Release.Namespace }} -``` - -`$saName` is calculated based on the `primary` serviceAccount - -Examples: - -```yaml -rbac: - main: - enabled: true - clusterWide: true - labels: - key: value - annotations: - key: value - rules: - - apiGroups: - - "" - resources: - - services - - pods - verbs: - - get - - list - subjects: - - kind: something - name: something - apiGroup: something -``` - -Kubernetes Documentation: - -- [RBAC](https://kubernetes.io/docs/reference/access-authn-authz/rbac) diff --git a/.to_be_deleted/common/values/resources.md b/.to_be_deleted/common/values/resources.md deleted file mode 100644 index 79a4a83592..0000000000 --- a/.to_be_deleted/common/values/resources.md +++ /dev/null @@ -1,73 +0,0 @@ -# Resources - -## Key: resources - -Info: - -- Type: `dict` -- Default: - - ```yaml - resources: - limits: - cpu: 4000m - memory: 8Gi - requests: - cpu: 10m - memory: 50Mi - ``` - -- Helm Template: ❌ - -Can be defined in: - -- `.Values`.resources -- `.Values.additionalContainers.[container-name]`.resources -- `.Values.initContainers.[container-name]`.resources -- `.Values.installContainers.[container-name]`.resources -- `.Values.upgradeContainers.[container-name]`.resources -- `.Values.systemContainers.[container-name]`.resources -- `.Values.jobs.[job-name].podSpec.containers.[container-name].[container-name]`.resources - ---- - -> When no resources are defined on a Chart, library will use the `.Values.global.defaults.resources` - -`requests` is used by the scheduler to decide if the node has enough -resources for the pod. Can be useful when multi node clusters are used. -Currently set to a very low value, so a pod can always be scheduled on -the single node. - -`limits` is used to actually limit resources to a container. By default -is set to 4 cpu and 8GiB RAM. - -You can define only what you want to change, and the rest will be pulled from defaults. - -> Note: `requests` cannot be empty. - -Examples: - -```yaml -resources: - limits: - cpu: 8000m - memory: 16Gi - requests: - cpu: 10m - memory: 50Mi - -# The bellow will only alter the limits.cpu. -# Rest will be pulled from global defaults -resources: - limits: - cpu: 2000m - -# If you want to remove a limit -resources: - limits: - cpu: "" -``` - -Kubernetes Documentation: - -- [Resources](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers) diff --git a/.to_be_deleted/common/values/restartPolicy.md b/.to_be_deleted/common/values/restartPolicy.md deleted file mode 100644 index 611e72f0b1..0000000000 --- a/.to_be_deleted/common/values/restartPolicy.md +++ /dev/null @@ -1,38 +0,0 @@ -# Restart Policy - -## key: restartPolicy - -Info: - -- Type: `string` -- Default: `Always` -- Default((Cron)Job): `Never` -- Helm Template: ❌ - -Can be defined in: - -- `.Values`.restartPolicy - ---- - -Sets the container's restart policy. - -Keys and sub keys: - -```yaml -# Optional -restartPolicy: -``` - -`Deployment`, `StatefulSet`, `ReplicaSet` and `DaemonSet` only allows `Always` -`Job` and `CronJob` don't have that restriction. - -Examples: - -```yaml -restartPolicy: OnFailure - -restartPolicy: Never - -restartPolicy: Always -``` diff --git a/.to_be_deleted/common/values/runtimeClassName.md b/.to_be_deleted/common/values/runtimeClassName.md deleted file mode 100644 index 18fdd477dc..0000000000 --- a/.to_be_deleted/common/values/runtimeClassName.md +++ /dev/null @@ -1,40 +0,0 @@ -# Runtime Class Name - -## Key: runtimeClassName - -Info: - -- Type: `string` -- Default: `""` -- Helm Template: ❌ - -Can be defined in: - -- `.Values`.runtimeClassName -- `.Values.jobs.[job-name].podSpec`.runtimeClassName - ---- - -Defines the `runtimeClassName` for the workloads. - -Leaving it empty it will let Kubernetes resolve the `runtimeClassName`. -> On TrueNAS Scale, it will dynamically pick the `runtimeClassName` -> based on metadata provided by the middleware. - -You can also set a global default `runtimeClassName` in `.Values.global.defaults.runtimeClassName` - -Priority of usage (Highest to Lowest): - -- Dynamic Class Name provided from Scale Metadata -- Per pod definition -- Global definition - -Examples: - -```yaml -runtimeClassName: some-class-name -``` - -Kubernetes Documentation: - -- [Runtime Class](https://kubernetes.io/docs/concepts/containers/runtime-class/#usage) diff --git a/.to_be_deleted/common/values/scheduler.md b/.to_be_deleted/common/values/scheduler.md deleted file mode 100644 index 35babd5492..0000000000 --- a/.to_be_deleted/common/values/scheduler.md +++ /dev/null @@ -1,30 +0,0 @@ -# Scheduler - -## Key: schedulerName - -Info: - -- Type: `string` -- Default: `""` -- Helm Template: ✅ - -Can be defined in: - -- `.Values`.schedulerName -- `.Values.jobs.[job-name].podSpec`.schedulerName - ---- - -Defines the scheduler that will be used. -Leaving it empty, Kubernetes will assign the `default-scheduler` - -Examples: - -```yaml -schedulerName: some-scheduler -# schedulerName: "{{ .Values.some.path }}" -``` - -Kubernetes Documentation: - -- [Scheduler](https://kubernetes.io/docs/tasks/extend-kubernetes/configure-multiple-schedulers/#specify-schedulers-for-pods) diff --git a/.to_be_deleted/common/values/secret.md b/.to_be_deleted/common/values/secret.md deleted file mode 100644 index de87d0876b..0000000000 --- a/.to_be_deleted/common/values/secret.md +++ /dev/null @@ -1,48 +0,0 @@ -# Secret - -| Key | Type | Helm Template | Default | Description | -| :-------------------------------------- | :-----: | :-----------: | :-----: | :--------------------------------------------------------------------- | -| secret | object | Yes | `{}` | [secret](#secret) | -| secret.[secret-name] | object | Yes | `{}` | [secret](#secret) | -| secret.[secret-name].enabled | boolean | Yes | unset | Enables or Disables the secret | -| secret.[secret-name].labels | object | Yes | `{}` | Specify labels for the secret | -| secret.[secret-name].annotations | object | Yes | `{}` | Specify annotations for the secret | -| secret.[secret-name].nameOverride | string | Yes | `""` | Specify a name override for the secret | -| secret.[secret-name].parseAsEnv | boolean | Yes | unset | Specify if the `content` should be parsed as envs (for the Dupe Check) | -| secret.[secret-name].content | object | Yes | `{}` | Specify the content of the secret | -| secret.[secret-name].content.[key-name] | string | Yes | `""` | Specify the value of the key. String and Scalar is supported | - -## secret - -Creates a secret based on the `content` - -> When parseAsEnv is checked, content will be checked against `env`, `envList`, `fixedEnvs` and -> other configmaps / secrets for duplicate envs. This can be useful to prevent overriding other envs -> either by mistake or user not knowing that the env is already set by the app developer - ---- - -Can be defined in: - -- `.Values`.secret - ---- - -Examples: - -```yaml -secret: - somename: - enabled: true - content: - somekey: value - otherkey: othervalue - -secret: - somename: - enabled: true - content: - somekey: value - nginx.conf: | - listen {{ .Values.service.main.ports.main.port }} -``` diff --git a/.to_be_deleted/common/values/security.md b/.to_be_deleted/common/values/security.md deleted file mode 100644 index f928c22e45..0000000000 --- a/.to_be_deleted/common/values/security.md +++ /dev/null @@ -1,79 +0,0 @@ -# Security - -## Key: securityContext - -- Type: `dict` -- Default: - - ```yaml - securityContext: - runAsNonRoot: true - runAsUser: 568 - runAsGroup: 568 - readOnlyRootFilesystem: true - allowPrivilegeEscalation: false - privileged: false - capabilities: - add: [] - drop: - - ALL - ``` - -- Helm Template: ❌ - -Can be defined in: - -- `.Values`.securityContext -- `.Values.additionalContainers.[container-name]`.securityContext -- `.Values.systemContainers.[container-name]`.securityContext -- `.Values.initContainers.[container-name]`.securityContext -- `.Values.installContainers.[container-name]`.securityContext -- `.Values.upgradeContainers.[container-name]`.securityContext -- `.Values.jobs.[job-name].podSpec.containers.[container-name]`.securityContext - ---- - -By default it runs as the least privileged user. A chart developer have to \ -explicitly change the user and/or privileges, capabilities, etc. - -Examples: - -```yaml -# This will only alter the defined keys, rest keys will come from the default. -securityContext: - runAsNonRoot: false - runAsUser: 0 - runAsGroup: 0 - readOnlyRootFilesystem: false -``` - -## Key: podSecurityContext - -- Type: `dict` -- Default: - - ```yaml - podSecurityContext: - fsGroup: 568 - supplementalGroups: [] - fsGroupChangePolicy: OnRootMismatch - ``` - -- Helm Template: ❌ - -Can be defined in: - -- `.Values`.podSecurityContext -- `.Values.jobs.[job-name].podSpec`.podSecurityContext - ---- - -This applies on the whole pod (k8s does not offer a way to apply those per container.) - -Examples: - -```yaml -# This will only alter the defined keys, rest keys will come from the default. -podSecurityContext: - fsGroup: 33 -``` diff --git a/.to_be_deleted/common/values/serviceAccount.md b/.to_be_deleted/common/values/serviceAccount.md deleted file mode 100644 index dbe1b7f6f7..0000000000 --- a/.to_be_deleted/common/values/serviceAccount.md +++ /dev/null @@ -1,48 +0,0 @@ -# Service Account - -## Key: serviceAccount - -Info: - -- Type: `dict` -- Default: - - ```yaml - serviceAccount: - main: - enabled: false - primary: true - automountServiceAccountToken: true - ``` - -- Helm Template: ❌ - -Can be defined in: - -- `.Values`.serviceAccount - ---- - -For every `serviceAccount.[NAME]` that is enabled it will -create a `ServiceAccount` object. - -`primary` flag is used to decide what `serviceAccountName` -will be assigned to the pod. Without a `ServiceAccount`, -the `serviceAccountName` will be `default` . - -Examples: - -```yaml -serviceAccount: - main: - enabled: true - primary: true - labels: - key: value - annotations: - key: value -``` - -Kubernetes Documentation: - -- [Service Account](https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account) diff --git a/.to_be_deleted/common/values/serviceLinks.md b/.to_be_deleted/common/values/serviceLinks.md deleted file mode 100644 index 8489394768..0000000000 --- a/.to_be_deleted/common/values/serviceLinks.md +++ /dev/null @@ -1,29 +0,0 @@ -# Service Links - -## Key: enableServiceLinks - -Info: - -- Type: `boolean` -- Default: `false` -- Helm Template: ❌ - -Can be defined in: - -- `.Values`.enableServiceLinks -- `.Values.jobs.[job-name].podSpec`.enableServiceLinks - ---- - -EnableServiceLinks indicates whether information about services should be -injected into pod's environment variables, matching the syntax of Docker links. - -We default it to false, otherwise kubernetes will inject envs for each -of the active services. Which can be a lot. -> Disabling this does NOT affect DNS usage. - -Examples: - -```yaml -enableServiceLinks: true -``` diff --git a/.to_be_deleted/common/values/stdin.md b/.to_be_deleted/common/values/stdin.md deleted file mode 100644 index 5b8a76eb98..0000000000 --- a/.to_be_deleted/common/values/stdin.md +++ /dev/null @@ -1,30 +0,0 @@ -# STDIN - -## key: stdin - -Info: - -- Type: `boolean` -- Default: `false` -- Helm Template: ❌ - -Can be defined in: - -- `.Values`.stdin -- `.Values.additionalContainers.[container-name]`.stdin -- `.Values.initContainers.[container-name]`.stdin -- `.Values.installContainers.[container-name]`.stdin -- `.Values.upgradeContainers.[container-name]`.stdin -- `.Values.systemContainers.[container-name]`.stdin -- `.Values.jobs.[job-name].podSpec.containers.[container-name].[container-name]`.stdin - ---- - -Allocates a buffer for stdin in the container runtime. - -Examples: - -```yaml -# Optional -stdin: true -``` diff --git a/.to_be_deleted/common/values/termination.md b/.to_be_deleted/common/values/termination.md deleted file mode 100644 index 156973eb83..0000000000 --- a/.to_be_deleted/common/values/termination.md +++ /dev/null @@ -1,50 +0,0 @@ -# Termination - -| Key | Type | Helm Template | Default | Description | -| :---------------------------- | :----: | :-----------: | :-----: | :------------------------------------------------------------------------------------------ | -| termination | object | Yes | `{}` | [termination](#termination) | -| termination.messagePath | string | Yes | `""` | Specify the message path for the termination | -| termination.messagePolicy | string | Yes | `""` | Specify the message policy for the termination. Allowed values: File, FallbackToLogsOnError | -| terminationGracePeriodSeconds | int | Yes | `10` | [terminationGracePeriodSeconds](#terminationgraceperiodseconds) | - ---- - -## termination - -Can be defined in: - -- `.Values`.termination.messagePath -- `.Values`.termination.messagePolicy -- `.Values.additionalContainers.[container-name]`.termination.messagePath -- `.Values.additionalContainers.[container-name]`.termination.messagePolicy -- `.Values.initContainers.[container-name]`.termination.messagePath -- `.Values.initContainers.[container-name]`.termination.messagePolicy -- `.Values.installContainers.[container-name]`.termination.messagePath -- `.Values.installContainers.[container-name]`.termination.messagePolicy -- `.Values.upgradeContainers.[container-name]`.termination.messagePath -- `.Values.upgradeContainers.[container-name]`.termination.messagePolicy -- `.Values.systemContainers.[container-name]`.termination.messagePath -- `.Values.systemContainers.[container-name]`.termination.messagePolicy -- `.Values.jobs.[job-name].podSpec.containers.[container-name].[container-name]`.termination.messagePath -- `.Values.jobs.[job-name].podSpec.containers.[container-name].[container-name]`.termination.messagePolicy - ---- - -Examples: - -```yaml -termination: - messagePath: "" - # messagePath: "{{ .Values.some.path }}" - messagePolicy: "" - # messagePolicy: "{{ .Values.some.policy }}" -``` - -## terminationGracePeriodSeconds - -Specify the termination grace period in seconds - -Can be defined in: - -- `.Values`.terminationGracePeriodSeconds -- `.Values.jobs.[job-name].podSpec`.terminationGracePeriodSeconds diff --git a/.to_be_deleted/common/values/tolerations.md b/.to_be_deleted/common/values/tolerations.md deleted file mode 100644 index 19c62d97ec..0000000000 --- a/.to_be_deleted/common/values/tolerations.md +++ /dev/null @@ -1,43 +0,0 @@ -# Toleration - -## Key: tolerations - -Info: - -- Type: `list` -- Default: `[]` -- Helm Template: - - tolerations.operator: ✅ - - tolerations.key: ✅ - - tolerations.effect: ✅ - - tolerations.value: ✅ - - tolerations.tolerationSeconds: ❌ - -Can be defined in: - -- `.Values`.tolerations -- `.Values.jobs.[job-name].podSpec`.tolerations - ---- - -Defines `tolerations` in Pod. -Allows pod to tolerate taints of a Node. - -Examples: - -```yaml -tolerations: - - operator: Equal # "{{ .Values.some.path }}" - # Required when operator is set to "Equal", otherwise Optional - key: some-key # "{{ .Values.some.path }}" - # Optional - effect: NoExecute # "{{ .Values.some.path }}" - # Dis-allowed when operator is set to "Exists", otherwise optional - value: some-value - # Optional - tolerationSeconds: 10 -``` - -Kubernetes Documentation: - -- [Tolerations](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/) diff --git a/.to_be_deleted/common/values/tty.md b/.to_be_deleted/common/values/tty.md deleted file mode 100644 index 1af8eaa13e..0000000000 --- a/.to_be_deleted/common/values/tty.md +++ /dev/null @@ -1,30 +0,0 @@ -# TTY - -## key: tty - -Info: - -- Type: `boolean` -- Default: `false` -- Helm Template: ❌ - -Can be defined in: - -- `.Values`.tty -- `.Values.additionalContainers.[container-name]`.tty -- `.Values.initContainers.[container-name]`.tty -- `.Values.installContainers.[container-name]`.tty -- `.Values.upgradeContainers.[container-name]`.tty -- `.Values.systemContainers.[container-name]`.tty -- `.Values.jobs.[job-name].podSpec.containers.[container-name].[container-name]`.tty - ---- - -Allocates a TTY, requires also `stdin` set to true - -Examples: - -```yaml -# Optional -tty: true -``` diff --git a/.to_be_deleted/common/values/xContainers.md b/.to_be_deleted/common/values/xContainers.md deleted file mode 100644 index 08877e4864..0000000000 --- a/.to_be_deleted/common/values/xContainers.md +++ /dev/null @@ -1,167 +0,0 @@ -# xContainers - -Order of container spawning: -`installContainers` -> `upgradeContainers` -> `systemContainers` -> `initContainers` - -## key: additionalContainers - -Info: - -- Type: `dict` -- Default: `{}` -- Helm Template: ✅|❌ - - Supports almost every key the main container supports, - except lifecycle hooks. - -Can be defined in: - -- `.Values`.additionalContainers - ---- - -Defines containers that will run alongside the "main' container. - -Examples: - -```yaml -additionalContainers: - container-name: - enabled: true - imageSelector: image # The name of the image dict to pull repo, tag, pullPolicy - env: - key: value -``` - ---- ---- - -## key: installContainers - -Info: - -- Type: `dict` -- Default: `{}` -- Helm Template: ✅|❌ - - Supports almost every key the main container supports, - except lifecycle hooks and probes - -Can be defined in: - -- `.Values`.installContainers - ---- - -Defines containers that will run only at the installation of a Chart, -before the main container. - -Examples: - -```yaml -installContainers: - container-name: - enabled: true - imageSelector: image # The name of the image dict to pull repo, tag, pullPolicy - env: - key: value -``` - ---- ---- - -## key: upgradeContainers - -Info: - -- Type: `dict` -- Default: `{}` -- Helm Template: ✅|❌ - - Supports almost every key the main container supports, - except lifecycle hooks and probes - -Can be defined in: - -- `.Values`.upgradeContainers - ---- - -Defines containers that will run only at the upgrade of a Chart, -before the main container. - -Examples: - -```yaml -upgradeContainers: - container-name: - enabled: true - imageSelector: image # The name of the image dict to pull repo, tag, pullPolicy - env: - key: value -``` - ---- ---- - -## key: systemContainers - -Info: - -- Type: `dict` -- Default: `{}` -- Helm Template: ✅|❌ - - Supports almost every key the main container supports, - except lifecycle hooks and probes - -Can be defined in: - -- `.Values`.systemContainers - ---- - -Defines containers that will run and exit on each Chart startup, -before the main container and before the initContainers. - -Usually used for common things like db-waits or maybe something -that will check files ownership. - -Examples: - -```yaml -systemContainers: - container-name: - enabled: true - imageSelector: image # The name of the image dict to pull repo, tag, pullPolicy - env: - key: value -``` - ---- ---- - -## key: initContainers - -Info: - -- Type: `dict` -- Default: `{}` -- Helm Template: ✅|❌ - - Supports almost every key the main container supports, - except lifecycle hooks and probes - -Can be defined in: - -- `.Values`.initContainers - ---- - -Defines containers that will run and exit on each Chart startup before the main container. - -Examples: - -```yaml -initContainers: - container-name: - enabled: true - imageSelector: image # The name of the image dict to pull repo, tag, pullPolicy - env: - key: value -```