k3s/pkg/cli/cmds/certs.go
Derek Nola 118a68c913
Updates to CLI flag grouping + deprecated flag warnings. (#5937)
* 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>
2022-08-02 13:51:16 -07:00

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,
},
}
}