-
Notifications
You must be signed in to change notification settings - Fork 38.8k
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 883 Updated logging to be consistent. #68455
Conversation
/assign @neolit123 |
@@ -78,7 +78,7 @@ func (k *KernelValidator) Validate(spec SysSpec) (error, error) { | |||
|
|||
// validateKernelVersion validates the kernel version. | |||
func (k *KernelValidator) validateKernelVersion(kSpec KernelSpec) error { | |||
glog.V(1).Info("Validating kernel version") | |||
fmt.Printf("[%s] Validating kernel version\n", k.Name()) |
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.
might be better to remove this call and the other one [1].
and then also convert this line to use fmt.Printf()
https://github.com/kubernetes/kubernetes/blob/master/cmd/kubeadm/app/util/system/validators.go#L44
@@ -93,7 +93,7 @@ func (k *KernelValidator) validateKernelVersion(kSpec KernelSpec) error { | |||
|
|||
// validateKernelConfig validates the kernel configurations. | |||
func (k *KernelValidator) validateKernelConfig(kSpec KernelSpec) error { | |||
glog.V(1).Info("Validating kernel config") | |||
fmt.Printf("[%s] Validating kernel config\n", k.Name()) |
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 remove this one.
/kind cleanup please change the release note:
to:
we usually add it only for bigger user facing bug fixes and features. |
as in my comment here: we need to convert these glog calls to printf / println:
removing the |
@neolit123 I fear I am a bit confused. could you please explain a little when and how kubeadm logs? I see extensive use of I also found these, should these be updated?
and
I also think I understand why you think those are duplicate logs. I would prefer to make those a separate PR as the original request was about updating to not use |
the confusion is understandable, these two are special cases which can happen in air-gapped scenarios:
in such cases we show it as a glog entry to also point the time and the line where this was called. this on the other hand is always shown to the user and it should be fmt.Print...(), because we don't want the extra glog formatting to pollute the output.
note that these have V(1) - verbosity level. please have a look at glog docs to understand how that works.
please try to consolidate this update in a single PR. thanks |
as a summary: convert these to fmt.Print* calls.
remove the these as they are duplicates:
|
@Klaven: Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it. 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. |
@@ -93,7 +93,7 @@ func (k *KernelValidator) validateKernelVersion(kSpec KernelSpec) error { | |||
|
|||
// validateKernelConfig validates the kernel configurations. | |||
func (k *KernelValidator) validateKernelConfig(kSpec KernelSpec) error { | |||
glog.V(1).Info("Validating kernel config") | |||
fmt.Printf("[%s] Validating kernel config\n", k.Name()) |
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 remove this one.
@Klaven please squash the commits into a single one and force push to your remote branch. /release-note-none |
…beadm init where glog was used and glog and was inconsistent with the rest of kubeadm init logging. Updated logging in join.go and validators.go to use fmt.print style logging for init log messages. removed redundant log message
@neolit123 I have squashed and pushed the commit. Please let me know if there is anything else you would like me to do with this PR. |
sorry for the delay. /ok-to-test /assign @fabriziopandini @timothysc |
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.
This doesn't seem like the right approach here. Ideally we want to convert * to use glog not the other way, and anything that is too noisy should just have an increased verbosity.
@@ -78,7 +78,6 @@ func (k *KernelValidator) Validate(spec SysSpec) (error, error) { | |||
|
|||
// validateKernelVersion validates the kernel version. | |||
func (k *KernelValidator) validateKernelVersion(kSpec KernelSpec) error { | |||
glog.V(1).Info("Validating kernel version") |
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.
You could just bump they verbosity to debug levels
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 think this is just duplicate output,.
@@ -331,7 +331,7 @@ func (j *Join) Run(out io.Writer) error { | |||
} | |||
|
|||
// run kubeadm init preflight checks for checking all the prequisites | |||
glog.Infoln("[join] running pre-flight checks before initializing the new control plane instance") | |||
fmt.Printf("[join] running pre-flight checks before initializing the new control plane instance\n") |
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.
?? why?
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.
@Klaven
it should be a fmt.Println
instead of fmt.Printf(.....\n)
. please fix this.
@timothysc
in the case control plane join this glog.Infoln()
would introduce the glog formatting with time / FILE, LINE, etc. i think Lucas' original idea was to have the default kubeadm output glog-free.
@chuckha can confirm.
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.
IIRC @chuckha had set a option to disable the glog premable.
Right now I'd like to switch it all to glog and provide uniformity there.
It's too late in the cycle to hit 1.12 w/cleanup work so we'll have to punt until 1.13 and try to provide better clarity on goals. Ideally, we move it all to glog, strip out unnecessary details by default and provide more verbose logs with verbosity levels.
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.
It's impossible to disable glog preamble. What @timothysc is remembering is me changing all debug calls to be glog.V(n)
calls and all user output to use fmt.Println/f
.
I don't want kubeadm to switch entirely to glog for the user output, it would make parsing the token out of kubeadm init
even worse.
The rules for kubeadm:
- Does the user need to see it? yes => use
fmt.Print
no => useglog.V(1).Infoln/Debugln
. - Never use
glog
without using the.V(n)
feature.
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.
^ +100
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.
/approve
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Klaven, timothysc 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 |
1 similar comment
/retest Review the full test history for this PR. Silence the bot with an |
What this PR does / why we need it:
There was inconsistent logging methods used in
kubeadm init
using glog, these have been updated to output like the rest of kubeadm.Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes # kubernetes/kubeadm#883
Special notes for your reviewer:
SIG Cluster Lifecycle/kubeadm
Release note:
NONE