1
0
mirror of https://github.com/rancher/rke.git synced 2025-09-18 08:06:20 +00:00

Merge pull request #1540 from superseb/certsshagent

Make commonflags work with rke cert commands
This commit is contained in:
Dan Ramich
2019-08-15 15:30:17 -07:00
committed by GitHub

View File

@@ -15,6 +15,30 @@ import (
)
func CertificateCommand() cli.Command {
rotateFlags := []cli.Flag{
cli.StringFlag{
Name: "config",
Usage: "Specify an alternate cluster YAML file",
Value: pki.ClusterConfig,
EnvVar: "RKE_CONFIG",
},
cli.StringSliceFlag{
Name: "service",
Usage: fmt.Sprintf("Specify a k8s service to rotate certs, (allowed values: %s, %s, %s, %s, %s, %s)",
services.KubeAPIContainerName,
services.KubeControllerContainerName,
services.SchedulerContainerName,
services.KubeletContainerName,
services.KubeproxyContainerName,
services.EtcdContainerName,
),
},
cli.BoolFlag{
Name: "rotate-ca",
Usage: "Rotate all certificates including CA certs",
},
}
rotateFlags = append(rotateFlags, commonFlags...)
return cli.Command{
Name: "cert",
Usage: "Certificates management for RKE cluster",
@@ -23,29 +47,7 @@ func CertificateCommand() cli.Command {
Name: "rotate",
Usage: "Rotate RKE cluster certificates",
Action: rotateRKECertificatesFromCli,
Flags: []cli.Flag{
cli.StringFlag{
Name: "config",
Usage: "Specify an alternate cluster YAML file",
Value: pki.ClusterConfig,
EnvVar: "RKE_CONFIG",
},
cli.StringSliceFlag{
Name: "service",
Usage: fmt.Sprintf("Specify a k8s service to rotate certs, (allowed values: %s, %s, %s, %s, %s, %s)",
services.KubeAPIContainerName,
services.KubeControllerContainerName,
services.SchedulerContainerName,
services.KubeletContainerName,
services.KubeproxyContainerName,
services.EtcdContainerName,
),
},
cli.BoolFlag{
Name: "rotate-ca",
Usage: "Rotate all certificates including CA certs",
},
},
Flags: rotateFlags,
},
cli.Command{
Name: "generate-csr",