mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-29 17:41:13 +00:00
fix issue with multiline configmap data with extra space
This commit is contained in:
@@ -5,6 +5,7 @@ package generators
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/go-errors/errors"
|
||||
"sigs.k8s.io/kustomize/api/ifc"
|
||||
@@ -50,7 +51,11 @@ func makeValidatedDataMap(
|
||||
return nil, errors.Errorf(
|
||||
"configmap %s illegally repeats the key `%s`", name, p.Key)
|
||||
}
|
||||
knownKeys[p.Key] = p.Value
|
||||
lines := strings.Split(p.Value, "\n")
|
||||
for i := range lines {
|
||||
lines[i] = strings.TrimSuffix(lines[i], " ")
|
||||
}
|
||||
knownKeys[p.Key] = strings.Join(lines, "\n")
|
||||
}
|
||||
return knownKeys, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user