loki icon indicating copy to clipboard operation
loki copied to clipboard

Loki helm chart validation fails when schemaConfig isn't provided and managing own config

Open eg-ayoub opened this issue 4 months ago • 1 comments

Describe the bug When trying to render the chart, with the value generatedConfigObjectName set to an empty string, the rendering fails with an execution error in validate.yaml The chart expects to set a value for schemaConfig even if it won´t be used.

To Reproduce Steps to reproduce the behavior:

  1. fetched the chart
  2. in a separate values file, set loki.generatedConfigObjectName: "", don't set schemaConfig or useTestSchema. Don't use structuredConfig
  3. generate the manifests from the chart.
  4. result:
Error: execution error at (loki/templates/validate.yaml:40:4): You must provide a schema_config for Loki, one is not provided as this will be individual for every Loki cluster. See https://grafana.com/docs/loki/latest/operations/storage/schema/ for schema information. For quick testing (with no persistence) add `--set loki.useTestSchema=true` 

Expected behavior a rendered chart without any config objects.

Environment:

  • Infrastructure: laptop
  • Deployment tool: helm

Screenshots, Promtail config, or terminal output snippet from validate.yaml

{{- if and (empty .Values.loki.schemaConfig) (empty .Values.loki.structuredConfig.schema_config) (not .Values.loki.useTestSchema) }}
{{- fail "You must provide a schema_config for Loki, one is not provided as this will be individual for every Loki cluster. See https://grafana.com/docs/loki/latest/operations/storage/schema/ for schema information. For quick testing (with no persistence) add `--set loki.useTestSchema=true`"}}
{{- end }}

does not take into account case where we want to use an existing CM for config, stated in values.yaml:

# 3. Use an existing secret or configmap to provide the configuration.
  #    This option is mostly provided for folks who have external processes which provide or modify the configuration.
  #    When using this option you can specify a different name for loki.generatedConfigObjectName and configObjectName
  #    if you have a process which takes the generated config and modifies it, or you can stop the chart from generating
  #    a config entirely by setting loki.generatedConfigObjectName to

eg-ayoub avatar Oct 16 '24 08:10 eg-ayoub