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

cni: log format byte array as string #26740

Merged
merged 1 commit into from Jul 12, 2023
Merged

Conversation

aojea
Copy link
Contributor

@aojea aojea commented Jul 10, 2023

Existing cni code logs the StdinData as an array of bytes, that is incomprensible for users checking the logs.

Format cni logs to convert the stdin byte aray to a string.

Example:

./cilium-testing-worker2/containerd.log:Jul 06 23:29:42 cilium-testing-worker2 containerd[106]: level=debug msg="Processing CNI ADD request &skel.CmdArgs{ContainerID:"8e1464e2eba2853979365f7b40ad30826f3e5060e9d3cee93ada262306e9be5b", Netns:"/var/run/netns/cni-0e9e8042-fb78-a4fc-c4fa-549f6f44c007", IfName:"eth0", Args:"K8S_POD_UID=41ae5812-0b9b-4b9f-a9fc-a33db9111522;IgnoreUnknown=1;K8S_POD_NAMESPACE=netpol-x-3947;K8S_POD_NAME=c;K8S_POD_INFRA_CONTAINER_ID=8e1464e2eba2853979365f7b40ad30826f3e5060e9d3cee93ada262306e9be5b", Path:"/opt/cni/bin", StdinData:[]uint8{0x7b, 0x22, 0x63, 0x6e, 0x69, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x3a, 0x22, 0x30, 0x2e, 0x33, 0x2e, 0x31, 0x22, 0x2c, 0x22, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x2d, 0x64, 0x65, 0x62, 0x75, 0x67, 0x22, 0x3a, 0x74, 0x72, 0x75, 0x65, 0x2c, 0x22, 0x6c, 0x6f, 0x67, 0x2d, 0x66, 0x69, 0x6c, 0x65, 0x22, 0x3a, 0x22, 0x2f, 0x76, 0x61, 0x72, 0x2f, 0x72, 0x75, 0x6e, 0x2f, 0x63, 0x69, 0x6c, 0x69, 0x75, 0x6d, 0x2f, 0x63, 0x69, 0x6c, 0x69, 0x75, 0x6d, 0x2d, 0x63, 0x6e, 0x69, 0x2e, 0x6c, 0x6f, 0x67, 0x22, 0x2c, 0x22, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x3a, 0x22, 0x70, 0x6f, 0x72, 0x74, 0x6d, 0x61, 0x70, 0x22, 0x2c, 0x22, 0x74, 0x79, 0x70, 0x65, 0x22, 0x3a, 0x22, 0x63, 0x69, 0x6c, 0x69, 0x75, 0x6d, 0x2d, 0x63, 0x6e, 0x69, 0x22, 0x7d}}" eventUUID=c15eb614-f63a-44af-9f17-640712ce8b1d subsys=cilium-cni

Existing cni code logs the StdinData as an array of bytes, that
is incomprensible for users checking the logs.

Format cni logs to convert the stdin byte aray to a string.

Signed-off-by: Antonio Ojea <aojea@google.com>
@aojea aojea requested a review from a team as a code owner July 10, 2023 15:31
@aojea aojea requested a review from joamaki July 10, 2023 15:31
@maintainer-s-little-helper maintainer-s-little-helper bot added the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Jul 10, 2023
@aojea
Copy link
Contributor Author

aojea commented Jul 10, 2023

/assign @aanm @squeed

@tklauser tklauser added the release-note/misc This PR makes changes that have no direct user impact. label Jul 12, 2023
@maintainer-s-little-helper maintainer-s-little-helper bot removed the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Jul 12, 2023
@tklauser tklauser added area/cni Impacts the Container Networking Interface between Cilium and the orchestrator. dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. labels Jul 12, 2023
@tklauser
Copy link
Member

/test

@squeed squeed removed the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Jul 12, 2023
@tklauser tklauser merged commit c356d62 into cilium:main Jul 12, 2023
66 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cni Impacts the Container Networking Interface between Cilium and the orchestrator. release-note/misc This PR makes changes that have no direct user impact.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants