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

configMapGenerator: single quote removed from config map literal if quote is last character #4233

Closed
mloesch opened this issue Oct 12, 2021 · 2 comments · Fixed by #4242
Closed
Labels
kind/bug Categorizes issue or PR as related to a bug. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@mloesch
Copy link

mloesch commented Oct 12, 2021

Describe the bug

When defining a literal value in configMapGenerator where the last character is a single quote, the last character is removed by kustomize build.

Files that can reproduce the issue

kustomization.yaml

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
configMapGenerator:
  - name: test
    literals:
      - TEST=this is a 'test'

Expected output

apiVersion: v1
data:
  TEST: this is a 'test'
kind: ConfigMap
metadata:
  name: test-k7hhfb697g

Actual output

apiVersion: v1
data:
  TEST: this is a 'test
kind: ConfigMap
metadata:
  name: test-k7hhfb697g

The trailing single quote is missing.

Note: if the single quote is not the last character, it works as expected:

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
configMapGenerator:
  - name: test
    literals:
      - TEST=this is a 'test'.

Yields:

apiVersion: v1
data:
  TEST: this is a 'test'.
kind: ConfigMap
metadata:
  name: test-2b7bkd58k5

Kustomize version

{Version:kustomize/v4.4.0 GitCommit:63ec6bdb3d737a7c66901828c5743656c49b60e1 BuildDate:2021-09-27T16:24:12Z GoOs:linux GoArch:amd64}

Platform

Linux

@mloesch mloesch added the kind/bug Categorizes issue or PR as related to a bug. label Oct 12, 2021
@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Oct 12, 2021
@natasha41575
Copy link
Contributor

I am able to reproduce the issue, thank you for filing it. We will look into it when we can.

/triage accepted

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Oct 15, 2021
@ephesused
Copy link
Contributor

The fix for this one looks to have addressed another use case:

  literals: 
  - |
    sentence="Here we see the issue.

With v4.4.1:

  sentence: |
    "Here we see the issue.

Prior to v4.4.1:

  sentence: |
    Here we see the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants