fix: format string bug in GetPodMTU error logging#3471
Merged
jaydeokar merged 1 commit intoaws:masterfrom Oct 3, 2025
dcoppa:podmtu
Merged
fix: format string bug in GetPodMTU error logging#3471jaydeokar merged 1 commit intoaws:masterfrom dcoppa:podmtu
jaydeokar merged 1 commit intoaws:masterfrom
dcoppa:podmtu
Conversation
Changed error log in GetPodMTU to use podMTU (string input) instead of
mtu (int result) when logging parse failures.
This fixes the format string mismatch that causes:
{"level":"error","ts":"2025-10-02T23:03:58.442+0200","caller":"routed-eni-cni-plugin/cni.go:163","msg":"Failed to parse pod MTU %!s(int=0): strconv.Atoi: parsing \"\": invalid syntax"}
in the output of "make unit-test".
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a format string bug in error logging where the wrong variable was being used in the error message when parsing pod MTU fails.
- Fixed error log format string mismatch in GetPodMTU function
- Corrected variable usage from
mtu(int) topodMTU(string) in error message
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
jaydeokar
approved these changes
Oct 3, 2025
This was referenced Oct 15, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changed error log in GetPodMTU to use podMTU (string input) instead of mtu (int result) when logging parse failures.
What type of PR is this?
bug
Which issue does this PR fix?:
This fixes the format string mismatch that causes:
{"level":"error","ts":"2025-10-02T23:03:58.442+0200","caller":"routed-eni-cni-plugin/cni.go:163","msg":"Failed to parse pod MTU %!s(int=0): strconv.Atoi: parsing \"\": invalid syntax"}{"level":"error","ts":"2025-10-02T23:04:00.652+0200","caller":"networkutils/network_test.go:448","msg":"Failed to parse pod MTU %!s(int=0): strconv.Atoi: parsing \"abc\": invalid syntax"}in the output of "make unit-test".
What does this PR do / Why do we need it?:
Bugfix
Testing done on this change:
Unit tests passed, the errors above are no longer displayed.
Will this PR introduce any new dependencies?:
No
Will this break upgrades or downgrades? Has updating a running cluster been tested?:
No / Yes
Does this change require updates to the CNI daemonset config files to work?:
No
Does this PR introduce any user-facing change?:
No
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.