Skip to content

Commit 7ff4789

Browse files
author
David Wertenteil
authored
Merge pull request #22 from kubescape/load-creds
trim newline
2 parents 4d59ffa + 741ad2d commit 7ff4789

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pkg/utils/credentials.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package utils
33
import (
44
"fmt"
55
"os"
6+
"strings"
67
)
78

89
const (
@@ -29,10 +30,10 @@ func LoadCredentialsFromFile(secretPath string) (*Credentials, error) {
2930

3031
t := &Credentials{}
3132
if accessKey, err := os.ReadFile(accessKeyPath); err == nil {
32-
t.AccessKey = string(accessKey)
33+
t.AccessKey = strings.TrimSuffix(string(accessKey), "\n")
3334
}
3435
if account, err := os.ReadFile(accountPath); err == nil {
35-
t.Account = string(account)
36+
t.Account = strings.TrimSuffix(string(account), "\n")
3637
}
3738

3839
return t, nil

0 commit comments

Comments
 (0)