Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Cmd = &cli.Command{ Name: "split", Usage: "split a kubeconfig into separated context pieces", ArgsUsage: "[PREFIX]", Flags: []cli.Flag{ &cli.StringFlag{ Name: "kubeconfig", Usage: "path to kubeconfig you wish to split", }, &cli.StringFlag{ Name: "additional-suffix", Usage: "append an additional SUFFIX to file names", DefaultText: "", }, &cli.BoolFlag{ Name: "numeric-suffixes", Aliases: []string{"d"}, Usage: "Use 2 digit numeric as suffix, not a context name", }, }, Action: func(cCtx *cli.Context) error { kc, err := kconf.Open(cCtx.String("kubeconfig")) if err != nil { return err } splitted := kc.Split() for i := range splitted { fileName := createFileName(i, splitted[i], cCtx) splitted[i].SaveAs(fileName) fmt.Fprintf(os.Stdout, "%s\n", fileName) if err != nil { return err } } return nil }, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.