Skip to content

v1.5.2 incorrectly parses contents of scalar and can fail installs with parsing errors #1441

Description

@cayla

Hi,

Love flux. Thank you for all you do.

Yesterday, we picked up the last flux2 release that includes helm-controller v1.5.2.

All of our charts that have new relic enabled started failing. Removing the new relic configmap resolved the failures. Re-enabling and downgrading just helm-controller to 1.5.1 also resolved the failures.

I know this release also upgraded helm to 4.13, but we have exhaustively tested with helm direct deploys and cannot recreate. This does seem specific to helm-controller.

The install error is:

  Warning  InstallFailed     7s (x5 over 19s)  helm-controller  Helm install failed for release developers-portal-stg/debug with chart [email protected]: error merging manifests: parsing developers-portal/templates/configmap-newrelic.yaml: wrong node kind: expected MappingNode but got SequenceNode: node contents:
[newrelic]

In our case, the problem was the content of the file.

I created a minimal reproduction with:

apiVersion: v1
kind: ConfigMap
metadata:
  name: developers-portal-newrelic-conf
  namespace: developers-portal-stg
data:
  newrelic.ini: |
    # ---------------------------------------------------------------------------

    #
    # This file configures the New Relic Python Agent.
    #
    # The path to the configuration file should be supplied to the function
    # newrelic.agent.initialize() when the agent is being initialized.
    #
    # The configuration file follows a structure similar to what you would
    # find for Microsoft Windows INI files. For further information on the
    # configuration file format see the Python ConfigParser documentation at:
    #
    #    http://docs.python.org/library/configparser.html
    #
    # For further discussion on the behaviour of the Python agent that can
    # be configured via this configuration file see:
    #
    #    http://newrelic.com/docs/python/python-agent-configuration
    #

    # ---------------------------------------------------------------------------

    # Here are the settings that are common to all environments.

    [newrelic]

    # You must specify the license key associated with your New
    # Relic account. This key binds the Python Agent's data to your
    # account in the New Relic service.
    # (Secret set in NEW_RELIC_LICENSE_KEY instead of here)

    # .. snipped for brevity

    # ---------------------------------------------------------------------------

If I remove these:

# ---------------------------------------------------------------------------

Then it works.

So this seems related to

Fix the Go templates bug of YAML separator --- getting concatenated to apiVersion: by updating to Helm 4.1.3 (helm-controller)

Except I can't reproduce it directly with Helm.

And in any case, I would have thought that scalars would be exempt for any checking regardless.

So, I have a workaround, but wanted to file a bug to help better understand the issue and leave a crumb for anyone else in the same situation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions