Skip to content

Commit

Permalink
Merge pull request #22 from kubescape/load-creds
Browse files Browse the repository at this point in the history
trim newline
  • Loading branch information
David Wertenteil committed Jan 16, 2024
2 parents 4d59ffa + 741ad2d commit 7ff4789
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/utils/credentials.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package utils
import (
"fmt"
"os"
"strings"
)

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

t := &Credentials{}
if accessKey, err := os.ReadFile(accessKeyPath); err == nil {
t.AccessKey = string(accessKey)
t.AccessKey = strings.TrimSuffix(string(accessKey), "\n")
}
if account, err := os.ReadFile(accountPath); err == nil {
t.Account = string(account)
t.Account = strings.TrimSuffix(string(account), "\n")
}

return t, nil
Expand Down

0 comments on commit 7ff4789

Please sign in to comment.