mirror of
https://github.com/rancher/os.git
synced 2025-07-10 21:33:04 +00:00
Merge pull request #269 from wlan0/bugfix5
remove default directory from tls generate cmd
This commit is contained in:
commit
3b374cb2c9
@ -1,6 +1,7 @@
|
||||
package control
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
@ -36,7 +37,7 @@ func tlsConfCommands() []cli.Command {
|
||||
cli.StringFlag{
|
||||
Name: "dir, d",
|
||||
Usage: "the directory to save/read the certs to/from",
|
||||
Value: "${HOME}/.docker",
|
||||
Value: "",
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -132,7 +133,10 @@ func generate(c *cli.Context) error {
|
||||
}
|
||||
|
||||
generateServer := c.Bool("server")
|
||||
outDir := os.ExpandEnv(c.String("dir"))
|
||||
outDir := c.String("dir")
|
||||
if outDir == "" {
|
||||
return fmt.Errorf("out directory (-d, --dir) not specified")
|
||||
}
|
||||
caCertPath := filepath.Join(outDir, "ca.pem")
|
||||
caKeyPath := filepath.Join(outDir, "ca-key.pem")
|
||||
certPath := filepath.Join(outDir, "cert.pem")
|
||||
|
Loading…
Reference in New Issue
Block a user