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

Update k8s.io/klog to v2.2.0 #92554

Merged
merged 1 commit into from
Jul 2, 2020
Merged

Conversation

serathius
Copy link
Contributor

/kind feature

Ref kubernetes/enhancements#1602

NONE

/cc @dims

@k8s-ci-robot k8s-ci-robot requested a review from dims June 26, 2020 17:33
@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/feature Categorizes issue or PR as related to a new feature. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Jun 26, 2020
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. area/apiserver area/cloudprovider area/code-generation area/dependency Issues or PRs related to dependency changes area/kubectl sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/cli Categorizes an issue or PR as relevant to SIG CLI. sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. sig/instrumentation Categorizes an issue or PR as relevant to SIG Instrumentation. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Jun 26, 2020
@dims
Copy link
Member

dims commented Jun 26, 2020

please update go-logr/logr to 0.2.0 and use logr.Logger instead of logr.InfoLogger

go-logr/logr@c53dffe

@yuzhiquan
Copy link
Member

please update go-logr/logr to 0.2.0 and use logr.Logger instead of logr.InfoLogger

go-logr/logr@c53dffe

Should update json format here, @serathius if deadline allowed, i can work on it.

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 29, 2020
@serathius
Copy link
Contributor Author

serathius commented Jun 29, 2020

Hey @yuzhiquan, I had a draft prepared when you asked, so I decided to finish this up.
On the other hand I noticed very strange behavior of verbosity. I don't think verbosity is correctly implemented for json logger.
e.g. infoLogger.V(2) write logs with {v:1}, also verbosity of json logger doesn't match K8s guidelines

Are you interested in looking into it?

@yuzhiquan
Copy link
Member

Hey @yuzhiquan, I had a draft prepared when you asked, so I decided to finish this up.
On the other hand I noticed very strange behavior of verbosity. I don't think verbosity is correctly implemented for json logger.
e.g. infoLogger.V(2) write logs with {v:1}, also verbosity of json logger doesn't match K8s guidelines

Are you interested in looking into it?

@serathius
Sure, i will take Verbose from here.

@serathius
Copy link
Contributor Author

/retest

@serathius
Copy link
Contributor Author

/test pull-kubernetes-e2e-kind-ipv6

@dims
Copy link
Member

dims commented Jun 29, 2020

/assign @liggitt

Jordan, this looks ready!

@liggitt
Copy link
Member

liggitt commented Jun 29, 2020

Vendor mechanics lgtm, didn't take a look at the reactionary changes yet. Would like @thockin's ack since he was involved in the interface change (looking at https://github.com/go-logr/logr/commits/master)

Since logr will be a shared dependency now, it would be great if we could get the interface stabilized sooner rather than later.

@liggitt
Copy link
Member

liggitt commented Jun 29, 2020

/assign @thockin

Copy link
Member

@thockin thockin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One question about the way logr is being used. As for logr API stability. I am a bit anxious about that - we haven't gotten a TON of feedback, but what we have gotten indicates the API isn't a problem. There are a few open issues (being able to offset stack frames and k/v pairs being the 2 that I car about most) that could be API impacting.

@DirectXMan12 I wonder if we should put some effort into pinning it down, doing some more examples, and just calling thee things 1.0?

type infoLogger struct {
lvl zapcore.Level
// zapLogger is a logr.Logger that uses Zap to record log.
type zapLogger struct {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am curious why we are embedding this rather than using https://github.com/go-logr/zapr ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some small differences configuring zap, e.g. EncoderConfig. As codebase was small we decided that it will be easier and faster to first develop it in k/k and propose changes to zapr later.

@thockin
Copy link
Member

thockin commented Jun 29, 2020 via email

@serathius
Copy link
Contributor Author

@DirectXMan12 I wonder if we should put some effort into pinning it down, doing some more examples, and just calling thee things 1.0?

Please let me know if I can help.

@dims
Copy link
Member

dims commented Jun 30, 2020

@DirectXMan12 @thockin Can we please ship this while you all work on logr?

@serathius
Copy link
Contributor Author

/priority important-soon

@k8s-ci-robot k8s-ci-robot added priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. and removed needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Jun 30, 2020
@thockin
Copy link
Member

thockin commented Jun 30, 2020

I have no objections - logr is pre 1.0, but that isn't different before or after this PR, so ...

Copy link
Member

@thockin thockin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

/lgtm
/approve

Comment on lines +1327 to +1329
// Error is equivalent to the global Error function, guarded by the value of v.
// See the documentation of V for usage.
func (v Verbose) Error(err error, msg string, args ...interface{}) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be ErrorS? the signature doesn't match the global Error function as the godoc claims

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this looks like a bug in klog. We are upgrading to klog to pick up a bug fix kubernetes/klog#165 We should be ok with this as currently we are not using klog.V(2).Error.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks like a bug in klog

and klog tagged a release with this? that means we can't change the signature until klog/v3, which I hope we never get to

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dims proposed to add ErrorS and add comment to discourage people from using Error.
I don't think this is blocking. Are we ok to merge?

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 30, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: serathius, thockin

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 30, 2020
@liggitt
Copy link
Member

liggitt commented Jun 30, 2020

heh, review collision

/hold for question at https://github.com/kubernetes/kubernetes/pull/92554/files#r447829913

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 30, 2020
@serathius
Copy link
Contributor Author

/milestone v1.19

@k8s-ci-robot k8s-ci-robot added this to the v1.19 milestone Jul 1, 2020
@liggitt
Copy link
Member

liggitt commented Jul 1, 2020

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 1, 2020
@k8s-ci-robot k8s-ci-robot merged commit bd60f07 into kubernetes:master Jul 2, 2020
@serathius serathius deleted the klog-upgrade branch July 11, 2020 12:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/apiserver area/cloudprovider area/code-generation area/dependency Issues or PRs related to dependency changes area/kubectl cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note-none Denotes a PR that doesn't merit a release note. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/cli Categorizes an issue or PR as relevant to SIG CLI. sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. sig/instrumentation Categorizes an issue or PR as relevant to SIG Instrumentation. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants