Skip to content

Line breaks on long strings with spaces #947

@maxhomann

Description

@maxhomann

When combining helm templates with kustomize overlays, a line break is inserted when the line is very long and contains spaces.

Tested versions: 2.0.1 and 2.0.3
Using test/base.yml:

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: test
  labels:
    app.version: "{{ .Values.services.mariadb.app.version }}"
spec:
  template:
    spec:
      containers:
      - name: mariadb
        image: "thisIsAReallyLongRepositoryLinkThatResultsInALineBreakWhenBuildingWithKustomize/mariadb:{{ .Values.services.mariadb.image.version }}"

and test/kustomization.yml

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- base.yml

results in

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  labels:
    app.version: '{{ .Values.services.mariadb.app.version }}'
  name: test
spec:
  template:
    spec:
      containers:
      - image: thisIsAReallyLongRepositoryLinkThatResultsInALineBreakWhenBuildingWithKustomize/mariadb:{{
          .Values.services.mariadb.image.version }}
        name: mariadb

Expected Behavior:

  • Line without line break
  • Also, the string/quoted value of the image name in base.yml is converted to an unqouted value on build while the app.version label is enclosed in single quotes. I would expect that either the quotes are not removed at all or the quoting behavior is constant

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/kyamlissues for kyamlkind/api-changeCategorizes issue or PR as related to adding, removing, or otherwise changing an APIkind/bugCategorizes issue or PR as related to a bug.needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions