Otavio Tarelho
Otavio Tarelho

Reputation: 3

Helm MergeOverride failing to merge

I'm currently working on a project where we have many cron jobs using helm templates. I need to update two of these templates to have a different schedule.

All of them have the same structure at the begining:

{{- $refreshJobContext := deepCopy . -}}
{{- $_ := mergeOverwrite $refreshJobContext.Values (.Values.refreshJob | default dict) -}}
{{- include "spring.values.setup" $refreshJobContext }}

The value dict refreshJob is on values.yaml with the following structure:

refreshJob:
  controller:
    schedule: "*/15 * * * *"
    activeDeadlineSeconds: 840

I created another one with the schedule that I want to have on my new jobs, with the following structure:

refreshJobOverride:
  refreshJob:
    controller:
      schedule: "30 */2 * * *"
      activeDeadlineSeconds: 840

I expected to change .Values.refreshJob on my template to .Values.refreshJobOverride.refreshJob. However, when it tries to deploy on argo. I get:

Error: YAML parse error on /templates/new-template.yaml: error converting YAML to JSON: yaml: line 24: did not find expected key Use --debug flag to render out invalid YAML

I already ran the lint and helm template command and it didn't return any error and the yaml looks similar to the previous one, so I couldn't figure out what is the problem and how to resolve it.

Upvotes: 0

Views: 16

Answers (0)

Related Questions