mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-14 10:30:59 +00:00
Do not modify CM and Secrets Generator
This commit is contained in:
@@ -9,7 +9,6 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path"
|
||||
"regexp"
|
||||
"strings"
|
||||
"unicode"
|
||||
"unicode/utf8"
|
||||
@@ -86,17 +85,11 @@ func (kvl *loader) keyValuesFromFileSources(sources []string) ([]types.Pair, err
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
kvs = append(kvs, types.Pair{Key: k, Value: trimTrailingSpacesInLines(string(content))})
|
||||
kvs = append(kvs, types.Pair{Key: k, Value: string(content)})
|
||||
}
|
||||
return kvs, nil
|
||||
}
|
||||
|
||||
// trimTrailingSpacesInLines takes string with multiple lines and trims the trailing white spaces and tabs from each line.
|
||||
func trimTrailingSpacesInLines(str string) string {
|
||||
re := regexp.MustCompile(`[ \t]*\n`)
|
||||
return re.ReplaceAllString(str, "\n")
|
||||
}
|
||||
|
||||
func (kvl *loader) keyValuesFromEnvFiles(paths []string) ([]types.Pair, error) {
|
||||
var kvs []types.Pair
|
||||
for _, p := range paths {
|
||||
|
||||
Reference in New Issue
Block a user