mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
Merge pull request #94938 from yagonobre/certs-graduate
Graduate kubeadm alpha certs command
This commit is contained in:
commit
7a2812ca60
@ -29,9 +29,24 @@ func NewCmdAlpha(in io.Reader, out io.Writer) *cobra.Command {
|
|||||||
Short: "Kubeadm experimental sub-commands",
|
Short: "Kubeadm experimental sub-commands",
|
||||||
}
|
}
|
||||||
|
|
||||||
cmd.AddCommand(newCmdCertsUtility(out))
|
|
||||||
cmd.AddCommand(newCmdKubeConfigUtility(out))
|
cmd.AddCommand(newCmdKubeConfigUtility(out))
|
||||||
cmd.AddCommand(NewCmdSelfhosting(in))
|
cmd.AddCommand(NewCmdSelfhosting(in))
|
||||||
|
|
||||||
|
certsCommand := NewCmdCertsUtility(out)
|
||||||
|
deprecateCertsCommand(certsCommand)
|
||||||
|
cmd.AddCommand(certsCommand)
|
||||||
|
|
||||||
return cmd
|
return cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func deprecateCertsCommand(cmds ...*cobra.Command) {
|
||||||
|
const deprecatedMessage = "please use the same command under \"kubeadm certs\""
|
||||||
|
|
||||||
|
for _, cmd := range cmds {
|
||||||
|
cmd.Deprecated = deprecatedMessage
|
||||||
|
childCmds := cmd.Commands()
|
||||||
|
if len(childCmds) > 0 {
|
||||||
|
deprecateCertsCommand(childCmds...)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -90,8 +90,8 @@ var (
|
|||||||
`)
|
`)
|
||||||
)
|
)
|
||||||
|
|
||||||
// newCmdCertsUtility returns main command for certs phase
|
// NewCmdCertsUtility returns main command for certs phase
|
||||||
func newCmdCertsUtility(out io.Writer) *cobra.Command {
|
func NewCmdCertsUtility(out io.Writer) *cobra.Command {
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
Use: "certs",
|
Use: "certs",
|
||||||
Aliases: []string{"certificates"},
|
Aliases: []string{"certificates"},
|
||||||
|
@ -90,8 +90,11 @@ func NewKubeadmCommand(in io.Reader, out, err io.Writer) *cobra.Command {
|
|||||||
cmds.AddCommand(NewCmdToken(out, err))
|
cmds.AddCommand(NewCmdToken(out, err))
|
||||||
cmds.AddCommand(upgrade.NewCmdUpgrade(out))
|
cmds.AddCommand(upgrade.NewCmdUpgrade(out))
|
||||||
cmds.AddCommand(alpha.NewCmdAlpha(in, out))
|
cmds.AddCommand(alpha.NewCmdAlpha(in, out))
|
||||||
|
|
||||||
options.AddKubeadmOtherFlags(cmds.PersistentFlags(), &rootfsPath)
|
options.AddKubeadmOtherFlags(cmds.PersistentFlags(), &rootfsPath)
|
||||||
|
|
||||||
|
// TODO: remove "certs" from "alpha"
|
||||||
|
// https://github.com/kubernetes/kubeadm/issues/2291
|
||||||
|
cmds.AddCommand(alpha.NewCmdCertsUtility(out))
|
||||||
|
|
||||||
return cmds
|
return cmds
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user