peleg
peleg

Reputation: 51

"Key is duplicated" error in yaml when used in if-else statement

I'm using an if-else statement inside my deployment.yaml to determine which key to use from my values.yaml file, in the following way:

{{ - if .Values.some_key}}
          some_key:
{{ toYaml .Values.some_key| indent 12 }}
{{ else if .Values.global.some_key}}
          some_key:
{{ toYaml .Values.global.some_key| indent 12 }}
{{ - end }}

I got a "Key 'some_key' is duplicated" error from IntelliJ, and was wondering what is the correct way of using the condition in this situation.

Upvotes: 1

Views: 1502

Answers (1)

peleg
peleg

Reputation: 51

I was able to remove IntelliJ's errors by installing the Go Template plugin and the Kubernetes plugin for Intellij.

Upvotes: 2

Related Questions