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

fix: implement MarshalLog for structures in volumemanager for structured-logging. #119829

Merged
merged 2 commits into from Sep 13, 2023

Conversation

cvvz
Copy link
Member

@cvvz cvvz commented Aug 8, 2023

What type of PR is this?

/kind bug

What this PR does / why we need it:

Before fix:

I0808 16:02:25.857797  350699 reconstruct_common.go:184] "Get volumes from pod directory" path="/var/lib/kubelet/pods" volumes=[{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{},{}]

After fix:

I0808 16:09:42.118411  358937 reconstruct_common.go:184] "Get volumes from pod directory" path="/var/lib/kubelet/pods" volumes="[{podName:1ace5d05-5cfc-4642-8c29-6b47200e041a volumeSpecName:kube-api-access-gctfp volumePath:/var/lib/kubelet/pods/1ace5d05-5cfc-4642-8c29-6b47200e041a/volumes/kubernetes.io~projected/kube-api-access-gctfp pluginName:kubernetes.io/projected volumeMode:Filesystem} ..........

This is because klog rely on encoding/json lib to encode the structure and print out, so it can't print un-exported fields.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?


Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. kind/bug Categorizes issue or PR as related to a bug. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Aug 8, 2023
@k8s-ci-robot
Copy link
Contributor

Please note that we're already in Test Freeze for the release-1.28 branch. This means every merged PR will be automatically fast-forwarded via the periodic ci-fast-forward job to the release branch of the upcoming v1.28.0 release.

Fast forwards are scheduled to happen every 6 hours, whereas the most recent run was: Mon Aug 7 22:33:07 UTC 2023.

@k8s-ci-robot k8s-ci-robot added 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/kubelet sig/node Categorizes an issue or PR as relevant to SIG Node. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Aug 8, 2023
@cvvz
Copy link
Member Author

cvvz commented Aug 8, 2023

/sig storage

@k8s-ci-robot k8s-ci-robot added the sig/storage Categorizes an issue or PR as relevant to SIG Storage. label Aug 8, 2023
@bart0sh bart0sh added this to Triage in SIG Node PR Triage Aug 8, 2023
@nikzayn
Copy link

nikzayn commented Aug 9, 2023

/assign

@nikzayn
Copy link

nikzayn commented Aug 9, 2023

/assign

Hey, @cvvz can you provide the steps to produce this issue also?

@cvvz
Copy link
Member Author

cvvz commented Aug 9, 2023

@nikzayn Just change the kubelet log level to greater than 4 and start kubelet then you can get the log, which didn't print any useful volumes information. https://github.com/kubernetes/kubernetes/blob/master/pkg/kubelet/volumemanager/reconciler/reconstruct_common.go#L184

@cvvz
Copy link
Member Author

cvvz commented Aug 10, 2023

/retest

@bart0sh
Copy link
Contributor

bart0sh commented Aug 10, 2023

/release-note-none
/triage accepted
/priority important-longterm
/kind cleanup
/lgtm
/assign @jsafrane

@k8s-ci-robot k8s-ci-robot added the release-note-none Denotes a PR that doesn't merit a release note. label Aug 10, 2023
@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. 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. labels Aug 10, 2023
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. lgtm "Looks good to me", indicates that a PR is ready to be merged. labels Aug 25, 2023
@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 25, 2023
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Aug 25, 2023
@bart0sh bart0sh moved this from Needs Approver to Needs Reviewer in SIG Node PR Triage Aug 28, 2023
@bart0sh
Copy link
Contributor

bart0sh commented Aug 28, 2023

@cvvz please squash your commits into one, thanks.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/contains-merge-commits Indicates a PR which contains merge commits. label Aug 28, 2023
commit d623614de31fe411f1dcb1e784472135f3ca0c5e
Merge: 8054af3b303 91344b4
Author: cvvz <ftdchenwz@gmail.com>
Date:   Mon Aug 28 18:43:49 2023 +0800

    Merge branch 'master' of https://github.com/kubernetes/kubernetes into fix-volumemanager-logs

commit 8054af3b303e10e7b74b1ba4d3c4035f488cbdad
Author: cvvz <ftdchenwz@gmail.com>
Date:   Fri Aug 25 22:03:08 2023 +0800

    fix

commit b414972831c4e4030162ee385d8f600e1e0257ac
Author: cvvz <ftdchenwz@gmail.com>
Date:   Fri Aug 25 21:41:36 2023 +0800

    fix

commit ebea00a8dd50eb3d8859a912b464bbda5548b1d4
Author: cvvz <ftdchenwz@gmail.com>
Date:   Fri Aug 25 20:54:40 2023 +0800

    123

commit 9f6f1dbbe717fa34e1c13fec645f4c474cbf99a0
Author: cvvz <ftdchenwz@gmail.com>
Date:   Fri Aug 25 20:53:16 2023 +0800

    add MarshalLog

commit d7d2878409343df937c770d6796f8c125e18ce7a
Author: cvvz <ftdchenwz@gmail.com>
Date:   Tue Aug 8 23:57:47 2023 +0800

    fix volumemanager logs
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/contains-merge-commits Indicates a PR which contains merge commits. label Aug 28, 2023
@cvvz
Copy link
Member Author

cvvz commented Aug 28, 2023

@bart0sh sure.

@cvvz
Copy link
Member Author

cvvz commented Aug 29, 2023

/retest

@cvvz cvvz changed the title fix: fix volumemanager log printing fix: implement MarshalLog for structures in volumemanager for structured-logging. Aug 29, 2023
@jsafrane
Copy link
Member

/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 Sep 13, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 5ac672784988f8f335e6a0b5487220b5cec6542e

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cvvz, jsafrane, togettoyou

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 Sep 13, 2023
@k8s-ci-robot k8s-ci-robot merged commit a08ee80 into kubernetes:master Sep 13, 2023
18 checks passed
SIG Node PR Triage automation moved this from Needs Reviewer to Done Sep 13, 2023
@k8s-ci-robot k8s-ci-robot added this to the v1.29 milestone Sep 13, 2023
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/kubelet area/logging cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. 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/instrumentation Categorizes an issue or PR as relevant to SIG Instrumentation. sig/node Categorizes an issue or PR as relevant to SIG Node. sig/storage Categorizes an issue or PR as relevant to SIG Storage. size/M Denotes a PR that changes 30-99 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.

None yet

7 participants