bases:
 - ../envs/environments.yaml.gotmpl

repositories:
- name: open-telemetry
  url: https://open-telemetry.github.io/opentelemetry-helm-charts

commonLabels:
  tier: system

releases:
- name: opentelemetry-collector
  namespace: otel
  chart: open-telemetry/opentelemetry-collector
  version: 0.134.1
  condition: otel.enabled
  values:
  - ../values/opentelemetry-collector/values/values.yaml
  - ../values/opentelemetry-collector/values/values-{{ .Environment.Name }}.yaml
  postRenderer: ../bin/kustomizer
  postRendererArgs:
  - ../values/opentelemetry-collector/kustomize/{{ .Environment.Name }}
  missingFileHandler: Info
- name: manifests
  namespace: otel
  chart: manifests
  condition: otel.enabled
  missingFileHandler: Info
  values:
  - ../values/env.yaml
  - ../values/env-{{ requiredEnv "ARGOCD_ENV_CLUSTER_NAME" }}.yaml
  - ../values/opentelemetry-collector/env.yaml.gotmpl
  - ../values/opentelemetry-collector/env-{{ requiredEnv "ARGOCD_ENV_CLUSTER_NAME" }}.yaml.gotmpl
  hooks:
  - events: [ prepare, cleanup ]
    showlogs: true
    command: ../bin/helmify
    args:
    - '{{`{{ if eq .Event.Name "prepare" }}build{{ else }}clean{{ end }}`}}'
    - '{{`{{ .Release.Chart }}`}}'
    - '{{`{{ .Environment.Name }}`}}'
    - ../values/opentelemetry-collector/manifests
    - manifests
