mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Merge pull request #104065 from pacoxu/kubeadm-patches
kubeadm: disallow the mixture of --config and --patches & remove deprecated --experimental-patches
This commit is contained in:
commit
746fea56ae
@ -570,9 +570,6 @@ func isAllowedFlag(flagName string) bool {
|
|||||||
kubeadmcmdoptions.NodeName,
|
kubeadmcmdoptions.NodeName,
|
||||||
kubeadmcmdoptions.KubeconfigDir,
|
kubeadmcmdoptions.KubeconfigDir,
|
||||||
kubeadmcmdoptions.UploadCerts,
|
kubeadmcmdoptions.UploadCerts,
|
||||||
kubeadmcmdoptions.Patches,
|
|
||||||
// TODO: https://github.com/kubernetes/kubeadm/issues/2046 remove in 1.23
|
|
||||||
kubeadmcmdoptions.ExperimentalPatches,
|
|
||||||
"print-join-command", "rootfs", "v", "log-file")
|
"print-join-command", "rootfs", "v", "log-file")
|
||||||
if allowedFlags.Has(flagName) {
|
if allowedFlags.Has(flagName) {
|
||||||
return true
|
return true
|
||||||
|
@ -145,8 +145,4 @@ const (
|
|||||||
|
|
||||||
// Patches flag sets the folder where kubeadm component patches are stored
|
// Patches flag sets the folder where kubeadm component patches are stored
|
||||||
Patches = "patches"
|
Patches = "patches"
|
||||||
|
|
||||||
// ExperimentalPatches (DEPRECATED) is the same as Patches
|
|
||||||
// TODO: https://github.com/kubernetes/kubeadm/issues/2046 remove in 1.23
|
|
||||||
ExperimentalPatches = "experimental-patches"
|
|
||||||
)
|
)
|
||||||
|
@ -102,7 +102,4 @@ func AddPatchesFlag(fs *pflag.FlagSet, patchesDir *string) {
|
|||||||
`"json" or "yaml". "suffix" is an optional string that can be used to determine ` +
|
`"json" or "yaml". "suffix" is an optional string that can be used to determine ` +
|
||||||
`which patches are applied first alpha-numerically.`
|
`which patches are applied first alpha-numerically.`
|
||||||
fs.StringVar(patchesDir, Patches, *patchesDir, usage)
|
fs.StringVar(patchesDir, Patches, *patchesDir, usage)
|
||||||
// TODO: https://github.com/kubernetes/kubeadm/issues/2046 remove in 1.23
|
|
||||||
fs.StringVar(patchesDir, ExperimentalPatches, *patchesDir, usage)
|
|
||||||
fs.MarkDeprecated(ExperimentalPatches, "This flag will be removed in a future version. Please use '--patches' instead.")
|
|
||||||
}
|
}
|
||||||
|
@ -101,8 +101,6 @@ func getControlPlanePhaseFlags(name string) []string {
|
|||||||
options.KubernetesVersion,
|
options.KubernetesVersion,
|
||||||
options.ImageRepository,
|
options.ImageRepository,
|
||||||
options.Patches,
|
options.Patches,
|
||||||
// TODO: https://github.com/kubernetes/kubeadm/issues/2046 remove in 1.23
|
|
||||||
options.ExperimentalPatches,
|
|
||||||
options.DryRun,
|
options.DryRun,
|
||||||
}
|
}
|
||||||
if name == "all" || name == kubeadmconstants.KubeAPIServer {
|
if name == "all" || name == kubeadmconstants.KubeAPIServer {
|
||||||
|
@ -44,8 +44,6 @@ func getControlPlaneJoinPhaseFlags(name string) []string {
|
|||||||
}
|
}
|
||||||
if name == "etcd" || name == "all" {
|
if name == "etcd" || name == "all" {
|
||||||
flags = append(flags, options.Patches)
|
flags = append(flags, options.Patches)
|
||||||
// TODO: https://github.com/kubernetes/kubeadm/issues/2046 remove in 1.23
|
|
||||||
flags = append(flags, options.ExperimentalPatches)
|
|
||||||
}
|
}
|
||||||
if name != "mark-control-plane" {
|
if name != "mark-control-plane" {
|
||||||
flags = append(flags, options.APIServerAdvertiseAddress)
|
flags = append(flags, options.APIServerAdvertiseAddress)
|
||||||
|
@ -81,8 +81,6 @@ func getControlPlanePreparePhaseFlags(name string) []string {
|
|||||||
options.TokenStr,
|
options.TokenStr,
|
||||||
options.CertificateKey,
|
options.CertificateKey,
|
||||||
options.Patches,
|
options.Patches,
|
||||||
// TODO: https://github.com/kubernetes/kubeadm/issues/2046 remove in 1.23
|
|
||||||
options.ExperimentalPatches,
|
|
||||||
}
|
}
|
||||||
case "download-certs":
|
case "download-certs":
|
||||||
flags = []string{
|
flags = []string{
|
||||||
@ -128,8 +126,6 @@ func getControlPlanePreparePhaseFlags(name string) []string {
|
|||||||
options.CfgPath,
|
options.CfgPath,
|
||||||
options.ControlPlane,
|
options.ControlPlane,
|
||||||
options.Patches,
|
options.Patches,
|
||||||
// TODO: https://github.com/kubernetes/kubeadm/issues/2046 remove in 1.23
|
|
||||||
options.ExperimentalPatches,
|
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
flags = []string{}
|
flags = []string{}
|
||||||
|
@ -40,8 +40,6 @@ func NewControlPlane() workflow.Phase {
|
|||||||
options.CertificateRenewal,
|
options.CertificateRenewal,
|
||||||
options.EtcdUpgrade,
|
options.EtcdUpgrade,
|
||||||
options.Patches,
|
options.Patches,
|
||||||
// TODO: https://github.com/kubernetes/kubeadm/issues/2046 remove in 1.23
|
|
||||||
options.ExperimentalPatches,
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
return phase
|
return phase
|
||||||
|
Loading…
Reference in New Issue
Block a user