mirror of
https://github.com/k3s-io/k3s.git
synced 2024-06-07 19:41:36 +00:00
118a68c913
* Consolidate data dir flag * Group cluster flags together * Reorder and group agent flags * Add additional info around vmodule flag * Hide deprecated flags, and add warning about their removal Signed-off-by: Derek Nola <derek.nola@suse.com>
49 lines
1.2 KiB
Go
49 lines
1.2 KiB
Go
package cmds
|
|
|
|
import (
|
|
"github.com/k3s-io/k3s/pkg/version"
|
|
"github.com/urfave/cli"
|
|
)
|
|
|
|
const CertCommand = "certificate"
|
|
|
|
var (
|
|
ServicesList cli.StringSlice
|
|
CertCommandFlags = []cli.Flag{
|
|
DebugFlag,
|
|
ConfigFlag,
|
|
LogFile,
|
|
AlsoLogToStderr,
|
|
DataDirFlag,
|
|
cli.StringSliceFlag{
|
|
Name: "service,s",
|
|
Usage: "List of services to rotate certificates for. Options include (admin, api-server, controller-manager, scheduler, " + version.Program + "-controller, " + version.Program + "-server, cloud-controller, etcd, auth-proxy, kubelet, kube-proxy)",
|
|
Value: &ServicesList,
|
|
},
|
|
}
|
|
)
|
|
|
|
func NewCertCommand(subcommands []cli.Command) cli.Command {
|
|
return cli.Command{
|
|
Name: CertCommand,
|
|
Usage: "Certificates management",
|
|
SkipFlagParsing: false,
|
|
SkipArgReorder: true,
|
|
Subcommands: subcommands,
|
|
Flags: CertCommandFlags,
|
|
}
|
|
}
|
|
|
|
func NewCertSubcommands(rotate func(ctx *cli.Context) error) []cli.Command {
|
|
return []cli.Command{
|
|
{
|
|
Name: "rotate",
|
|
Usage: "Certificate rotation",
|
|
SkipFlagParsing: false,
|
|
SkipArgReorder: true,
|
|
Action: rotate,
|
|
Flags: CertCommandFlags,
|
|
},
|
|
}
|
|
}
|