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 k8s.io/csi-translation-lib/.* to structured logging #124439

Conversation

bells17
Copy link
Contributor

@bells17 bells17 commented Apr 22, 2024

What type of PR is this?

/kind feature

What this PR does / why we need it:

Migrate to use structured logging and contextual logging in csi-translation-lib.
https://github.com/kubernetes/community/blob/master/contributors/devel/sig-instrumentation/migration-to-structured-logging.md

I've implemented it to use contextual logging, as csi-translation-lib is a library and applications using csi-translation-lib may utilize contextual logging.
kubernetes-csi/csi-lib-utils#149 (review)

The csi-translation-lib is used in the kubernetes-csi/external-provisioner, and this modification is necessary to enable contextual logging within the kubernetes-csi/external-provisioner

based PR: #120640

Which issue(s) this PR fixes:

Fixes #120639

Special notes for your reviewer:

Does this PR introduce a user-facing change?

NONE

@k8s-ci-robot
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. 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/L Denotes a PR that changes 100-499 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. area/dependency Issues or PRs related to dependency changes area/kubelet labels Apr 22, 2024
@k8s-ci-robot k8s-ci-robot requested review from carlory, chrishenzie and a team April 22, 2024 10:21
@k8s-ci-robot k8s-ci-robot added sig/apps Categorizes an issue or PR as relevant to SIG Apps. sig/node Categorizes an issue or PR as relevant to SIG Node. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. sig/storage Categorizes an issue or PR as relevant to SIG Storage. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Apr 22, 2024
@bells17 bells17 force-pushed the csi-translation-lib-structured-and-contextual-logging branch 4 times, most recently from 5a57d18 to 5814951 Compare April 22, 2024 11:09
@bells17 bells17 marked this pull request as ready for review April 22, 2024 11:35
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 22, 2024
@@ -602,7 +609,8 @@ func TestEphemeralVolumeOwnerCheck(t *testing.T) {

podName := util.GetUniquePodName(pod)

dswp.findAndAddNewPods()
_, ctx := ktesting.NewTestContext(t)
Copy link
Member

Choose a reason for hiding this comment

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

Hi @pohly , Can you take a look? NewTestContext(t) and Init(t), which is preferred?

Copy link
Contributor

Choose a reason for hiding this comment

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

Init is simpler and thus preferred.

Copy link
Contributor

Choose a reason for hiding this comment

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

Just beware that it cannot be used in staging (yet) - I first need to move k/k/test/utils/ktesting into a staging repo.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@carlory @pohly Thank you for your comments.

I first need to move k/k/test/utils/ktesting into a staging repo.

Regarding this, is there anything I can help with, such as creating issues for repository creation at https://github.com/kubernetes/org?

Copy link
Contributor

Choose a reason for hiding this comment

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

I first need to polish it a bit more and gather more experience with it before proposing it for staging.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Understood. I'll switch to using Init(t) from k/k/test/utils/ktesting for testing, excluding staging.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I changed to use Init(t) instead of NewTestContext(t).
aa67f41

@bells17
Copy link
Contributor Author

bells17 commented Apr 22, 2024

/sig instrumentation
/wg structured-logging
/area logging

#120640 (comment)

@k8s-ci-robot k8s-ci-robot added sig/instrumentation Categorizes an issue or PR as relevant to SIG Instrumentation. wg/structured-logging Categorizes an issue or PR as relevant to WG Structured Logging. area/logging labels Apr 22, 2024
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 1, 2024
@mengjiao-liu
Copy link
Member

/test pull-kubernetes-e2e-capz-windows-master

@mengjiao-liu
Copy link
Member

Flakying test: #125903

@jsturtevant
Copy link
Contributor

We've made an update that should resolve that test
/test pull-kubernetes-e2e-capz-windows-master

@jsturtevant
Copy link
Contributor

jsturtevant commented Jul 18, 2024

All the test passed but one which is tracked in #126180 due to a new feature that got turned on today

@bells17 bells17 force-pushed the csi-translation-lib-structured-and-contextual-logging branch from c70a10c to 1298c8a Compare July 18, 2024 05:01
@nojnhuh
Copy link
Contributor

nojnhuh commented Jul 18, 2024

CAPZ tests should be fixed now. If not, this should fix them: kubernetes/test-infra#33022

/retest

@mengjiao-liu
Copy link
Member

/test pull-kubernetes-e2e-capz-windows-master

1 similar comment
@bells17
Copy link
Contributor Author

bells17 commented Jul 22, 2024

/test pull-kubernetes-e2e-capz-windows-master

@jsafrane
Copy link
Member

/lgtm

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

LGTM label has been added.

Git tree hash: 39465816fd0090e3e4df09e56ceba13877a10cbd

@mengjiao-liu
Copy link
Member

/test pull-kubernetes-e2e-capz-windows-master

@jsafrane
Copy link
Member

jsafrane commented Aug 6, 2024

/approve

@pohly
Copy link
Contributor

pohly commented Aug 19, 2024

/assign @SergeyKanzhelev

For SIG Node approval.

@SergeyKanzhelev
Copy link
Member

Does this PR introduce a user-facing change?

Maybe add a release note here?

Copy link
Member

@SergeyKanzhelev SergeyKanzhelev left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

kubelet change looks ok

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bells17, jsafrane, pohly, SergeyKanzhelev, yangjunmyfm192085

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 Aug 19, 2024
@k8s-triage-robot
Copy link

The Kubernetes project has merge-blocking tests that are currently too flaky to consistently pass.

This bot retests PRs for certain kubernetes repos according to the following rules:

  • The PR does have any do-not-merge/* labels
  • The PR does not have the needs-ok-to-test label
  • The PR is mergeable (does not have a needs-rebase label)
  • The PR is approved (has cncf-cla: yes, lgtm, approved labels)
  • The PR is failing tests required for merge

You can:

/retest

@k8s-ci-robot k8s-ci-robot merged commit 113b12c into kubernetes:master Aug 20, 2024
24 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.32 milestone Aug 20, 2024
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/dependency Issues or PRs related to dependency changes area/kubelet area/logging cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. 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-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. release-note-none Denotes a PR that doesn't merit a release note. sig/apps Categorizes an issue or PR as relevant to SIG Apps. sig/instrumentation Categorizes an issue or PR as relevant to SIG Instrumentation. sig/node Categorizes an issue or PR as relevant to SIG Node. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. sig/storage Categorizes an issue or PR as relevant to SIG Storage. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on. wg/structured-logging Categorizes an issue or PR as relevant to WG Structured Logging.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

csi-translation-lib: Support structured and contextual logging