-
Notifications
You must be signed in to change notification settings - Fork 40.1k
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
kubeadm: support fetching configuration from the original cluster for 'upgrade diff' #80025
Conversation
/cc @neolit123 |
58543a0
to
eb90a7d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just nits and missing tests, but lgtm overall
var cfg *kubeadmapi.InitConfiguration | ||
if flags.cfgPath != "" { | ||
cfg, err = configutil.LoadInitConfigurationFromFile(flags.cfgPath) | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add a test case for this ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we want to unit test this, we need to mock FetchInitConfigurationFromCluster
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, let's not do the mock/unit test of the function in question for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can settle with that, modulo a TODO or something to make us remember to do this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yastij Where should we put the TODO:
? in diff_test.go
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
diff_test.go
seems reasonable to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you move this refactoring to a separate PR ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ideally in other projects i'd just recommend a separate commit, but let's follow what k/k does / recommends.
/assign @neolit123 |
eb90a7d
to
6dc0968
Compare
6dc0968
to
a49f62f
Compare
/lgtm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the update.
/lgtm
/approve
[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 |
/retest Review the full test history for this PR. Silence the bot with an |
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?: