Merge pull request #77946 from Klaven/deprecate_from

Deprecation of the kubeadm config upload command
This commit is contained in:
Kubernetes Prow Robot 2019-05-17 00:26:44 -07:00 committed by GitHub
commit 628e0d8333
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -263,12 +263,14 @@ func NewCmdConfigMigrate(out io.Writer) *cobra.Command {
return cmd return cmd
} }
// NewCmdConfigUpload returns cobra.Command for "kubeadm config upload" command // NewCmdConfigUpload (Deprecated) returns cobra.Command for "kubeadm config upload" command
// Deprecated: please see kubeadm init phase upload-config
func NewCmdConfigUpload(out io.Writer, kubeConfigFile *string) *cobra.Command { func NewCmdConfigUpload(out io.Writer, kubeConfigFile *string) *cobra.Command {
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "upload", Deprecated: "please see kubeadm init phase upload-config",
Short: "Upload configuration about the current state, so that 'kubeadm upgrade' can later know how to configure the upgraded cluster", Use: "upload",
RunE: cmdutil.SubCmdRunE("upload"), Short: "Upload configuration about the current state, so that 'kubeadm upgrade' can later know how to configure the upgraded cluster",
RunE: cmdutil.SubCmdRunE("upload"),
} }
cmd.AddCommand(NewCmdConfigUploadFromFile(out, kubeConfigFile)) cmd.AddCommand(NewCmdConfigUploadFromFile(out, kubeConfigFile))
@ -299,11 +301,13 @@ func NewCmdConfigView(out io.Writer, kubeConfigFile *string) *cobra.Command {
// NewCmdConfigUploadFromFile verifies given Kubernetes config file and returns cobra.Command for // NewCmdConfigUploadFromFile verifies given Kubernetes config file and returns cobra.Command for
// "kubeadm config upload from-file" command // "kubeadm config upload from-file" command
// Deprecated: please see kubeadm init phase upload-config
func NewCmdConfigUploadFromFile(out io.Writer, kubeConfigFile *string) *cobra.Command { func NewCmdConfigUploadFromFile(out io.Writer, kubeConfigFile *string) *cobra.Command {
var cfgPath string var cfgPath string
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "from-file", Deprecated: "please see kubeadm init phase upload-config",
Short: "Upload a configuration file to the in-cluster ConfigMap for kubeadm configuration", Use: "from-file",
Short: "Upload a configuration file to the in-cluster ConfigMap for kubeadm configuration",
Long: fmt.Sprintf(dedent.Dedent(` Long: fmt.Sprintf(dedent.Dedent(`
Using this command, you can upload configuration to the ConfigMap in the cluster using the same config file you gave to 'kubeadm init'. Using this command, you can upload configuration to the ConfigMap in the cluster using the same config file you gave to 'kubeadm init'.
If you initialized your cluster using a v1.7.x or lower kubeadm client and used the --config option, you need to run this command with the If you initialized your cluster using a v1.7.x or lower kubeadm client and used the --config option, you need to run this command with the
@ -335,6 +339,7 @@ func NewCmdConfigUploadFromFile(out io.Writer, kubeConfigFile *string) *cobra.Co
} }
// NewCmdConfigUploadFromFlags returns cobra.Command for "kubeadm config upload from-flags" command // NewCmdConfigUploadFromFlags returns cobra.Command for "kubeadm config upload from-flags" command
// Deprecated: please see kubeadm init phase upload-config
func NewCmdConfigUploadFromFlags(out io.Writer, kubeConfigFile *string) *cobra.Command { func NewCmdConfigUploadFromFlags(out io.Writer, kubeConfigFile *string) *cobra.Command {
cfg := &kubeadmapiv1beta2.InitConfiguration{} cfg := &kubeadmapiv1beta2.InitConfiguration{}
kubeadmscheme.Scheme.Default(cfg) kubeadmscheme.Scheme.Default(cfg)
@ -342,8 +347,9 @@ func NewCmdConfigUploadFromFlags(out io.Writer, kubeConfigFile *string) *cobra.C
var featureGatesString string var featureGatesString string
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "from-flags", Deprecated: "please see kubeadm init phase upload-config",
Short: "Create the in-cluster configuration file for the first time from using flags", Use: "from-flags",
Short: "Create the in-cluster configuration file for the first time from using flags",
Long: fmt.Sprintf(dedent.Dedent(` Long: fmt.Sprintf(dedent.Dedent(`
Using this command, you can upload configuration to the ConfigMap in the cluster using the same flags you gave to 'kubeadm init'. Using this command, you can upload configuration to the ConfigMap in the cluster using the same flags you gave to 'kubeadm init'.
If you initialized your cluster using a v1.7.x or lower kubeadm client and set certain flags, you need to run this command with the If you initialized your cluster using a v1.7.x or lower kubeadm client and set certain flags, you need to run this command with the