Skip to content

Commit

Permalink
Do not call filepath.Abs if the path is empty (#3539)
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Plourde <[email protected]>
  • Loading branch information
Simon Plourde authored Jan 31, 2020
1 parent 9c0a793 commit 40b1d59
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions cli/client/config/basic/writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,15 @@ func (c *Config) SaveTokens(tokens *types.Tokens) error {

// SaveTrustedCAFile saves the Trusted CA file
func (c *Config) SaveTrustedCAFile(file string) error {
absolute, err := filepath.Abs(file)
if err != nil {
return err
if file != "" {
absolute, err := filepath.Abs(file)
if err != nil {
return err
}
c.Cluster.TrustedCAFile = absolute
} else {
c.Cluster.TrustedCAFile = ""
}
c.Cluster.TrustedCAFile = absolute

return write(c.Cluster, filepath.Join(c.path, clusterFilename))
}
Expand Down

0 comments on commit 40b1d59

Please sign in to comment.