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
Unwanted console output in the versiongetter API #1853
Comments
/good-first-issue |
@bart0sh: Please ensure the request meets the requirements listed here. If this request no longer meets these requirements, the label can be removed In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@bart0sh please link to code examples for such fmt.Print* calls in the first post. |
/cc |
done |
I can help fix this. @bart0sh @neolit123 Move them to caller side? /assign |
@jfbai Yes, that's pretty much what needs to be done. However, it should be done carefully to make sure user visible output doesn't change. |
I have an idea about move them to caller side, something like this:
Could this be fine? |
@jfbai Not sure why do you use ClusterVersion() API and KubeadmVersion() on the caller side in your example, but I think I've got your idea. It's a bit implicit to my taste, but could work. You can also consider splitting ClusterVersion API to 2 APIs: ClusterVersionInfo() and ClusterVersion() It'd result in a bit more code duplication on the caller side, but it's more readable in my opinion. |
@bart0sh My mistake.
IMO, your idea makes sense and I will implement in this way. |
API to get version information(ClusterVersion, KubeadmVersion and VersionFromCILabel) contain unwanted calls of fmt.Print functions:
https://github.com/kubernetes/kubernetes/blob/master/cmd/kubeadm/app/phases/upgrade/versiongetter.go#L66
https://github.com/kubernetes/kubernetes/blob/master/cmd/kubeadm/app/phases/upgrade/versiongetter.go#L78
https://github.com/kubernetes/kubernetes/blob/master/cmd/kubeadm/app/phases/upgrade/versiongetter.go#L95
They should be moved outside of the API. It should be done carefully in order to not degrade user experience, i.e. kubeadm console output should stay the same.
The text was updated successfully, but these errors were encountered: