Make commonflags work with rke cert commands
@@ -15,15 +15,7 @@ import (
)
func CertificateCommand() cli.Command {
- return cli.Command{
- Name: "cert",
- Usage: "Certificates management for RKE cluster",
- Subcommands: cli.Commands{
- cli.Command{
- Name: "rotate",
- Usage: "Rotate RKE cluster certificates",
- Action: rotateRKECertificatesFromCli,
- Flags: []cli.Flag{
+ rotateFlags := []cli.Flag{
cli.StringFlag{
Name: "config",
Usage: "Specify an alternate cluster YAML file",
@@ -45,7 +37,17 @@ func CertificateCommand() cli.Command {
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",
+ Subcommands: cli.Commands{
+ cli.Command{
+ Name: "rotate",
+ Usage: "Rotate RKE cluster certificates",
+ Action: rotateRKECertificatesFromCli,
+ Flags: rotateFlags,
},
cli.Command{
Name: "generate-csr",
