Skip to content

Fix YAML parse error in service-secret.yaml template#54

Merged
dkrizic merged 2 commits intomainfrom
copilot/fix-helm-chart-issue
Jan 26, 2026
Merged

Fix YAML parse error in service-secret.yaml template#54
dkrizic merged 2 commits intomainfrom
copilot/fix-helm-chart-issue

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 26, 2026

Helm deployment was failing with "did not find expected key" error on line 13 of service-secret.yaml.

Change

Moved template variable assignment before the data: key. YAML requires mapping keys to be immediately followed by values or child key-value pairs, not non-output-producing template directives.

Before:

type: Opaque
data:
  {{- $password := .Values.service.authentication.password }}
  {{- if and $existingSecret $existingSecret.data ... }}

After:

type: Opaque
{{- $password := .Values.service.authentication.password }}
data:
  {{- if and $existingSecret $existingSecret.data ... }}
Original prompt

This section details on the original issue you should resolve

<issue_title>Unable to fix helm chart</issue_title>
<issue_description>╷
│ Error: Error upgrading chart

│ with helm_release.frontend-feature,
│ on frontend-feature.tf line 1, in resource "helm_release" "frontend-feature":
│ 1: resource "helm_release" "frontend-feature" {

│ Upgrade failed: YAML parse error on feature/templates/service-secret.yaml:
│ error converting YAML to JSON: yaml: line 13: did not find expected key

Releasing state lock. This may take a few moments...
Error: OpenTofu exited with code 1.
Error: Process completed with exit code 1.</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…ment before data key

Co-authored-by: dkrizic <1181349+dkrizic@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix helm chart upgrade error for frontend feature Fix YAML parse error in service-secret.yaml template Jan 26, 2026
Copilot AI requested a review from dkrizic January 26, 2026 17:26
@dkrizic dkrizic marked this pull request as ready for review January 26, 2026 17:28
@dkrizic dkrizic merged commit 5ada606 into main Jan 26, 2026
3 checks passed
@dkrizic dkrizic deleted the copilot/fix-helm-chart-issue branch January 26, 2026 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to fix helm chart

2 participants