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: Allow text-ts log format value #31686

Merged
merged 1 commit into from Apr 3, 2024

Conversation

sayboras
Copy link
Member

Description

The new log format (e.g. text-ts) is added recently in the below commit, so we need to allow it in regex. Additionally, text-ts is used as the default value if not specified or invalid.

Fixes: a099bf1

Testing

A quick validation is done by checking cilium-cni.log as per below

Sample CNI log
time="2024-03-30T03:44:04Z" level=warning msg="Errors encountered while deleting endpoint" containerID=602c74abc749a26ea7cf68316ea42bb94e0018d243a67d4144754b7b461e9244 error="[DELETE /endpoint][404] deleteEndpointNotFound " eventUUID=ed588318-8a35-49e5-a24b-1f5e061dc6aa subsys=cilium-cni
time="2024-03-30T03:44:04Z" level=debug msg="Processing CNI DEL request &skel.CmdArgs{ContainerID:\"46885c8d75614f3f4cccb7431960d333843659269512dbbac645ff3ceccf638b\", Netns:\"/var/run/netns/cni-3821158e-66fd-6d5c-6b30-572f23a2d5f5\", IfName:\"eth0\", Args:\"K8S_POD_UID=44083a1a-7b8f-46d0-865e-32c0f98ccd44;IgnoreUnknown=1;K8S_POD_NAMESPACE=default;K8S_POD_NAME=hello-t16-01-j06-28529503-85cxv;K8S_POD_INFRA_CONTAINER_ID=46885c8d75614f3f4cccb7431960d333843659269512dbbac645ff3ceccf638b\", Path:\"/opt/cni/bin\", StdinData:[]uint8{0x7b, 0x22, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x69, 0x6e, 0x67, 0x2d, 0x6d, 0x6f, 0x64, 0x65, 0x22, 0x3a, 0x22, 0x61, 0x77, 0x73, 0x2d, 0x63, 0x6e, 0x69, 0x22, 0x2c, 0x22, 0x63, 0x6e, 0x69, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x3a, 0x22, 0x30, 0x2e, 0x34, 0x2e, 0x30, 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, 0x61, 0x77, 0x73, 0x2d, 0x63, 0x6e, 0x69, 0x22, 0x2c, 0x22, 0x74, 0x79, 0x70, 0x65, 0x22, 0x3a, 0x22, 0x63, 0x69, 0x6c, 0x69, 0x75, 0x6d, 0x2d, 0x63, 0x6e, 0x69, 0x22, 0x7d}}" eventUUID=050c7993-7675-4c3d-afa2-06856790b4b1 subsys=cilium-cni
time="2024-03-30T03:44:04Z" level=debug msg="CNI NetConf: &types.NetConf{NetConf:types.NetConf{CNIVersion:\"0.4.0\", Name:\"aws-cni\", Type:\"cilium-cni\", Capabilities:map[string]bool(nil), IPAM:types.IPAM{Type:\"\"}, DNS:types.DNS{Nameservers:[]string(nil), Domain:\"\", Search:[]string(nil), Options:[]string(nil)}, RawPrevResult:map[string]interface {}(nil), PrevResult:types.Result(nil)}, MTU:0, Args:types.Args{}, ENI:types.ENISpec{InstanceID:\"\", InstanceType:\"\", MinAllocate:0, PreAllocate:0, MaxAboveWatermark:0, FirstInterfaceIndex:(*int)(nil), SecurityGroups:[]string(nil), SecurityGroupTags:map[string]string(nil), SubnetIDs:[]string(nil), SubnetTags:map[string]string(nil), NodeSubnetID:\"\", VpcID:\"\", AvailabilityZone:\"\", ExcludeInterfaceTags:map[string]string(nil), DeleteOnTermination:(*bool)(nil), UsePrimaryAddress:(*bool)(nil), DisablePrefixDelegation:(*bool)(nil)}, Azure:types.AzureSpec{InterfaceName:\"\"}, IPAM:types.IPAM{IPAM:types.IPAM{Type:\"\"}, IPAMSpec:types.IPAMSpec{Pool:types.AllocationMap(nil), Pools:types.IPAMPoolSpec{Requested:[]types.IPAMPoolRequest(nil), Allocated:[]types.IPAMPoolAllocation(nil)}, PodCIDRs:[]string(nil), MinAllocate:0, MaxAllocate:0, PreAllocate:0, MaxAboveWatermark:0, PodCIDRAllocationThreshold:0, PodCIDRReleaseThreshold:0}}, AlibabaCloud:types.Spec{InstanceType:\"\", AvailabilityZone:\"\", VPCID:\"\", CIDRBlock:\"\", VSwitches:[]string(nil), VSwitchTags:map[string]string(nil), SecurityGroups:[]string(nil), SecurityGroupTags:map[string]string(nil)}, EnableDebug:true, LogFormat:\"\", LogFile:\"/var/run/cilium/cilium-cni.log\", ChainingMode:\"aws-cni\"}" eventUUID=050c7993-7675-4c3d-afa2-06856790b4b1 subsys=cilium-cni
time="2024-03-30T03:44:04Z" level=debug msg="CNI Args: &types.ArgsSpec{CommonArgs:types.CommonArgs{IgnoreUnknown:true}, K8S_POD_NAME:\"hello-t16-01-j06-28529503-85cxv\", K8S_POD_NAMESPACE:\"default\"}" eventUUID=050c7993-7675-4c3d-afa2-06856790b4b1 subsys=cilium-cni
time="2024-03-30T03:44:04Z" level=info msg="Using chained plugin aws-cni" containerID=46885c8d75614f3f4cccb7431960d333843659269512dbbac645ff3ceccf638b eventUUID=050c7993-7675-4c3d-afa2-06856790b4b1 subsys=cilium-cni
time="2024-03-30T03:44:04Z" level=warning msg="Errors encountered while deleting endpoint" containerID=46885c8d75614f3f4cccb7431960d333843659269512dbbac645ff3ceccf638b error="[DELETE /endpoint][404] deleteEndpointNotFound " eventUUID=050c7993-7675-4c3d-afa2-06856790b4b1 subsys=cilium-cni

@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 Mar 30, 2024
@sayboras sayboras added the release-note/bug This PR fixes an issue in a previous release of Cilium. label Mar 30, 2024
@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 Mar 30, 2024
@sayboras sayboras added needs-backport/1.13 This PR / issue needs backporting to the v1.13 branch needs-backport/1.14 This PR / issue needs backporting to the v1.14 branch needs-backport/1.15 This PR / issue needs backporting to the v1.15 branch labels Mar 30, 2024
@sayboras
Copy link
Member Author

/test

The new log format (e.g. text-ts) is added recently in the below commit,
so we need to allow it in regex. Additionally, text-ts is used as the
default value if not specified or invalid.

Fixes: a099bf1
Signed-off-by: Tam Mach <tam.mach@cilium.io>
@sayboras sayboras marked this pull request as ready for review April 2, 2024 11:48
@sayboras sayboras requested a review from a team as a code owner April 2, 2024 11:48
@sayboras sayboras requested a review from derailed April 2, 2024 11:48
Copy link
Contributor

@derailed derailed left a comment

Choose a reason for hiding this comment

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

@sayboras Nice work Tam!

@sayboras
Copy link
Member Author

sayboras commented Apr 2, 2024

/test

@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Apr 3, 2024
@sayboras sayboras added this pull request to the merge queue Apr 3, 2024
Merged via the queue into cilium:main with commit 0a79dbd Apr 3, 2024
62 checks passed
@sayboras sayboras deleted the tam/cni-logging-ts branch April 3, 2024 00:51
@nbusseneau nbusseneau mentioned this pull request Apr 10, 2024
8 tasks
@nbusseneau nbusseneau added backport-pending/1.13 The backport for Cilium 1.13.x for this PR is in progress. and removed needs-backport/1.13 This PR / issue needs backporting to the v1.13 branch labels Apr 10, 2024
@nbusseneau nbusseneau mentioned this pull request Apr 10, 2024
9 tasks
@nbusseneau nbusseneau added backport-pending/1.14 The backport for Cilium 1.14.x for this PR is in progress. and removed needs-backport/1.14 This PR / issue needs backporting to the v1.14 branch labels Apr 10, 2024
@nbusseneau nbusseneau mentioned this pull request Apr 10, 2024
13 tasks
@nbusseneau nbusseneau added backport-pending/1.15 The backport for Cilium 1.15.x for this PR is in progress. and removed needs-backport/1.15 This PR / issue needs backporting to the v1.15 branch labels Apr 10, 2024
@github-actions github-actions bot removed the backport-pending/1.15 The backport for Cilium 1.15.x for this PR is in progress. label Apr 11, 2024
@github-actions github-actions bot added backport-done/1.15 The backport for Cilium 1.15.x for this PR is done. backport-done/1.14 The backport for Cilium 1.14.x for this PR is done. and removed backport-pending/1.14 The backport for Cilium 1.14.x for this PR is in progress. labels Apr 11, 2024
@github-actions github-actions bot added backport-done/1.13 The backport for Cilium 1.13.x for this PR is done. and removed backport-pending/1.13 The backport for Cilium 1.13.x for this PR is in progress. labels Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-done/1.13 The backport for Cilium 1.13.x for this PR is done. backport-done/1.14 The backport for Cilium 1.14.x for this PR is done. backport-done/1.15 The backport for Cilium 1.15.x for this PR is done. ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/bug This PR fixes an issue in a previous release of Cilium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants