Skip to content

helm_resource is broken when indentation of metadata is 4 spaces #662

@ahrakos

Description

@ahrakos

In namespacing.py we try to add the namespace to the resources we get from helm get manifest command.
The thing is this code does regex manipulation, and although 4 spaces indentation in yaml is supported in k8s/helm syntax, in our code we do not respect this.

This causes issues around deploying namespaced helm charts that have 4 spaces indentations in the metadata section.

e.g.

apiVersion: v1
kind: Service
metadata:
    name:       test-service
    labels:
        app:                test-app
        component:          test-component
    annotations:
        example.com/app: 
        example.com/env: test

in this case we will add the namespace after 2 indentations inside the metadata section, thus creating a malformed yaml structure.

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