INNER CODE UNIT · Go
NewCertGeneratorCommand
KusionStack/karpor · cmd/cert-generator/main.go:38
func NewCertGeneratorCommand(ctx context.Context) *cobra.Command {
options := NewCertOptions()
cmd := &cobra.Command{
Use: "cert-generator",
Short: "Generate CA and kubeconfig",
RunE: func(cmd *cobra.Command, args []string) error {
return runCertGenerator(ctx, options)
},
}
options.AddFlags(cmd.Flags())
return cmd
}
func runCertGenerator(ctx context.Context, options *CertOptions) error {
var cfg *rest.Config
var ns string
var err error