{{- if not (eq (toString .Values.extraConfigMapMounts) "<nil>") }}
[WARNING] "extraConfigMapMounts" parameter is deprecated, please use "extraVolumes" or "extraVolumesMounts" instead.
{{ end }}

{{- if not (eq (toString .Values.extraHostPathMounts) "<nil>") }}
[WARNING] "extraHostPathMounts" parameter is deprecated, please use "extraVolumes" or "extraVolumesMounts" instead.
{{ end }}

{{- if not (eq (toString .Values.secretMounts) "<nil>") }}
[WARNING] "secretMounts" parameter is deprecated, please use "extraVolumes" or "extraVolumeMounts" instead.
{{ end }}

{{- if and (not (eq .Values.mode "daemonset")) (not (eq .Values.mode "deployment")) (not (eq .Values.mode "statefulset")) }}
{{ fail "[ERROR] 'mode' must be set. See https://github.com/open-telemetry/opentelemetry-helm-charts/blob/main/charts/opentelemetry-collector/UPGRADING.md for instructions." }}
{{ end }}

{{- if not .Values.configMap.create }}
[WARNING] "configMap" wil not be created and "config" will not take effect.
{{ end }}

{{- if not (eq (toString .Values.containerLogs) "<nil>") }}
[WARNING] 'containerLogs' is deprecated.  Use 'presets.logsCollection' instead. See https://github.com/open-telemetry/opentelemetry-helm-charts/blob/main/charts/opentelemetry-collector/UPGRADING.md#0231-to-0240 for instructions on how to migrate.
{{ end }}

[INFO] as of chart version 0.47.0 the default collector configuration has been updated to use pod IP instead of 0.0.0.0 for its endpoints. See https://github.com/open-telemetry/opentelemetry-helm-charts/blob/main/charts/opentelemetry-collector/UPGRADING.md#0460-to-0470 for details.

{{- if .Values.presets.clusterMetrics.enabled }}
{{- if eq .Values.mode "daemonset"}}
{{- fail "Cluster Metrics preset is not suitable for daemonset mode. Please use statefulset or deployment mode with replicaCount: 1"}}
{{ end }}
{{- if gt (int .Values.replicaCount) 1 }}
{{- fail "Cluster Metrics preset is not suitable for replicaCount greater than one. Please change replica count to one." }}
{{ end }}
{{ end }}
