mirror of
https://github.com/pgsty/minio.git
synced 2026-07-19 04:00:25 +03:00
trim values from envrionment files (#13991)
trim values to remove any spaces, newlines from the files while importing credentials and other values.
This commit is contained in:
+4
-2
@@ -19,6 +19,7 @@ package cmd
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"bytes"
|
||||
"context"
|
||||
"crypto/tls"
|
||||
"crypto/x509"
|
||||
@@ -456,7 +457,8 @@ func (e envKV) String() string {
|
||||
}
|
||||
|
||||
func parsEnvEntry(envEntry string) (envKV, error) {
|
||||
if strings.TrimSpace(envEntry) == "" {
|
||||
envEntry = strings.TrimSpace(envEntry)
|
||||
if envEntry == "" {
|
||||
// Skip all empty lines
|
||||
return envKV{
|
||||
Skip: true,
|
||||
@@ -529,7 +531,7 @@ func readFromSecret(sp string) (string, error) {
|
||||
}
|
||||
return "", err
|
||||
}
|
||||
return string(credBuf), nil
|
||||
return string(bytes.TrimSpace(credBuf)), nil
|
||||
}
|
||||
|
||||
func loadEnvVarsFromFiles() {
|
||||
|
||||
Reference in New Issue
Block a user