1
0
mirror of https://github.com/rancher/os.git synced 2025-09-16 23:21:19 +00:00
This commit is contained in:
Darren Shepherd
2015-02-23 12:00:33 -07:00
parent dac9b7e21e
commit 1c5ac9f410
5 changed files with 50 additions and 50 deletions

View File

@@ -1,4 +1,4 @@
package control
package control
import (
"fmt"
@@ -10,32 +10,32 @@ import (
)
func tlsConfCommands() []cli.Command {
return []cli.Command {
return []cli.Command{
{
Name: "create",
Usage: "use it to create a new set of tls configuration certs and keys or upload existing ones",
Name: "create",
Usage: "use it to create a new set of tls configuration certs and keys or upload existing ones",
Action: tlsConfCreate,
Flags: []cli.Flag {
cli.StringFlag {
Name: "cakey",
Flags: []cli.Flag{
cli.StringFlag{
Name: "cakey",
Usage: "path to existing certificate authority key (only use with --generate)",
},
cli.StringFlag {
Name: "ca",
cli.StringFlag{
Name: "ca",
Usage: "path to existing certificate authority (only use with --genreate)",
},
cli.BoolFlag {
Name: "generate, g",
cli.BoolFlag{
Name: "generate, g",
Usage: "generate the client key and client cert from existing ca and cakey",
},
cli.StringFlag {
Name: "outDir, o",
cli.StringFlag{
Name: "outDir, o",
Usage: "the output directory to save the generated certs or keys",
},
},
},
}
}
}
func tlsConfCreate(c *cli.Context) {
name := "rancher"
@@ -52,18 +52,18 @@ func tlsConfCreate(c *cli.Context) {
if val := c.String("outDir"); val != "" {
outDir = val
}
if c.Bool("generate") {
generateCaCerts = false
}
if val := c.String("cakey"); val != "" {
inputCaKey = val
}
if val := c.String("ca"); val != "" {
inputCaCert = val
}
}
caCertPath = filepath.Join(outDir, caCertPath)
caKeyPath = filepath.Join(outDir, caKeyPath)
@@ -100,7 +100,6 @@ func tlsConfCreate(c *cli.Context) {
serverKeyPath = "client-key.pem"
}
serverCertPath = filepath.Join(outDir, serverCertPath)
serverKeyPath = filepath.Join(outDir, serverKeyPath)