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: support fetching configuration from the original cluster for 'upgrade diff' #80025

Merged
merged 1 commit into from Jul 13, 2019

Conversation

@SataQiu
Copy link
Member

commented Jul 11, 2019

What type of PR is this?
/kind bug
/kind cleanup
/kind feature

What this PR does / why we need it:
kubeadm: support fetching configuration from the original cluster for 'upgrade diff'

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

kubeadm: support fetching configuration from the original cluster for 'upgrade diff'
@SataQiu

This comment has been minimized.

Copy link
Member Author

commented Jul 11, 2019

@k8s-ci-robot k8s-ci-robot requested a review from neolit123 Jul 11, 2019

@SataQiu SataQiu force-pushed the SataQiu:fix-kubeadm-diff-20190711 branch from 58543a0 to eb90a7d Jul 11, 2019

@yastij
Copy link
Member

left a comment

just nits and missing tests, but lgtm overall

var cfg *kubeadmapi.InitConfiguration
if flags.cfgPath != "" {
cfg, err = configutil.LoadInitConfigurationFromFile(flags.cfgPath)
} else {

This comment has been minimized.

Copy link
@yastij

yastij Jul 12, 2019

Member

can you add a test case for this ?

This comment has been minimized.

Copy link
@SataQiu

SataQiu Jul 12, 2019

Author Member

Thanks @yastij
This does lack test cases. But FetchInitConfigurationFromCluster requires a running kubernetes cluster. How should we write this kind of test cases? Any examples?

This comment has been minimized.

Copy link
@yastij

yastij Jul 12, 2019

Member

If we want to unit test this, we need to mock FetchInitConfigurationFromCluster

This comment has been minimized.

Copy link
@neolit123

neolit123 Jul 12, 2019

Member

yeah, let's not do the mock/unit test of the function in question for now.

This comment has been minimized.

Copy link
@yastij

yastij Jul 12, 2019

Member

I can settle with that, modulo a TODO or something to make us remember to do this

This comment has been minimized.

Copy link
@SataQiu

SataQiu Jul 12, 2019

Author Member

@yastij Where should we put the TODO:? in diff_test.go ?

This comment has been minimized.

Copy link
@yastij

yastij Jul 12, 2019

Member

diff_test.go seems reasonable to me

This comment has been minimized.

Copy link
@SataQiu

SataQiu Jul 12, 2019

Author Member

@yastij Done

@@ -47,7 +47,7 @@ func CreateInitStaticPodManifestFiles(manifestDir string, cfg *kubeadmapi.InitCo

// GetStaticPodSpecs returns all staticPodSpecs actualized to the context of the current configuration
// NB. this methods holds the information about how kubeadm creates static pod manifests.
func GetStaticPodSpecs(cfg *kubeadmapi.ClusterConfiguration, endpoint *kubeadmapi.APIEndpoint, k8sVersion *version.Version) map[string]v1.Pod {
func GetStaticPodSpecs(cfg *kubeadmapi.ClusterConfiguration, endpoint *kubeadmapi.APIEndpoint) map[string]v1.Pod {

This comment has been minimized.

Copy link
@yastij

yastij Jul 12, 2019

Member

can you move this refactoring to a separate PR ?

This comment has been minimized.

Copy link
@neolit123

neolit123 Jul 12, 2019

Member

ok, @SataQiu
please move :

  • Fix the bug that k8sVersion is unused in kubeadm/app/phases/controlplane/manifests.go#getControllerManagerCommand function.
  • manifests.go#GetStaticPodSpecs uses cfg.KubernetesVersion instead of k8sVersion to generate manifests. This PR cleans up redundant k8sVersion parameter.

to separate PR.

This comment has been minimized.

Copy link
@neolit123

neolit123 Jul 12, 2019

Member

ideally in other projects i'd just recommend a separate commit, but let's follow what k/k does / recommends.

@yastij

This comment has been minimized.

Copy link
Member

commented Jul 12, 2019

/assign @neolit123

@SataQiu SataQiu changed the title kubeadm: add the ability of reading configuration from cluster for 'kubeadm upgrade diff' kubeadm: support fetching configuration from the origin cluster for 'upgrade diff' Jul 12, 2019

@SataQiu SataQiu changed the title kubeadm: support fetching configuration from the origin cluster for 'upgrade diff' kubeadm: support fetching configuration from the original cluster for 'upgrade diff' Jul 12, 2019

@SataQiu SataQiu force-pushed the SataQiu:fix-kubeadm-diff-20190711 branch from eb90a7d to 6dc0968 Jul 12, 2019

@k8s-ci-robot k8s-ci-robot added size/S and removed size/M labels Jul 12, 2019

@SataQiu SataQiu force-pushed the SataQiu:fix-kubeadm-diff-20190711 branch from 6dc0968 to a49f62f Jul 12, 2019

@yastij

This comment has been minimized.

Copy link
Member

commented Jul 12, 2019

/lgtm
/priority backlog

@k8s-ci-robot k8s-ci-robot added the lgtm label Jul 12, 2019

@neolit123
Copy link
Member

left a comment

thanks for the update.
/lgtm
/approve

@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

commented Jul 12, 2019

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: neolit123, SataQiu

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

@fejta-bot

This comment has been minimized.

Copy link

commented Jul 13, 2019

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@k8s-ci-robot k8s-ci-robot merged commit ae67616 into kubernetes:master Jul 13, 2019

23 checks passed

cla/linuxfoundation SataQiu 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-dependencies Job succeeded.
Details
pull-kubernetes-e2e-gce Job succeeded.
Details
pull-kubernetes-e2e-gce-100-performance Job succeeded.
Details
pull-kubernetes-e2e-gce-csi-serial Skipped.
pull-kubernetes-e2e-gce-device-plugin-gpu Job succeeded.
Details
pull-kubernetes-e2e-gce-iscsi Skipped.
pull-kubernetes-e2e-gce-iscsi-serial Skipped.
pull-kubernetes-e2e-gce-storage-slow Skipped.
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-node-e2e-containerd 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
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.