diff --git a/charts/consul/test/unit/client-daemonset.bats b/charts/consul/test/unit/client-daemonset.bats index 9338e99faf..c2d22a8ae8 100755 --- a/charts/consul/test/unit/client-daemonset.bats +++ b/charts/consul/test/unit/client-daemonset.bats @@ -238,6 +238,27 @@ load _helpers [ "${actual}" = "bar" ] } +#-------------------------------------------------------------------- +# extra-config + +@test "client/DaemonSet: has extra-config volume" { + cd `chart_dir` + + # check that the extra-config volume is defined + local volume_name=$(helm template \ + -s templates/client-daemonset.yaml \ + . | tee /dev/stderr | + yq -r '.spec.template.spec.volumes[] | select(.name == "extra-config") | .name' | tee /dev/stderr) + [ "${volume_name}" = "extra-config" ] + + # check that the consul container mounts the volume at /consul/extra-config + local mount_path=$(helm template \ + -s templates/client-daemonset.yaml \ + . | tee /dev/stderr | + yq -r '.spec.template.spec.containers[] | select(.name == "consul") | .volumeMounts[] | select(.name == "extra-config") | .mountPath' | tee /dev/stderr) + [ "${mount_path}" = "/consul/extra-config" ] +} + #-------------------------------------------------------------------- # extraVolumes diff --git a/charts/consul/test/unit/server-statefulset.bats b/charts/consul/test/unit/server-statefulset.bats index 5e40fb7d2a..59ee8256d7 100755 --- a/charts/consul/test/unit/server-statefulset.bats +++ b/charts/consul/test/unit/server-statefulset.bats @@ -348,6 +348,27 @@ load _helpers yq -r '.spec.template.spec.containers[0].command' | tee /dev/stderr) } +#-------------------------------------------------------------------- +# extra-config + +@test "server/StatefulSet: has extra-config volume" { + cd `chart_dir` + + # check that the extra-config volume is defined + local volume_name=$(helm template \ + -s templates/server-statefulset.yaml \ + . | tee /dev/stderr | + yq -r '.spec.template.spec.volumes[] | select(.name == "extra-config") | .name' | tee /dev/stderr) + [ "${volume_name}" = "extra-config" ] + + # check that the consul container mounts the volume at /consul/extra-config + local mount_path=$(helm template \ + -s templates/server-statefulset.yaml \ + . | tee /dev/stderr | + yq -r '.spec.template.spec.containers[] | select(.name == "consul") | .volumeMounts[] | select(.name == "extra-config") | .mountPath' | tee /dev/stderr) + [ "${mount_path}" = "/consul/extra-config" ] +} + #-------------------------------------------------------------------- # extraVolumes