diff --git a/fluent-logging/templates/bin/_helm-tests.sh.tpl b/fluent-logging/templates/bin/_helm-tests.sh.tpl index e9875b5a1..e345ad411 100644 --- a/fluent-logging/templates/bin/_helm-tests.sh.tpl +++ b/fluent-logging/templates/bin/_helm-tests.sh.tpl @@ -46,6 +46,7 @@ function check_kubernetes_tag () { fi } +{{ if and (.Values.manifests.job_elasticsearch_template) (not (empty .Values.conf.templates)) }} # Tests whether fluent-logging has successfully generated the elasticsearch index mapping # templates defined by values.yaml function check_templates () { @@ -61,9 +62,12 @@ function check_templates () { fi {{ end }} } +{{ end }} # Sleep for at least the buffer flush time to allow for indices to be populated sleep 30 +{{ if and (.Values.manifests.job_elasticsearch_template) (not (empty .Values.conf.templates)) }} check_templates +{{ end }} check_logstash_index check_kubernetes_tag diff --git a/fluent-logging/templates/job-elasticsearch-template.yaml b/fluent-logging/templates/job-elasticsearch-template.yaml index e766163be..21c71919e 100644 --- a/fluent-logging/templates/job-elasticsearch-template.yaml +++ b/fluent-logging/templates/job-elasticsearch-template.yaml @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */}} -{{- if .Values.manifests.job_elasticsearch_template }} +{{- if and (.Values.manifests.job_elasticsearch_template) (not (empty .Values.conf.templates)) }} {{- $envAll := . }} {{- $esUserSecret := .Values.secrets.elasticsearch.user }} {{- $mounts_elasticsearch_template := .Values.pod.mounts.elasticsearch_template.elasticsearch_template }}