Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kubeadm: remove the deprecated "--cri-socket" flag for "upgrade apply" #85044

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 0 additions & 12 deletions cmd/kubeadm/app/cmd/upgrade/apply.go
Expand Up @@ -27,7 +27,6 @@ import (
"k8s.io/klog"
kubeadmapi "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm"
"k8s.io/kubernetes/cmd/kubeadm/app/cmd/options"
cmdutil "k8s.io/kubernetes/cmd/kubeadm/app/cmd/util"
"k8s.io/kubernetes/cmd/kubeadm/app/constants"
"k8s.io/kubernetes/cmd/kubeadm/app/features"
"k8s.io/kubernetes/cmd/kubeadm/app/phases/upgrade"
Expand All @@ -49,7 +48,6 @@ type applyFlags struct {
dryRun bool
etcdUpgrade bool
renewCerts bool
criSocket string
imagePullTimeout time.Duration
kustomizeDir string
}
Expand All @@ -66,7 +64,6 @@ func NewCmdApply(apf *applyPlanFlags) *cobra.Command {
imagePullTimeout: defaultImagePullTimeout,
etcdUpgrade: true,
renewCerts: true,
// Don't set criSocket to a default value here, as this will override the setting in the stored config in RunApply below.
}

cmd := &cobra.Command{
Expand Down Expand Up @@ -94,10 +91,6 @@ func NewCmdApply(apf *applyPlanFlags) *cobra.Command {
cmd.Flags().DurationVar(&flags.imagePullTimeout, "image-pull-timeout", flags.imagePullTimeout, "The maximum amount of time to wait for the control plane pods to be downloaded.")
options.AddKustomizePodsFlag(cmd.Flags(), &flags.kustomizeDir)

// The CRI socket flag is deprecated here, since it should be taken from the NodeRegistrationOptions for the current
// node instead of the command line. This prevents errors by the users (such as attempts to use wrong CRI during upgrade).
cmdutil.AddCRISocketFlag(cmd.Flags(), &flags.criSocket)
cmd.Flags().MarkDeprecated(options.NodeCRISocket, "This flag is deprecated. Please, avoid using it.")
return cmd
}

Expand All @@ -123,11 +116,6 @@ func runApply(flags *applyFlags, userVersion string) error {
return err
}

if len(flags.criSocket) != 0 {
fmt.Println("[upgrade/apply] Respecting the --cri-socket flag that is set with higher priority than the config file.")
cfg.NodeRegistration.CRISocket = flags.criSocket
}

// Validate requested and validate actual version
klog.V(1).Infoln("[upgrade/apply] validating requested and actual version")
if err := configutil.NormalizeKubernetesVersion(&cfg.ClusterConfiguration); err != nil {
Expand Down