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

Readability log controller runtime upgrade #448

Merged
merged 1 commit into from
Nov 28, 2022
Merged

Readability log controller runtime upgrade #448

merged 1 commit into from
Nov 28, 2022

Conversation

kannon92
Copy link
Contributor

What type of PR is this?

/kind feature
Upgrade Controller-Runtime to get better logging

What this PR does / why we need it:

Upgrade Kubernetes API and controller-runtime. This gives better logging.

Which issue(s) this PR fixes:

Fixes #14

Special notes for your reviewer:

I'm not really sure what our process is for upgrading to new Kubernetes APIs so I'll leave this as a discussion in the PR.

@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Nov 25, 2022
@k8s-ci-robot
Copy link
Contributor

Hi @kannon92. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 25, 2022
@alculquicondor
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Nov 28, 2022
@alculquicondor
Copy link
Contributor

I think we can remove zaplog.AddCallerSkip(-1) from

kueue/main.go

Line 81 in 505c7ec

ZapOpts: []zaplog.Option{zaplog.AddCaller(), zaplog.AddCallerSkip(-1)},

Could you run the controller to check that the log lines point to the correct line of code?

@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 28, 2022
@kannon92
Copy link
Contributor Author

kannon92 commented Nov 28, 2022

I think we can remove zaplog.AddCallerSkip(-1) from

kueue/main.go

Line 81 in 505c7ec

ZapOpts: []zaplog.Option{zaplog.AddCaller(), zaplog.AddCallerSkip(-1)},

Could you run the controller to check that the log lines point to the correct line of code?

To be honest, I don't really know much about contextual logging.

{"level":"Level(-2)","ts":"2022-11-28T15:19:42.102084759Z","caller":"core/clusterqueue_controller.go:81","msg":"Reconciling ClusterQueue","controller":"clusterqueue","controllerGroup":"kueue.x-k8s.io","controllerKind":"ClusterQueue","ClusterQueue":{"name":"cluster-total"},"namespace":"","name":"cluster-total","reconcileID":"0b9c51cc-5877-48f3-807e-60c652491853","clusterQueue":{"name":"cluster-total"}}
{"level":"Level(-2)","ts":"2022-11-28T15:19:42.115894805Z","logger":"localqueue-reconciler","caller":"core/localqueue_controller.go:132","msg":"Queue update event","localQueue":{"name":"main","namespace":"default"}}
{"level":"Level(-2)","ts":"2022-11-28T15:19:42.116076635Z","caller":"core/localqueue_controller.go:75","msg":"Reconciling LocalQueue","controller":"localqueue","controllerGroup":"kueue.x-k8s.io","controllerKind":"LocalQueue","LocalQueue":{"name":"main","namespace":"default"},"namespace":"default","name":"main","reconcileID":"aa4d2a8e-552d-4e8d-a95f-8ce160430e31","localQueue":{"name":"main","namespace":"default"}}
{"level":"Level(-2)","ts":"2022-11-28T15:19:42.12908445Z","logger":"cluster-queue-reconciler","caller":"core/clusterqueue_controller.go:184","msg":"ClusterQueue update event","clusterQueue":{"name":"cluster-total"}}
{"level":"Level(-2)","ts":"2022-11-28T15:19:42.12927778Z","caller":"core/clusterqueue_controller.go:81","msg":"Reconciling ClusterQueue","controller":"clusterqueue","controllerGroup":"kueue.x-k8s.io","controllerKind":"ClusterQueue","ClusterQueue":{"name":"cluster-total"},"namespace":"","name":"cluster-total","reconcileID":"7f75db77-5ad1-432c-883e-465aebde49b3","clusterQueue":{"name":"cluster-total"}}
{"level":"Level(-2)","ts":"2022-11-28T15:19:43.450242307Z","caller":"job/job_controller.go:141","msg":"Reconciling Job","controller":"job","controllerGroup":"batch","controllerKind":"Job","Job":{"name":"sample-job-pq8jg","namespace":"default"},"namespace":"default","name":"sample-job-pq8jg","reconcileID":"28dca692-659a-4b53-81e6-610d4cfad07b","job":{"name":"sample-job-pq8jg","namespace":"default"}}

The log lines look to be correct at a glance. And I see the caller now.

main.go Show resolved Hide resolved
@alculquicondor
Copy link
Contributor

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Nov 28, 2022
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 28, 2022
@alculquicondor
Copy link
Contributor

/lgtm
/approve

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alculquicondor, kannon92

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 merged commit aecac6d into kubernetes-sigs:main Nov 28, 2022
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. 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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. 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.

Need to improve the readability of the log
3 participants