Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YAML document start marker causes WARNING: environments and releases cannot be defined within the same YAML part #1093

Closed
jim-barber-he opened this issue Oct 24, 2023 · 1 comment · Fixed by #1094
Assignees

Comments

@jim-barber-he
Copy link
Contributor

Operating system

Debian stable (12 bookworm)

Helmfile Version

0.158.0

Helm Version

v3.13.1

Bug description

I have found that having the leading document start marker --- in helmfile.yaml is causing the following warning even though the environment section is separated from the other sections.

WARNING: environments and releases cannot be defined within the same YAML part. Use --- to extract the environments into a dedicated part

Removing the first document start marker solves it, however tools like yamllint expect that to be there by default (for example).

So this causes the warning:

---
environments:
  ...
---
releases:
  ...

While this does not.

environments:
  ...
---
releases:
  ...

Example helmfile.yaml

---
environments:
  prod:
  test:

---
helmDefaults:
  atomic: true
  cleanupOnFail: true
  createNamespace: false

releases:
  - name: sre
    chart: ./helm/charts/sre
    labels:
      app: sre
    namespace: {{ env "RELEASE_NAMESPACE" | default "sre" }}
    values:
      - helm/vars/cronjobs.yaml.gotmpl
      - helm/vars/values.yaml.gotmpl

  - name: system-reserved-resources
    chart: ./helm/charts/system-reserved-resources
    labels:
      app: sre
    namespace: {{ env "RELEASE_NAMESPACE" | default "sre" }}
    values:
      - helm/vars/system-reserved.yaml.gotmpl

Error message you've seen (if any)

WARNING: environments and releases cannot be defined within the same YAML part. Use --- to extract the environments into a dedicated part

Steps to reproduce

Details above

Working Helmfile Version

Whatever version before this warning was added to prepare for helmfile v1.

Relevant discussion

No response

@yxxhero yxxhero self-assigned this Oct 24, 2023
@yxxhero
Copy link
Member

yxxhero commented Oct 25, 2023

@yxxhero thanks for your issue. I will post a PR as soon as I can.

@yxxhero yxxhero linked a pull request Oct 25, 2023 that will close this issue
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 a pull request may close this issue.

2 participants