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: fix "upgrade plan" not defaulting to a "stable" version #75900

Merged
merged 1 commit into from Mar 30, 2019

Conversation

@neolit123
Copy link
Member

commented Mar 29, 2019

What this PR does / why we need it:

If the k8s version argument passed to "upgrade plan" is missing
the logic should perform the following actions:

  • fetch a "stable" version from the internet.
  • if that fails, fallback to the local client version.

Currentely the logic fails because the cfg.KubernetesVersion is
defaulted to the version of the existing cluster, which
then causes an early exit without any ugprade suggestions.

See app/cmd/upgrade/common.go::enforceRequirements():
configutil.FetchInitConfigurationFromCluster(..)

Fix that by passing the explicit user value that can also be "".
This will then make the "offline getter" treat it as an explicit
desired upgrade target.

In the future it might be best to invert this logic:

  • if no user k8s version argument is passed - default to the kubeadm
    version.
  • if labels are passed (e.g. "stable"), fetch a version from the
    internet.

Which issue(s) this PR fixes:

Fixes #kubernetes/kubeadm#1470

Special notes for your reviewer:
this bug only affects "plan", not the actual upgrades.

Does this PR introduce a user-facing change?:

kubeadm: fix "upgrade plan" not defaulting to a "stable" version if no version argument is passed

/kind bug
/priority critical-urgent
/assign @fabriziopandini @rosti
@kubernetes/sig-cluster-lifecycle-pr-reviews

kubeadm: fix "upgrade plan" not working without k8s version
If the k8s version argument passed to "upgrade plan" is missing
the logic should perform the following actions:
- fetch a "stable" version from the internet.
- if that fails, fallback to the local client version.

Currentely the logic fails because the cfg.KubernetesVersion is
defaulted to the version of the existing cluster, which
then causes an early exit without any ugprade suggestions.

See app/cmd/upgrade/common.go::enforceRequirements():
  configutil.FetchInitConfigurationFromCluster(..)

Fix that by passing the explicit user value that can also be "".
This will then make the "offline getter" treat it as an explicit
desired upgrade target.

In the future it might be best to invert this logic:
- if no user k8s version argument is passed - default to the kubeadm
version.
- if labels are passed (e.g. "stable"), fetch a version from the
internet.
@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

commented Mar 29, 2019

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: neolit123

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@rosti
rosti approved these changes Mar 30, 2019
Copy link
Member

left a comment

Thanks for the fix @neolit123
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm label Mar 30, 2019

@dixudx
dixudx approved these changes Mar 30, 2019
Copy link
Member

left a comment

/lgtm

@neolit123

This comment has been minimized.

Copy link
Member Author

commented Mar 30, 2019

/retest

1 similar comment
@neolit123

This comment has been minimized.

Copy link
Member Author

commented Mar 30, 2019

/retest

@k8s-ci-robot k8s-ci-robot merged commit 8f30451 into kubernetes:master Mar 30, 2019

17 checks passed

cla/linuxfoundation neolit123 authorized
Details
pull-kubernetes-bazel-build Job succeeded.
Details
pull-kubernetes-bazel-test Job succeeded.
Details
pull-kubernetes-conformance-image-test Skipped.
pull-kubernetes-cross Skipped.
pull-kubernetes-e2e-gce Job succeeded.
Details
pull-kubernetes-e2e-gce-100-performance Job succeeded.
Details
pull-kubernetes-e2e-gce-device-plugin-gpu Job succeeded.
Details
pull-kubernetes-godeps Skipped.
pull-kubernetes-integration Job succeeded.
Details
pull-kubernetes-kubemark-e2e-gce-big Job succeeded.
Details
pull-kubernetes-local-e2e Skipped.
pull-kubernetes-node-e2e Job succeeded.
Details
pull-kubernetes-typecheck Job succeeded.
Details
pull-kubernetes-verify Job succeeded.
Details
pull-publishing-bot-validate Skipped.
tide In merge pool.
Details
k8s-ci-robot added a commit that referenced this pull request Apr 4, 2019
Merge pull request #75901 from neolit123/automated-cherry-pick-of-#75…
…900-origin-release-1.14

Automated cherry pick of #75900: kubeadm: fix "upgrade plan" not working without k8s version
@aylei aylei referenced this pull request May 15, 2019
2 of 2 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.