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

Migrate from glog to klog #390

Merged
merged 1 commit into from Nov 16, 2019
Merged

Conversation

@ahmetb
Copy link
Member

ahmetb commented Nov 16, 2019

Kubernetes ecosystem has moved to klog. This is more actively maintained
than glog. We might find caveats and gotchas along the way, but seems to be
working fine locally.

Earlier we get the better as it is very likely to incur merge conflicts.
/kind cleanup

Kubernetes ecosystem has moved to klog. This is more actively maintained
than glog. We might find caveats and gotchas along the way, but seems to be
working fine locally.

Signed-off-by: Ahmet Alp Balkan <ahmetb@google.com>
@codecov-io

This comment has been minimized.

Copy link

codecov-io commented Nov 16, 2019

Codecov Report

Merging #390 into master will decrease coverage by 0.06%.
The diff coverage is 45.54%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #390      +/-   ##
==========================================
- Coverage    56.7%   56.64%   -0.07%     
==========================================
  Files          19       19              
  Lines         917      918       +1     
==========================================
  Hits          520      520              
- Misses        344      346       +2     
+ Partials       53       52       -1
Impacted Files Coverage Δ
pkg/installation/util.go 0% <0%> (ø) ⬆️
pkg/installation/upgrade.go 0% <0%> (ø) ⬆️
pkg/installation/platform.go 79.16% <100%> (ø) ⬆️
...kg/receiptsmigration/oldenvironment/environment.go 90% <100%> (ø) ⬆️
pkg/environment/environment.go 88.23% <100%> (ø) ⬆️
pkg/info/info.go 100% <100%> (ø) ⬆️
pkg/index/indexscanner/scanner.go 70.21% <100%> (ø) ⬆️
pkg/download/verifier.go 100% <100%> (ø) ⬆️
pkg/receiptsmigration/migration.go 46.15% <25%> (ø) ⬆️
cmd/validate-krew-manifest/main.go 54.54% <31.57%> (-0.56%) ⬇️
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 46a5a53...fcd0759. Read the comment docs.

@ahmetb

This comment has been minimized.

Copy link
Member Author

ahmetb commented Nov 16, 2019

Also apparently there's a go-logr implementation at https://github.com/kubernetes/klog/tree/master/klogr which looks promising https://github.com/kubernetes/klog/blob/master/examples/klogr/main.go.
We might consider switching later.

Copy link
Contributor

corneliusweig left a comment

Looks all good. Thanks!
I have two minor comments that should be handled in follow-up PRs to not block merging this one.

/lgtm
/approve

@@ -4,5 +4,5 @@ go 1.12

require (
github.com/pkg/errors v0.8.1 // indirect
sigs.k8s.io/krew v0.2.2-0.20190724210953-8867a94acd6d
sigs.k8s.io/krew v0.3.2

This comment has been minimized.

Copy link
@corneliusweig

corneliusweig Nov 16, 2019

Contributor

This could have been in a different PR, but I think it's fine..

}

func main() {
// TODO(ahmetb) iterate over glog flags and hide them (not sure if possible without using pflag)
klog.InitFlags(nil)

This comment has been minimized.

Copy link
@corneliusweig

corneliusweig Nov 16, 2019

Contributor

I looks a bit inconsistent that for the main command the setup is done in init whereas for validate-krew-manifest it's done in main().

if err := flag.Set("logtostderr", "true"); err != nil {
fmt.Printf("can't set log to stderr %+v", err)
os.Exit(1)
}
}

func main() {
// TODO(ahmetb) iterate over glog flags and hide them (not sure if possible without using pflag)

This comment has been minimized.

Copy link
@corneliusweig

corneliusweig Nov 16, 2019

Contributor

I think it's time to resolve this TODO. Lets do that in a follow-up PR.

@k8s-ci-robot

This comment has been minimized.

Copy link

k8s-ci-robot commented Nov 16, 2019

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ahmetb, corneliusweig

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:
  • OWNERS [ahmetb,corneliusweig]

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 merged commit 51122e9 into kubernetes-sigs:master Nov 16, 2019
2 of 3 checks passed
2 of 3 checks passed
tide Not mergeable. Needs lgtm label.
Details
cla/linuxfoundation ahmetb authorized
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.