mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-30 09:51:23 +00:00
fix issue with multiline configmap data with extra space
This commit is contained in:
@@ -292,8 +292,10 @@ metadata:
|
||||
---
|
||||
apiVersion: v1
|
||||
data:
|
||||
nonsense: "Lorem ipsum dolor sit amet, consectetur\nadipiscing elit, sed do eiusmod
|
||||
tempor\nincididunt ut labore et dolore magna aliqua. \n"
|
||||
nonsense: |
|
||||
Lorem ipsum dolor sit amet, consectetur
|
||||
adipiscing elit, sed do eiusmod tempor
|
||||
incididunt ut labore et dolore magna aliqua.
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
annotations:
|
||||
@@ -302,6 +304,6 @@ metadata:
|
||||
app: mungebot
|
||||
org: kubernetes
|
||||
repo: test-infra
|
||||
name: test-infra-app-config-49d6f5h7b5
|
||||
name: test-infra-app-config-4thktg822m
|
||||
`)
|
||||
}
|
||||
|
||||
@@ -593,15 +593,18 @@ bla
|
||||
th.AssertActualEqualsExpected(
|
||||
m, `apiVersion: v1
|
||||
data:
|
||||
cfg.text: "bla\nbla\nbla \n"
|
||||
cfg.text: |
|
||||
bla
|
||||
bla
|
||||
bla
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: config_bla-d6m295b8c5
|
||||
name: config_bla-4k548khbf5
|
||||
`)
|
||||
}
|
||||
|
||||
// regression test to record the behavior prior to the fix for https://github.com/kubernetes-sigs/kustomize/issues/4287
|
||||
// so that the fix does not affect leading and trailing newlines in ConfigMap data
|
||||
// to ensure that the fix does not affect leading and trailing newlines in ConfigMap data
|
||||
func TestMultilineDataEndsLeadingAndTrailingNewlines(t *testing.T) {
|
||||
th := kusttest_test.MakeHarness(t)
|
||||
th.WriteK(".", `
|
||||
|
||||
Reference in New Issue
Block a user