diff --git a/charts/library/common-test/tests/_values/controllers_main_default_container.yaml b/charts/library/common-test/tests/_values/controllers_main_default_container.yaml new file mode 100644 index 00000000..b3e702fa --- /dev/null +++ b/charts/library/common-test/tests/_values/controllers_main_default_container.yaml @@ -0,0 +1,9 @@ +--- +controllers: + main: + containers: + main: + image: + repository: ghcr.io/mendhak/http-https-echo + tag: 31 + pullPolicy: IfNotPresent diff --git a/charts/library/common-test/tests/chart/validations_test.yaml b/charts/library/common-test/tests/chart/validations_test.yaml index 2a137ff6..80c4ef8b 100644 --- a/charts/library/common-test/tests/chart/validations_test.yaml +++ b/charts/library/common-test/tests/chart/validations_test.yaml @@ -3,6 +3,8 @@ suite: Chart validations templates: - common.yaml +values: + - ../_values/controllers_main_default_container.yaml tests: - it: advancedMounts invalid controller reference should fail set: diff --git a/charts/library/common-test/tests/configmap/metadata_test.yaml b/charts/library/common-test/tests/configmap/metadata_test.yaml index 23f8a124..d15d0b41 100644 --- a/charts/library/common-test/tests/configmap/metadata_test.yaml +++ b/charts/library/common-test/tests/configmap/metadata_test.yaml @@ -3,6 +3,8 @@ suite: configmap metadata templates: - common.yaml +values: + - ../_values/controllers_main_default_container.yaml tests: - it: default metadata should pass set: diff --git a/charts/library/common-test/tests/configmap/names_test.yaml b/charts/library/common-test/tests/configmap/names_test.yaml index fb7521df..028cc892 100644 --- a/charts/library/common-test/tests/configmap/names_test.yaml +++ b/charts/library/common-test/tests/configmap/names_test.yaml @@ -3,6 +3,8 @@ suite: configMap names templates: - common.yaml +values: + - ../_values/controllers_main_default_container.yaml tests: - it: default should pass asserts: diff --git a/charts/library/common-test/tests/configmap/pod_metadata_test.yaml b/charts/library/common-test/tests/configmap/pod_metadata_test.yaml index cb89dcd9..f9a680b3 100644 --- a/charts/library/common-test/tests/configmap/pod_metadata_test.yaml +++ b/charts/library/common-test/tests/configmap/pod_metadata_test.yaml @@ -3,6 +3,8 @@ suite: configmap Pod metadata templates: - common.yaml +values: + - ../_values/controllers_main_default_container.yaml tests: - it: default metadata should pass set: diff --git a/charts/library/common-test/tests/container/args_test.yaml b/charts/library/common-test/tests/container/args_test.yaml index b46ebfae..a6760fed 100644 --- a/charts/library/common-test/tests/container/args_test.yaml +++ b/charts/library/common-test/tests/container/args_test.yaml @@ -3,6 +3,8 @@ suite: container args override templates: - common.yaml +values: + - ../_values/controllers_main_default_container.yaml tests: - it: default should pass asserts: diff --git a/charts/library/common-test/tests/container/command_test.yaml b/charts/library/common-test/tests/container/command_test.yaml index e1d98ae4..96e03353 100644 --- a/charts/library/common-test/tests/container/command_test.yaml +++ b/charts/library/common-test/tests/container/command_test.yaml @@ -3,6 +3,8 @@ suite: container command override templates: - common.yaml +values: + - ../_values/controllers_main_default_container.yaml tests: - it: default should pass asserts: diff --git a/charts/library/common-test/tests/container/env_test.yaml b/charts/library/common-test/tests/container/env_test.yaml index a2accfa5..0b5130b0 100644 --- a/charts/library/common-test/tests/container/env_test.yaml +++ b/charts/library/common-test/tests/container/env_test.yaml @@ -3,6 +3,8 @@ suite: container env values templates: - common.yaml +values: + - ../_values/controllers_main_default_container.yaml tests: - it: default should pass asserts: diff --git a/charts/library/common-test/tests/container/envfrom_test.yaml b/charts/library/common-test/tests/container/envfrom_test.yaml index 8b8a348f..cb4bdadb 100644 --- a/charts/library/common-test/tests/container/envfrom_test.yaml +++ b/charts/library/common-test/tests/container/envfrom_test.yaml @@ -3,6 +3,8 @@ suite: container envFrom values templates: - common.yaml +values: + - ../_values/controllers_main_default_container.yaml tests: - it: default should pass asserts: diff --git a/charts/library/common-test/tests/container/field_restartpolicy_test.yaml b/charts/library/common-test/tests/container/field_restartpolicy_test.yaml index d7d3570a..5d088742 100644 --- a/charts/library/common-test/tests/container/field_restartpolicy_test.yaml +++ b/charts/library/common-test/tests/container/field_restartpolicy_test.yaml @@ -3,6 +3,8 @@ suite: container restartPolicy templates: - common.yaml +values: + - ../_values/controllers_main_default_container.yaml tests: - it: default should pass asserts: diff --git a/charts/library/common-test/tests/container/image_test.yaml b/charts/library/common-test/tests/container/image_test.yaml index 781a67d3..e407626c 100644 --- a/charts/library/common-test/tests/container/image_test.yaml +++ b/charts/library/common-test/tests/container/image_test.yaml @@ -3,6 +3,8 @@ suite: container image tag templates: - common.yaml +values: + - ../_values/controllers_main_default_container.yaml tests: - it: string tag should pass set: diff --git a/charts/library/common-test/tests/container/name_test.yaml b/charts/library/common-test/tests/container/name_test.yaml index ab03aa51..8b00872c 100644 --- a/charts/library/common-test/tests/container/name_test.yaml +++ b/charts/library/common-test/tests/container/name_test.yaml @@ -3,6 +3,8 @@ suite: container name templates: - common.yaml +values: + - ../_values/controllers_main_default_container.yaml tests: - it: with explicit name should pass set: diff --git a/charts/library/common-test/tests/container/ports_test.yaml b/charts/library/common-test/tests/container/ports_test.yaml index 027c6c4e..3e470f62 100644 --- a/charts/library/common-test/tests/container/ports_test.yaml +++ b/charts/library/common-test/tests/container/ports_test.yaml @@ -3,6 +3,8 @@ suite: container ports templates: - common.yaml +values: + - ../_values/controllers_main_default_container.yaml tests: - it: default should pass asserts: diff --git a/charts/library/common-test/tests/container/probes_test.yaml b/charts/library/common-test/tests/container/probes_test.yaml index 14484632..333b682e 100644 --- a/charts/library/common-test/tests/container/probes_test.yaml +++ b/charts/library/common-test/tests/container/probes_test.yaml @@ -3,7 +3,8 @@ suite: container probes templates: - common.yaml - +values: + - ../_values/controllers_main_default_container.yaml set: controllers.main.containers.main.probes.liveness.enabled: true controllers.main.containers.main.probes.readiness.enabled: true diff --git a/charts/library/common-test/tests/container/validations_test.yaml b/charts/library/common-test/tests/container/validations_test.yaml index 64d726c7..7608bb2d 100644 --- a/charts/library/common-test/tests/container/validations_test.yaml +++ b/charts/library/common-test/tests/container/validations_test.yaml @@ -3,6 +3,8 @@ suite: Container validations templates: - common.yaml +values: + - ../_values/controllers_main_default_container.yaml tests: - it: image repository is required set: diff --git a/charts/library/common-test/tests/container/volumemounts_test.yaml b/charts/library/common-test/tests/container/volumemounts_test.yaml index b39ff31b..370a6006 100644 --- a/charts/library/common-test/tests/container/volumemounts_test.yaml +++ b/charts/library/common-test/tests/container/volumemounts_test.yaml @@ -3,6 +3,8 @@ suite: container volumeMounts templates: - common.yaml +values: + - ../_values/controllers_main_default_container.yaml tests: - it: no persistence should pass asserts: diff --git a/charts/library/common-test/tests/container/workingdir_test.yaml b/charts/library/common-test/tests/container/workingdir_test.yaml index 0d35b4a8..b35bf00a 100644 --- a/charts/library/common-test/tests/container/workingdir_test.yaml +++ b/charts/library/common-test/tests/container/workingdir_test.yaml @@ -3,6 +3,8 @@ suite: container workingDir override templates: - common.yaml +values: + - ../_values/controllers_main_default_container.yaml tests: - it: default should pass asserts: diff --git a/charts/library/common-test/tests/controller/cronjob_test.yaml b/charts/library/common-test/tests/controller/cronjob_test.yaml index f5eabac2..83469fa4 100644 --- a/charts/library/common-test/tests/controller/cronjob_test.yaml +++ b/charts/library/common-test/tests/controller/cronjob_test.yaml @@ -3,6 +3,8 @@ suite: cronjob configuration templates: - common.yaml +values: + - ../_values/controllers_main_default_container.yaml tests: - it: default cronjob configuration should pass set: diff --git a/charts/library/common-test/tests/controller/job_test.yaml b/charts/library/common-test/tests/controller/job_test.yaml index 4bb3379a..5271b323 100644 --- a/charts/library/common-test/tests/controller/job_test.yaml +++ b/charts/library/common-test/tests/controller/job_test.yaml @@ -3,6 +3,8 @@ suite: job configuration templates: - common.yaml +values: + - ../_values/controllers_main_default_container.yaml tests: - it: default job configuration should pass set: diff --git a/charts/library/common-test/tests/controller/metadata_cronjob_test.yaml b/charts/library/common-test/tests/controller/metadata_cronjob_test.yaml index 4f6d0c4a..bf5ba4a2 100644 --- a/charts/library/common-test/tests/controller/metadata_cronjob_test.yaml +++ b/charts/library/common-test/tests/controller/metadata_cronjob_test.yaml @@ -3,7 +3,8 @@ suite: controller metadata cronjob templates: - common.yaml - +values: + - ../_values/controllers_main_default_container.yaml set: controllers.main.cronjob.schedule: "*/20 * * * *" diff --git a/charts/library/common-test/tests/controller/metadata_daemonset_test.yaml b/charts/library/common-test/tests/controller/metadata_daemonset_test.yaml index 3df79c3f..5fdc39d7 100644 --- a/charts/library/common-test/tests/controller/metadata_daemonset_test.yaml +++ b/charts/library/common-test/tests/controller/metadata_daemonset_test.yaml @@ -3,6 +3,8 @@ suite: controller metadata daemonset templates: - common.yaml +values: + - ../_values/controllers_main_default_container.yaml tests: - it: default metadata should pass set: diff --git a/charts/library/common-test/tests/controller/metadata_deployment_test.yaml b/charts/library/common-test/tests/controller/metadata_deployment_test.yaml index 59800904..1dee4300 100644 --- a/charts/library/common-test/tests/controller/metadata_deployment_test.yaml +++ b/charts/library/common-test/tests/controller/metadata_deployment_test.yaml @@ -3,6 +3,8 @@ suite: controller metadata deployment templates: - common.yaml +values: + - ../_values/controllers_main_default_container.yaml tests: - it: default metadata should pass set: diff --git a/charts/library/common-test/tests/controller/metadata_job_test.yaml b/charts/library/common-test/tests/controller/metadata_job_test.yaml index 688793c7..21f25bf9 100644 --- a/charts/library/common-test/tests/controller/metadata_job_test.yaml +++ b/charts/library/common-test/tests/controller/metadata_job_test.yaml @@ -3,6 +3,8 @@ suite: controller metadata job templates: - common.yaml +values: + - ../_values/controllers_main_default_container.yaml tests: - it: default metadata should pass set: diff --git a/charts/library/common-test/tests/controller/metadata_statefulset_test.yaml b/charts/library/common-test/tests/controller/metadata_statefulset_test.yaml index 00bd75c2..6c98b0f4 100644 --- a/charts/library/common-test/tests/controller/metadata_statefulset_test.yaml +++ b/charts/library/common-test/tests/controller/metadata_statefulset_test.yaml @@ -3,6 +3,8 @@ suite: controller metadata statefulset templates: - common.yaml +values: + - ../_values/controllers_main_default_container.yaml tests: - it: default metadata should pass set: diff --git a/charts/library/common-test/tests/controller/type_test.yaml b/charts/library/common-test/tests/controller/type_test.yaml index 9cb561b9..159bc3cd 100644 --- a/charts/library/common-test/tests/controller/type_test.yaml +++ b/charts/library/common-test/tests/controller/type_test.yaml @@ -3,6 +3,8 @@ suite: controller types templates: - common.yaml +values: + - ../_values/controllers_main_default_container.yaml tests: - it: default should pass asserts: diff --git a/charts/library/common-test/tests/ingress/metadata_test.yaml b/charts/library/common-test/tests/ingress/metadata_test.yaml index e97046f7..5170dcba 100644 --- a/charts/library/common-test/tests/ingress/metadata_test.yaml +++ b/charts/library/common-test/tests/ingress/metadata_test.yaml @@ -3,10 +3,9 @@ suite: ingress metadata templates: - common.yaml - values: - ../_values/ingress_main_default_hosts.yaml - + - ../_values/controllers_main_default_container.yaml tests: - it: default metadata should pass asserts: diff --git a/charts/library/common-test/tests/ingress/presence_test.yaml b/charts/library/common-test/tests/ingress/presence_test.yaml index 93566ef6..6201f767 100644 --- a/charts/library/common-test/tests/ingress/presence_test.yaml +++ b/charts/library/common-test/tests/ingress/presence_test.yaml @@ -3,6 +3,9 @@ suite: ingress presence templates: - common.yaml +values: + - ../_values/controllers_main_default_container.yaml + - ../_values/controllers_main_default_container.yaml tests: - it: default should pass asserts: diff --git a/charts/library/common-test/tests/ingress/service_reference_test.yaml b/charts/library/common-test/tests/ingress/service_reference_test.yaml index 86ab85e6..0892582f 100644 --- a/charts/library/common-test/tests/ingress/service_reference_test.yaml +++ b/charts/library/common-test/tests/ingress/service_reference_test.yaml @@ -3,10 +3,9 @@ suite: ingress service reference templates: - common.yaml - values: - ../_values/ingress_main_default_hosts.yaml - + - ../_values/controllers_main_default_container.yaml tests: - it: default should pass set: diff --git a/charts/library/common-test/tests/ingress/tls_test.yaml b/charts/library/common-test/tests/ingress/tls_test.yaml index 818a1b08..64a2207f 100644 --- a/charts/library/common-test/tests/ingress/tls_test.yaml +++ b/charts/library/common-test/tests/ingress/tls_test.yaml @@ -3,10 +3,9 @@ suite: ingress tls templates: - common.yaml - values: - ../_values/ingress_main_default_hosts.yaml - + - ../_values/controllers_main_default_container.yaml tests: - it: default should pass asserts: diff --git a/charts/library/common-test/tests/ingress/values_test.yaml b/charts/library/common-test/tests/ingress/values_test.yaml index 8d813990..8fd5386e 100644 --- a/charts/library/common-test/tests/ingress/values_test.yaml +++ b/charts/library/common-test/tests/ingress/values_test.yaml @@ -3,11 +3,10 @@ suite: ingress values templates: - common.yaml - values: - ../_values/ingress_main_default_hosts.yaml - ../_values/service_main_default.yaml - + - ../_values/controllers_main_default_container.yaml tests: - it: default should pass asserts: diff --git a/charts/library/common-test/tests/misc/nameoverride_test.yaml b/charts/library/common-test/tests/misc/nameoverride_test.yaml index 6cdec855..61ede15a 100644 --- a/charts/library/common-test/tests/misc/nameoverride_test.yaml +++ b/charts/library/common-test/tests/misc/nameoverride_test.yaml @@ -3,6 +3,8 @@ suite: nameOverride tests templates: - common.yaml +values: + - ../_values/controllers_main_default_container.yaml tests: - it: default name is set to release name asserts: diff --git a/charts/library/common-test/tests/networkpolicy/metadata_test.yaml b/charts/library/common-test/tests/networkpolicy/metadata_test.yaml index ead47fed..c543d078 100644 --- a/charts/library/common-test/tests/networkpolicy/metadata_test.yaml +++ b/charts/library/common-test/tests/networkpolicy/metadata_test.yaml @@ -12,6 +12,8 @@ set: templates: - common.yaml +values: + - ../_values/controllers_main_default_container.yaml tests: - it: default metadata should pass asserts: diff --git a/charts/library/common-test/tests/networkpolicy/names_test.yaml b/charts/library/common-test/tests/networkpolicy/names_test.yaml index 2bb0b87f..7abe281d 100644 --- a/charts/library/common-test/tests/networkpolicy/names_test.yaml +++ b/charts/library/common-test/tests/networkpolicy/names_test.yaml @@ -3,6 +3,8 @@ suite: networkPolicy names templates: - common.yaml +values: + - ../_values/controllers_main_default_container.yaml tests: - it: default should pass set: diff --git a/charts/library/common-test/tests/networkpolicy/validations_test.yaml b/charts/library/common-test/tests/networkpolicy/validations_test.yaml index 11715ebe..034d391f 100644 --- a/charts/library/common-test/tests/networkpolicy/validations_test.yaml +++ b/charts/library/common-test/tests/networkpolicy/validations_test.yaml @@ -3,6 +3,8 @@ suite: NetworkPolicy validations templates: - common.yaml +values: + - ../_values/controllers_main_default_container.yaml tests: - it: networkpolicy requires either controller reference or podSelector set: diff --git a/charts/library/common-test/tests/networkpolicy/values_test.yaml b/charts/library/common-test/tests/networkpolicy/values_test.yaml index 012b3066..8c499562 100644 --- a/charts/library/common-test/tests/networkpolicy/values_test.yaml +++ b/charts/library/common-test/tests/networkpolicy/values_test.yaml @@ -3,7 +3,8 @@ suite: NetworkPolicy values templates: - common.yaml - +values: + - ../_values/controllers_main_default_container.yaml tests: - it: main networkpolicy is disabled by default asserts: diff --git a/charts/library/common-test/tests/persistence/claimnames_test.yaml b/charts/library/common-test/tests/persistence/claimnames_test.yaml index 815c5069..3c36b650 100644 --- a/charts/library/common-test/tests/persistence/claimnames_test.yaml +++ b/charts/library/common-test/tests/persistence/claimnames_test.yaml @@ -3,6 +3,8 @@ suite: persistence claimnames templates: - common.yaml +values: + - ../_values/controllers_main_default_container.yaml tests: - it: default should pass set: diff --git a/charts/library/common-test/tests/persistence/configmap_test.yaml b/charts/library/common-test/tests/persistence/configmap_test.yaml index 29420af9..bc25b07d 100644 --- a/charts/library/common-test/tests/persistence/configmap_test.yaml +++ b/charts/library/common-test/tests/persistence/configmap_test.yaml @@ -3,6 +3,8 @@ suite: persistence configmap templates: - common.yaml +values: + - ../_values/controllers_main_default_container.yaml tests: - it: configmap persistence type should pass set: diff --git a/charts/library/common-test/tests/persistence/custom.yaml b/charts/library/common-test/tests/persistence/custom.yaml index 0eedd95c..0a2d868c 100644 --- a/charts/library/common-test/tests/persistence/custom.yaml +++ b/charts/library/common-test/tests/persistence/custom.yaml @@ -3,6 +3,8 @@ suite: persistence custom templates: - common.yaml +values: + - ../_values/controllers_main_default_container.yaml tests: - it: custom persistence type should pass set: diff --git a/charts/library/common-test/tests/persistence/emptydir_test.yaml b/charts/library/common-test/tests/persistence/emptydir_test.yaml index 0f3a04d4..a1ecf303 100644 --- a/charts/library/common-test/tests/persistence/emptydir_test.yaml +++ b/charts/library/common-test/tests/persistence/emptydir_test.yaml @@ -3,6 +3,8 @@ suite: persistence emptydir templates: - common.yaml +values: + - ../_values/controllers_main_default_container.yaml tests: - it: default emptyDir should pass set: diff --git a/charts/library/common-test/tests/persistence/hostpath_test.yaml b/charts/library/common-test/tests/persistence/hostpath_test.yaml index 8535afb2..651cb57c 100644 --- a/charts/library/common-test/tests/persistence/hostpath_test.yaml +++ b/charts/library/common-test/tests/persistence/hostpath_test.yaml @@ -3,6 +3,8 @@ suite: persistence hostpath templates: - common.yaml +values: + - ../_values/controllers_main_default_container.yaml tests: - it: hostPath should pass set: diff --git a/charts/library/common-test/tests/persistence/nfs_test.yaml b/charts/library/common-test/tests/persistence/nfs_test.yaml index d83d1864..c4e7fccd 100644 --- a/charts/library/common-test/tests/persistence/nfs_test.yaml +++ b/charts/library/common-test/tests/persistence/nfs_test.yaml @@ -3,6 +3,8 @@ suite: persistence nfs templates: - common.yaml +values: + - ../_values/controllers_main_default_container.yaml tests: - it: nfs persistence type should pass set: diff --git a/charts/library/common-test/tests/persistence/secret_test.yaml b/charts/library/common-test/tests/persistence/secret_test.yaml index 13c7ff41..92fd4075 100644 --- a/charts/library/common-test/tests/persistence/secret_test.yaml +++ b/charts/library/common-test/tests/persistence/secret_test.yaml @@ -3,6 +3,8 @@ suite: persistence secret templates: - common.yaml +values: + - ../_values/controllers_main_default_container.yaml tests: - it: secret persistence type should pass set: diff --git a/charts/library/common-test/tests/persistence/volumeclaimtemplates_test.yaml b/charts/library/common-test/tests/persistence/volumeclaimtemplates_test.yaml index 1913fc2c..1261a96c 100644 --- a/charts/library/common-test/tests/persistence/volumeclaimtemplates_test.yaml +++ b/charts/library/common-test/tests/persistence/volumeclaimtemplates_test.yaml @@ -3,6 +3,8 @@ suite: persistence volumeclaimtemplates templates: - common.yaml +values: + - ../_values/controllers_main_default_container.yaml tests: - it: default should pass set: diff --git a/charts/library/common-test/tests/persistence/volumes_test.yaml b/charts/library/common-test/tests/persistence/volumes_test.yaml index c8029eae..0501a418 100644 --- a/charts/library/common-test/tests/persistence/volumes_test.yaml +++ b/charts/library/common-test/tests/persistence/volumes_test.yaml @@ -3,6 +3,8 @@ suite: persistence volumes templates: - common.yaml +values: + - ../_values/controllers_main_default_container.yaml tests: - it: no persistence should pass asserts: diff --git a/charts/library/common-test/tests/pod/additional_containers_test.yaml b/charts/library/common-test/tests/pod/additional_containers_test.yaml index 10144039..0cf5149e 100644 --- a/charts/library/common-test/tests/pod/additional_containers_test.yaml +++ b/charts/library/common-test/tests/pod/additional_containers_test.yaml @@ -3,6 +3,8 @@ suite: pod with multiple containers templates: - common.yaml +values: + - ../_values/controllers_main_default_container.yaml tests: - it: with explicit name should pass set: diff --git a/charts/library/common-test/tests/pod/container_order_test.yaml b/charts/library/common-test/tests/pod/container_order_test.yaml index 81802611..f8aff3f1 100644 --- a/charts/library/common-test/tests/pod/container_order_test.yaml +++ b/charts/library/common-test/tests/pod/container_order_test.yaml @@ -3,6 +3,8 @@ suite: pod sidecar containers templates: - common.yaml +values: + - ../_values/controllers_main_default_container.yaml tests: - it: with default order set: diff --git a/charts/library/common-test/tests/pod/field_affinity_test.yaml b/charts/library/common-test/tests/pod/field_affinity_test.yaml index 744a53ec..9018b322 100644 --- a/charts/library/common-test/tests/pod/field_affinity_test.yaml +++ b/charts/library/common-test/tests/pod/field_affinity_test.yaml @@ -3,6 +3,8 @@ suite: pod affinity templates: - common.yaml +values: + - ../_values/controllers_main_default_container.yaml tests: - it: default should pass asserts: diff --git a/charts/library/common-test/tests/pod/field_dnsConfig_test.yaml b/charts/library/common-test/tests/pod/field_dnsConfig_test.yaml index 025c0edd..4a83032f 100644 --- a/charts/library/common-test/tests/pod/field_dnsConfig_test.yaml +++ b/charts/library/common-test/tests/pod/field_dnsConfig_test.yaml @@ -3,6 +3,8 @@ suite: pod dnsConfig templates: - common.yaml +values: + - ../_values/controllers_main_default_container.yaml tests: - it: default should pass asserts: diff --git a/charts/library/common-test/tests/pod/field_dnsPolicy_test.yaml b/charts/library/common-test/tests/pod/field_dnsPolicy_test.yaml index 1ec0b184..25d64e86 100644 --- a/charts/library/common-test/tests/pod/field_dnsPolicy_test.yaml +++ b/charts/library/common-test/tests/pod/field_dnsPolicy_test.yaml @@ -3,6 +3,8 @@ suite: pod dnsPolicy templates: - common.yaml +values: + - ../_values/controllers_main_default_container.yaml tests: - it: default should pass asserts: diff --git a/charts/library/common-test/tests/pod/field_enableServiceLinks_test.yaml b/charts/library/common-test/tests/pod/field_enableServiceLinks_test.yaml index 1ec0434b..43490b2e 100644 --- a/charts/library/common-test/tests/pod/field_enableServiceLinks_test.yaml +++ b/charts/library/common-test/tests/pod/field_enableServiceLinks_test.yaml @@ -3,6 +3,8 @@ suite: pod enableServiceLinks templates: - common.yaml +values: + - ../_values/controllers_main_default_container.yaml tests: - it: default should pass asserts: diff --git a/charts/library/common-test/tests/pod/field_hostAliases_test.yaml b/charts/library/common-test/tests/pod/field_hostAliases_test.yaml index 34b09ce9..66348bc9 100644 --- a/charts/library/common-test/tests/pod/field_hostAliases_test.yaml +++ b/charts/library/common-test/tests/pod/field_hostAliases_test.yaml @@ -3,6 +3,8 @@ suite: pod hostAliases templates: - common.yaml +values: + - ../_values/controllers_main_default_container.yaml tests: - it: default should pass asserts: diff --git a/charts/library/common-test/tests/pod/field_hostIPC_test.yaml b/charts/library/common-test/tests/pod/field_hostIPC_test.yaml index 9071ba21..6f04e97d 100644 --- a/charts/library/common-test/tests/pod/field_hostIPC_test.yaml +++ b/charts/library/common-test/tests/pod/field_hostIPC_test.yaml @@ -3,6 +3,8 @@ suite: pod security templates: - common.yaml +values: + - ../_values/controllers_main_default_container.yaml tests: - it: default should pass asserts: diff --git a/charts/library/common-test/tests/pod/field_hostNetwork_test.yaml b/charts/library/common-test/tests/pod/field_hostNetwork_test.yaml index 0434bd31..6077e351 100644 --- a/charts/library/common-test/tests/pod/field_hostNetwork_test.yaml +++ b/charts/library/common-test/tests/pod/field_hostNetwork_test.yaml @@ -3,6 +3,8 @@ suite: pod hostNetwork templates: - common.yaml +values: + - ../_values/controllers_main_default_container.yaml tests: - it: default should pass asserts: diff --git a/charts/library/common-test/tests/pod/field_hostPID_test.yaml b/charts/library/common-test/tests/pod/field_hostPID_test.yaml index e644dc7f..00c379d0 100644 --- a/charts/library/common-test/tests/pod/field_hostPID_test.yaml +++ b/charts/library/common-test/tests/pod/field_hostPID_test.yaml @@ -3,6 +3,8 @@ suite: pod security templates: - common.yaml +values: + - ../_values/controllers_main_default_container.yaml tests: - it: default should pass asserts: diff --git a/charts/library/common-test/tests/pod/field_imagePullSecrets_test.yaml b/charts/library/common-test/tests/pod/field_imagePullSecrets_test.yaml index bc6b6806..d12bf6e2 100644 --- a/charts/library/common-test/tests/pod/field_imagePullSecrets_test.yaml +++ b/charts/library/common-test/tests/pod/field_imagePullSecrets_test.yaml @@ -3,6 +3,8 @@ suite: pod imagePullSecrets templates: - common.yaml +values: + - ../_values/controllers_main_default_container.yaml tests: - it: default should pass asserts: diff --git a/charts/library/common-test/tests/pod/field_nodeSelector_test.yaml b/charts/library/common-test/tests/pod/field_nodeSelector_test.yaml index 230d0265..1776d541 100644 --- a/charts/library/common-test/tests/pod/field_nodeSelector_test.yaml +++ b/charts/library/common-test/tests/pod/field_nodeSelector_test.yaml @@ -3,6 +3,8 @@ suite: pod nodeSelector templates: - common.yaml +values: + - ../_values/controllers_main_default_container.yaml tests: - it: default should pass asserts: diff --git a/charts/library/common-test/tests/pod/field_replicas_test.yaml b/charts/library/common-test/tests/pod/field_replicas_test.yaml index e9554b3f..652b4eb6 100644 --- a/charts/library/common-test/tests/pod/field_replicas_test.yaml +++ b/charts/library/common-test/tests/pod/field_replicas_test.yaml @@ -3,6 +3,8 @@ suite: pod replicas templates: - common.yaml +values: + - ../_values/controllers_main_default_container.yaml tests: - it: default should pass asserts: diff --git a/charts/library/common-test/tests/pod/field_securityContext_test.yaml b/charts/library/common-test/tests/pod/field_securityContext_test.yaml index 29ca5833..85d9b716 100644 --- a/charts/library/common-test/tests/pod/field_securityContext_test.yaml +++ b/charts/library/common-test/tests/pod/field_securityContext_test.yaml @@ -3,6 +3,8 @@ suite: pod securityContext templates: - common.yaml +values: + - ../_values/controllers_main_default_container.yaml tests: - it: default should pass asserts: diff --git a/charts/library/common-test/tests/pod/field_serviceAccount_test.yaml b/charts/library/common-test/tests/pod/field_serviceAccount_test.yaml index 17a77dd1..206f50c2 100644 --- a/charts/library/common-test/tests/pod/field_serviceAccount_test.yaml +++ b/charts/library/common-test/tests/pod/field_serviceAccount_test.yaml @@ -3,6 +3,8 @@ suite: pod serviceAccount templates: - common.yaml +values: + - ../_values/controllers_main_default_container.yaml tests: - it: default should pass asserts: diff --git a/charts/library/common-test/tests/pod/field_tolerations_test.yaml b/charts/library/common-test/tests/pod/field_tolerations_test.yaml index 2b9a8c63..4f24da28 100644 --- a/charts/library/common-test/tests/pod/field_tolerations_test.yaml +++ b/charts/library/common-test/tests/pod/field_tolerations_test.yaml @@ -3,6 +3,8 @@ suite: pod tolerations templates: - common.yaml +values: + - ../_values/controllers_main_default_container.yaml tests: - it: default should pass asserts: diff --git a/charts/library/common-test/tests/pod/field_topologySpreadConstraints_test.yaml b/charts/library/common-test/tests/pod/field_topologySpreadConstraints_test.yaml index 8c52fcb9..457c4d1d 100644 --- a/charts/library/common-test/tests/pod/field_topologySpreadConstraints_test.yaml +++ b/charts/library/common-test/tests/pod/field_topologySpreadConstraints_test.yaml @@ -3,6 +3,8 @@ suite: pod topologySpreadConstraints templates: - common.yaml +values: + - ../_values/controllers_main_default_container.yaml tests: - it: default should pass asserts: diff --git a/charts/library/common-test/tests/pod/initcontainers_test.yaml b/charts/library/common-test/tests/pod/initcontainers_test.yaml index f791f206..441c5879 100644 --- a/charts/library/common-test/tests/pod/initcontainers_test.yaml +++ b/charts/library/common-test/tests/pod/initcontainers_test.yaml @@ -3,6 +3,8 @@ suite: pod initContainers templates: - common.yaml +values: + - ../_values/controllers_main_default_container.yaml tests: - it: with custom env vars dict should pass set: diff --git a/charts/library/common-test/tests/pvc/datasource_test.yaml b/charts/library/common-test/tests/pvc/datasource_test.yaml index 1dd5dbcf..096cc8c7 100644 --- a/charts/library/common-test/tests/pvc/datasource_test.yaml +++ b/charts/library/common-test/tests/pvc/datasource_test.yaml @@ -3,7 +3,8 @@ suite: pvc datasource templates: - common.yaml - +values: + - ../_values/controllers_main_default_container.yaml set: persistence.config: accessMode: ReadWriteOnce diff --git a/charts/library/common-test/tests/pvc/metadata_test.yaml b/charts/library/common-test/tests/pvc/metadata_test.yaml index 87b2ef8e..9be3d9de 100644 --- a/charts/library/common-test/tests/pvc/metadata_test.yaml +++ b/charts/library/common-test/tests/pvc/metadata_test.yaml @@ -3,7 +3,8 @@ suite: pvc metadata templates: - common.yaml - +values: + - ../_values/controllers_main_default_container.yaml set: persistence.config: accessMode: ReadWriteOnce diff --git a/charts/library/common-test/tests/pvc/names_test.yaml b/charts/library/common-test/tests/pvc/names_test.yaml index db14e9c8..536eac09 100644 --- a/charts/library/common-test/tests/pvc/names_test.yaml +++ b/charts/library/common-test/tests/pvc/names_test.yaml @@ -3,7 +3,8 @@ suite: pvc names templates: - common.yaml - +values: + - ../_values/controllers_main_default_container.yaml set: persistence.config: accessMode: ReadWriteOnce diff --git a/charts/library/common-test/tests/pvc/storageclass_test.yaml b/charts/library/common-test/tests/pvc/storageclass_test.yaml index 372063f7..d1f98dc3 100644 --- a/charts/library/common-test/tests/pvc/storageclass_test.yaml +++ b/charts/library/common-test/tests/pvc/storageclass_test.yaml @@ -3,7 +3,8 @@ suite: pvc storageclass templates: - common.yaml - +values: + - ../_values/controllers_main_default_container.yaml set: persistence.config: accessMode: ReadWriteOnce diff --git a/charts/library/common-test/tests/pvc/values_test.yaml b/charts/library/common-test/tests/pvc/values_test.yaml index 1e1fb129..acf4f20e 100644 --- a/charts/library/common-test/tests/pvc/values_test.yaml +++ b/charts/library/common-test/tests/pvc/values_test.yaml @@ -3,6 +3,8 @@ suite: pvc values templates: - common.yaml +values: + - ../_values/controllers_main_default_container.yaml tests: - it: default enabled should pass set: diff --git a/charts/library/common-test/tests/route/metadata_test.yaml b/charts/library/common-test/tests/route/metadata_test.yaml index fce54b81..20338560 100644 --- a/charts/library/common-test/tests/route/metadata_test.yaml +++ b/charts/library/common-test/tests/route/metadata_test.yaml @@ -3,6 +3,8 @@ suite: route metadata templates: - common.yaml +values: + - ../_values/controllers_main_default_container.yaml tests: - it: default metadata should pass set: diff --git a/charts/library/common-test/tests/route/presence_test.yaml b/charts/library/common-test/tests/route/presence_test.yaml index 1ddc9c52..4c9c3224 100644 --- a/charts/library/common-test/tests/route/presence_test.yaml +++ b/charts/library/common-test/tests/route/presence_test.yaml @@ -3,6 +3,8 @@ suite: route presence templates: - common.yaml +values: + - ../_values/controllers_main_default_container.yaml tests: - it: default should pass asserts: diff --git a/charts/library/common-test/tests/route/service_reference_test.yaml b/charts/library/common-test/tests/route/service_reference_test.yaml index be6f6c82..7b722aa5 100644 --- a/charts/library/common-test/tests/route/service_reference_test.yaml +++ b/charts/library/common-test/tests/route/service_reference_test.yaml @@ -3,6 +3,8 @@ suite: route service reference templates: - common.yaml +values: + - ../_values/controllers_main_default_container.yaml tests: - it: default should pass set: diff --git a/charts/library/common-test/tests/route/values_test.yaml b/charts/library/common-test/tests/route/values_test.yaml index 0cedb334..51869213 100644 --- a/charts/library/common-test/tests/route/values_test.yaml +++ b/charts/library/common-test/tests/route/values_test.yaml @@ -3,6 +3,8 @@ suite: route values templates: - common.yaml +values: + - ../_values/controllers_main_default_container.yaml tests: - it: setting gateway should pass set: diff --git a/charts/library/common-test/tests/secret/metadata_test.yaml b/charts/library/common-test/tests/secret/metadata_test.yaml index 707bb3d5..677904a2 100644 --- a/charts/library/common-test/tests/secret/metadata_test.yaml +++ b/charts/library/common-test/tests/secret/metadata_test.yaml @@ -3,6 +3,8 @@ suite: secret metadata templates: - common.yaml +values: + - ../_values/controllers_main_default_container.yaml tests: - it: default metadata should pass set: diff --git a/charts/library/common-test/tests/secret/names_test.yaml b/charts/library/common-test/tests/secret/names_test.yaml index 78c8bf20..bb11abb9 100644 --- a/charts/library/common-test/tests/secret/names_test.yaml +++ b/charts/library/common-test/tests/secret/names_test.yaml @@ -3,6 +3,8 @@ suite: secret names templates: - common.yaml +values: + - ../_values/controllers_main_default_container.yaml tests: - it: default should pass asserts: diff --git a/charts/library/common-test/tests/secret/pod_metadata_test.yaml b/charts/library/common-test/tests/secret/pod_metadata_test.yaml index 3715f25f..d5349c35 100644 --- a/charts/library/common-test/tests/secret/pod_metadata_test.yaml +++ b/charts/library/common-test/tests/secret/pod_metadata_test.yaml @@ -3,6 +3,8 @@ suite: secret Pod metadata templates: - common.yaml +values: + - ../_values/controllers_main_default_container.yaml tests: - it: default metadata should pass set: diff --git a/charts/library/common-test/tests/service/metadata_test.yaml b/charts/library/common-test/tests/service/metadata_test.yaml index 60bec1e7..16b8bbe7 100644 --- a/charts/library/common-test/tests/service/metadata_test.yaml +++ b/charts/library/common-test/tests/service/metadata_test.yaml @@ -3,6 +3,8 @@ suite: service metadata templates: - common.yaml +values: + - ../_values/controllers_main_default_container.yaml tests: - it: default metadata should pass values: diff --git a/charts/library/common-test/tests/service/names_test.yaml b/charts/library/common-test/tests/service/names_test.yaml index 2fa07caf..3cebee24 100644 --- a/charts/library/common-test/tests/service/names_test.yaml +++ b/charts/library/common-test/tests/service/names_test.yaml @@ -3,6 +3,8 @@ suite: service names templates: - common.yaml +values: + - ../_values/controllers_main_default_container.yaml tests: - it: default should pass values: diff --git a/charts/library/common-test/tests/service/port_protocols_test.yaml b/charts/library/common-test/tests/service/port_protocols_test.yaml index e75559d1..b9c4857f 100644 --- a/charts/library/common-test/tests/service/port_protocols_test.yaml +++ b/charts/library/common-test/tests/service/port_protocols_test.yaml @@ -3,6 +3,8 @@ suite: service protocols templates: - common.yaml +values: + - ../_values/controllers_main_default_container.yaml tests: - it: default should pass values: diff --git a/charts/library/common-test/tests/service/ports_test.yaml b/charts/library/common-test/tests/service/ports_test.yaml index c90230e6..591493ef 100644 --- a/charts/library/common-test/tests/service/ports_test.yaml +++ b/charts/library/common-test/tests/service/ports_test.yaml @@ -3,6 +3,8 @@ suite: service ports templates: - common.yaml +values: + - ../_values/controllers_main_default_container.yaml tests: - it: default should pass values: diff --git a/charts/library/common-test/tests/service/validations_test.yaml b/charts/library/common-test/tests/service/validations_test.yaml index d7a1292f..f2322125 100644 --- a/charts/library/common-test/tests/service/validations_test.yaml +++ b/charts/library/common-test/tests/service/validations_test.yaml @@ -3,6 +3,8 @@ suite: Service validations templates: - common.yaml +values: + - ../_values/controllers_main_default_container.yaml tests: - it: invalid controller reference should fail set: diff --git a/charts/library/common-test/tests/service/values_test.yaml b/charts/library/common-test/tests/service/values_test.yaml index 68b4ad0b..9d3e02a8 100644 --- a/charts/library/common-test/tests/service/values_test.yaml +++ b/charts/library/common-test/tests/service/values_test.yaml @@ -3,6 +3,8 @@ suite: service values templates: - common.yaml +values: + - ../_values/controllers_main_default_container.yaml tests: - it: ports and services are enabled by default set: diff --git a/charts/library/common-test/tests/serviceAccount/serviceaccount_test.yaml b/charts/library/common-test/tests/serviceAccount/serviceaccount_test.yaml index b386174a..dd6bfb11 100644 --- a/charts/library/common-test/tests/serviceAccount/serviceaccount_test.yaml +++ b/charts/library/common-test/tests/serviceAccount/serviceaccount_test.yaml @@ -3,6 +3,8 @@ suite: serviceAccount values templates: - common.yaml +values: + - ../_values/controllers_main_default_container.yaml tests: - it: a serviceAccount is not created by default asserts: diff --git a/charts/library/common-test/tests/serviceMonitor/servicemonitor_test.yaml b/charts/library/common-test/tests/serviceMonitor/servicemonitor_test.yaml index 30fb7e32..b0aa224d 100644 --- a/charts/library/common-test/tests/serviceMonitor/servicemonitor_test.yaml +++ b/charts/library/common-test/tests/serviceMonitor/servicemonitor_test.yaml @@ -3,7 +3,8 @@ suite: serviceMonitor values templates: - common.yaml - +values: + - ../_values/controllers_main_default_container.yaml tests: - it: a serviceMonitor is not created by default asserts: diff --git a/charts/library/common-test/values.yaml b/charts/library/common-test/values.yaml index b3e702fa..e69de29b 100644 --- a/charts/library/common-test/values.yaml +++ b/charts/library/common-test/values.yaml @@ -1,9 +0,0 @@ ---- -controllers: - main: - containers: - main: - image: - repository: ghcr.io/mendhak/http-https-echo - tag: 31 - pullPolicy: IfNotPresent diff --git a/charts/library/common/Chart.yaml b/charts/library/common/Chart.yaml index 7e2afd7a..6647635f 100644 --- a/charts/library/common/Chart.yaml +++ b/charts/library/common/Chart.yaml @@ -3,7 +3,7 @@ apiVersion: v2 name: common description: Function library for Helm charts type: library -version: 3.0.3 +version: 3.0.4 kubeVersion: ">=1.22.0-0" keywords: - common @@ -16,7 +16,4 @@ annotations: artifacthub.io/changes: |- - kind: fixed description: |- - Fixed probes intermittently choosing the wrong service - - kind: fixed - description: |- - Prevent potential incorrect controller references + Improved fix for preventing potential incorrect controller references diff --git a/charts/library/common/README.md b/charts/library/common/README.md index b61bcf42..973435ed 100644 --- a/charts/library/common/README.md +++ b/charts/library/common/README.md @@ -1,6 +1,6 @@ # common -![Version: 3.0.3](https://img.shields.io/badge/Version-3.0.3-informational?style=flat-square) ![Type: library](https://img.shields.io/badge/Type-library-informational?style=flat-square) +![Version: 3.0.4](https://img.shields.io/badge/Version-3.0.4-informational?style=flat-square) ![Type: library](https://img.shields.io/badge/Type-library-informational?style=flat-square) Function library for Helm charts @@ -27,7 +27,7 @@ Include this chart as a dependency in your `Chart.yaml` e.g. # Chart.yaml dependencies: - name: common - version: 3.0.3 + version: 3.0.4 repository: https://bjw-s.github.io/helm-charts/ ``` diff --git a/charts/library/common/schemas/containers.json b/charts/library/common/schemas/containers.json index f0544d95..e56ca809 100644 --- a/charts/library/common/schemas/containers.json +++ b/charts/library/common/schemas/containers.json @@ -36,14 +36,13 @@ ] }, "env": { - "anyOf": [ + "oneOf": [ { "type": "array", "items": { "anyOf": [ - {"$ref": "#/envValueWithName"}, - {"$ref": "#/envValueFromWithName"}, - {"$ref": "#/envImplicitValueFromWithName"} + {"$ref": "envVars.json#/envVarListItem"}, + {"$ref": "envVars.json#/valueFromListItem"} ] } }, @@ -51,10 +50,9 @@ "type": "object", "additionalProperties": { "anyOf": [ - {"type": ["string", "number", "boolean", "null"]}, - {"$ref": "#/envValue"}, - {"$ref": "#/envValueFrom"}, - {"$ref": "#/envImplicitValueFrom"} + {"$ref": "envVars.json#/envVarValue"}, + {"$ref": "envVars.json#/envVarItem"}, + {"$ref": "envVars.json#/valueFromItem"} ] } } @@ -164,180 +162,6 @@ } }, - "envValueWithName": { - "type": "object", - "additionalProperties": false, - "properties": { - "name": { - "type": "string" - }, - "value": { - "type": ["string", "number", "boolean", "null"] - } - }, - "required": ["name", "value"] - }, - - "envValue": { - "type": "object", - "additionalProperties": false, - "properties": { - "value": { - "type": ["string", "number", "boolean", "null"] - }, - "dependsOn": {"$ref": "#/envDependsOn"} - }, - "required": ["value"] - }, - - "envValueFromWithName": { - "type": "object", - "additionalProperties": false, - "properties": { - "name": { - "type": "string" - }, - "valueFrom": { - "oneOf": [ - {"$ref": "#/envValueFrom.fieldRef"}, - {"$ref": "#/envValueFrom.secretKeyRef"} - ] - }, - "dependsOn": {"$ref": "#/envDependsOn"} - }, - "required": ["name", "valueFrom"] - }, - - "envValueFrom": { - "type": "object", - "additionalProperties": false, - "properties": { - "valueFrom": { - "oneOf": [ - {"$ref": "#/envValueFrom.fieldRef"}, - {"$ref": "#/envValueFrom.secretKeyRef"} - ] - }, - "dependsOn": {"$ref": "#/envDependsOn"} - }, - "required": ["valueFrom"] - }, - - "envImplicitValueFromWithName": { - "type": "object", - "additionalProperties": false, - "properties": { - "name": { - "type": "string" - }, - "fieldRef": {"$ref": "#/envValueFrom.fieldPath"}, - "secretKeyRef": {"$ref": "#/envValueFrom.secretKeyRef"}, - "configMapKeyRef": {"$ref": "#/envValueFrom.configMapKeyRef"} - }, - "required": ["name"], - "dependencies": { - "fieldRef": { - "allOf": [ - {"not": {"required": ["secretKeyRef"]}}, - {"not": {"required": ["configMapKeyRef"]}} - ] - }, - "secretKeyRef": { - "allOf": [ - {"not": {"required": ["fieldRef"]}}, - {"not": {"required": ["configMapKeyRef"]}} - ] - }, - "configMapKeyRef": { - "allOf": [ - {"not": {"required": ["secretKeyRef"]}}, - {"not": {"required": ["configMapKeyRef"]}} - ] - } - } - }, - - "envImplicitValueFrom": { - "type": "object", - "oneOf": [ - {"$ref": "#/envValueFrom.fieldRef"}, - {"$ref": "#/envValueFrom.secretKeyRef"}, - {"$ref": "#/envValueFrom.configMapKeyRef"} - ] - }, - - "envDependsOn": { - "oneOf": [ - {"type": "string"}, - {"type": "array", "items": {"type": "string"}} - ] - }, - - "envValueFrom.secretKeyRef": { - "type": "object", - "additionalProperties": false, - "properties": { - "secretKeyRef": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "key": { - "type": "string" - } - }, - "required": ["name", "key"] - } - }, - "required": ["secretKeyRef"] - }, - - "envValueFrom.configMapKeyRef": { - "type": "object", - "additionalProperties": false, - "properties": { - "configMapKeyRef": { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "key": { - "type": "string" - } - }, - "required": ["name", "key"] - } - }, - "required": ["configMapKeyRef"] - }, - - "envValueFrom.fieldRef": { - "type": "object", - "additionalProperties": false, - "properties": { - "fieldRef": { - "$ref": "#/envValueFrom.fieldPath" - } - }, - "required": ["fieldRef"] - }, - - "envValueFrom.fieldPath": { - "type": "object", - "additionalProperties": false, - "properties": { - "apiVersion": { - "type": "string" - }, - "fieldPath": { - "type": "string" - } - }, - "required": ["fieldPath"] - }, - "probe": { "additionalProperties": false, "properties": { diff --git a/charts/library/common/schemas/envVars.json b/charts/library/common/schemas/envVars.json new file mode 100644 index 00000000..05fbcd4f --- /dev/null +++ b/charts/library/common/schemas/envVars.json @@ -0,0 +1,245 @@ +{ + "envVarValue": { + "type": ["string", "number", "boolean", "null"] + }, + + "envVarListItem": { + "type": "object", + "additionalProperties": false, + "properties": { + "name": {"type": "string"}, + "value": {"$ref": "#/envVarValue"} + }, + "required": ["name", "value"] + }, + + "envVarItem": { + "type": "object", + "additionalProperties": false, + "properties": { + "value": {"$ref": "#/envVarValue"}, + "dependsOn": {"$ref": "#/envVarDependsOn"} + }, + "required": ["value"] + }, + + "valueFromListItem": { + "oneOf": [ + {"$ref": "#/valueFromListItemExplicit"}, + {"$ref": "#/valueFromListItemImplicit"} + ] + }, + + "valueFromListItemExplicit": { + "type": "object", + "additionalProperties": false, + "properties": { + "name": {"type": "string"}, + "valueFrom": {"$ref": "#/valueFromOptions"} + }, + "required": ["name", "valueFrom"] + }, + + "valueFromListItemImplicit": { + "type": "object", + "additionalProperties": false, + "properties": { + "name": {"type": "string"}, + "fieldRef": {"$ref": "#/fieldRefSelector"}, + "resourceFieldRef": {"$ref": "#/resourceFieldRefSelector"}, + "secretKeyRef": {"$ref": "#/objectKeySelector"}, + "configMapKeyRef": {"$ref": "#/objectKeySelector"} + }, + "required": ["name"], + "dependencies": { + "fieldRef": { + "allOf": [ + {"not": {"required": ["resourceFieldRef"]}}, + {"not": {"required": ["secretKeyRef"]}}, + {"not": {"required": ["configMapKeyRef"]}} + ] + }, + "resourceFieldRef": { + "allOf": [ + {"not": {"required": ["fieldRef"]}}, + {"not": {"required": ["secretKeyRef"]}}, + {"not": {"required": ["configMapKeyRef"]}} + ] + }, + "secretKeyRef": { + "allOf": [ + {"not": {"required": ["fieldRef"]}}, + {"not": {"required": ["resourceFieldRef"]}}, + {"not": {"required": ["configMapKeyRef"]}} + ] + }, + "configMapKeyRef": { + "allOf": [ + {"not": {"required": ["fieldRef"]}}, + {"not": {"required": ["resourceFieldRef"]}}, + {"not": {"required": ["secretKeyRef"]}} + ] + } + } + }, + + "valueFromItem": { + "oneOf": [ + {"$ref": "#/valueFromItemExplicit"}, + {"$ref": "#/valueFromItemImplicit"} + ] + }, + + "valueFromItemExplicit": { + "type": "object", + "additionalProperties": false, + "properties": { + "valueFrom": {"$ref": "#/valueFromOptions"}, + "dependsOn": {"$ref": "#/envVarDependsOn"} + }, + "required": ["valueFrom"] + }, + + "valueFromItemImplicit": { + "type": "object", + "additionalProperties": false, + "properties": { + "fieldRef": {"$ref": "#/fieldRefSelector"}, + "resourceFieldRef": {"$ref": "#/resourceFieldRefSelector"}, + "secretKeyRef": {"$ref": "#/objectKeySelector"}, + "configMapKeyRef": {"$ref": "#/objectKeySelector"}, + "dependsOn": {"$ref": "#/envVarDependsOn"} + }, + "dependencies": { + "fieldRef": { + "allOf": [ + {"not": {"required": ["resourceFieldRef"]}}, + {"not": {"required": ["secretKeyRef"]}}, + {"not": {"required": ["configMapKeyRef"]}} + ] + }, + "resourceFieldRef": { + "allOf": [ + {"not": {"required": ["fieldRef"]}}, + {"not": {"required": ["secretKeyRef"]}}, + {"not": {"required": ["configMapKeyRef"]}} + ] + }, + "secretKeyRef": { + "allOf": [ + {"not": {"required": ["fieldRef"]}}, + {"not": {"required": ["resourceFieldRef"]}}, + {"not": {"required": ["configMapKeyRef"]}} + ] + }, + "configMapKeyRef": { + "allOf": [ + {"not": {"required": ["fieldRef"]}}, + {"not": {"required": ["resourceFieldRef"]}}, + {"not": {"required": ["secretKeyRef"]}} + ] + } + } + }, + + "valueFromOptions": { + "type": "object", + "oneOf": [ + {"$ref": "#/fieldRef"}, + {"$ref": "#/resourceFieldRef"}, + {"$ref": "#/secretKeyRef"}, + {"$ref": "#/configMapKeyRef"} + ] + }, + + "secretKeyRef": { + "type": "object", + "additionalProperties": false, + "properties": { + "secretKeyRef": {"$ref": "#/objectKeySelector"} + }, + "required": ["secretKeyRef"] + }, + + "configMapKeyRef": { + "type": "object", + "additionalProperties": false, + "properties": { + "configMapKeyRef": {"$ref": "#/objectKeySelector"} + }, + "required": ["configMapKeyRef"] + }, + + "fieldRef": { + "type": "object", + "additionalProperties": false, + "properties": { + "fieldRef": {"$ref": "#/fieldRefSelector"} + }, + "required": ["fieldRef"] + }, + + "fieldRefSelector": { + "type": "object", + "additionalProperties": false, + "properties": { + "apiVersion": { + "type": "string" + }, + "fieldPath": { + "type": "string" + } + }, + "required": ["fieldPath"] + }, + + "resourceFieldRef": { + "type": "object", + "additionalProperties": false, + "properties": { + "resourceFieldRef": {"$ref": "#/resourceFieldRefSelector"} + }, + "required": ["resourceFieldRef"] + }, + + "resourceFieldRefSelector": { + "type": "object", + "additionalProperties": false, + "properties": { + "containerName": { + "type": "string" + }, + "divisor": { + "oneOf": [{"type": "string"}, {"type": "number"}] + }, + "resource": { + "type": "string" + } + }, + "required": ["resource"] + }, + + "envVarDependsOn": { + "oneOf": [ + {"type": "string"}, + { + "type": "array", + "items": {"type": "string"} + } + ] + }, + + "objectKeySelector": { + "type": "object", + "additionalProperties": false, + "properties": { + "name": { + "type": "string" + }, + "key": { + "type": "string" + } + }, + "required": ["name", "key"] + } +} diff --git a/charts/library/common/templates/lib/service/_primary_port.tpl b/charts/library/common/templates/lib/service/_primary_port.tpl index d921be1a..9716847b 100644 --- a/charts/library/common/templates/lib/service/_primary_port.tpl +++ b/charts/library/common/templates/lib/service/_primary_port.tpl @@ -18,7 +18,9 @@ Return the primary port for a given Service object. {{- /* Return the first port if none has been explicitly marked as primary */ -}} {{- if not $result -}} {{- $firstPortKey := keys $enabledPorts | first -}} - {{- $result = get $enabledPorts $firstPortKey -}} + {{- if $firstPortKey -}} + {{- $result = get $enabledPorts $firstPortKey -}} + {{- end -}} {{- end -}} {{- $result | toYaml -}} diff --git a/charts/library/common/values.schema.json b/charts/library/common/values.schema.json index 58fb0fbb..9357760c 100644 --- a/charts/library/common/values.schema.json +++ b/charts/library/common/values.schema.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema", - "$id": "https://raw.githubusercontent.com/bjw-s/helm-charts/common-3.0.3/charts/library/common/values.schema.json", + "$id": "https://raw.githubusercontent.com/bjw-s/helm-charts/common-3.0.4/charts/library/common/values.schema.json", "type": "object", "properties": {