Skip to content

Commit

Permalink
consolidate var name $envs -> $env
Browse files Browse the repository at this point in the history
  • Loading branch information
jvoravong committed Oct 3, 2023
1 parent ab9e0c2 commit d6aede0
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,18 +102,18 @@ Helper to define entries for instrumentation libraries.
{{- end -}}

{{/*
Helper to check if envs (list of dictionaries) has an env (dictionary) with a specific name.
- Takes a list of dictionaries (envs) and a string (envName).
Helper to check if env (list of dictionaries) has an env (dictionary) with a specific name.
- Takes a list of dictionaries (env) and a string (envName).
- Returns "true" if a dictionary in the list has a 'name' key that matches envName, otherwise "false".
*/}}
{{- define "splunk-otel-collector.operator.env-has" -}}
{{- /* Extract parameters */ -}}
{{- $envs := default list .env -}}
{{- $env := default list .env -}}
{{- $envName := .envName -}}
{{- $found := false -}}

{{- /* Check if envName exists in the list of dictionaries */ -}}
{{- range $envs -}}
{{- range $env -}}
{{- if eq .name $envName -}}
{{- $found = true -}}
{{- end -}}
Expand Down

0 comments on commit d6aede0

Please sign in to comment.