Skip to content

Conversation

@dcoppa
Copy link
Contributor

@dcoppa dcoppa commented Oct 2, 2025

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.

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".
@dcoppa dcoppa requested a review from a team as a code owner October 2, 2025 22:38
@dcoppa dcoppa changed the title Fix format string bug in GetPodMTU error logging fix: format string bug in GetPodMTU error logging Oct 2, 2025
@jaydeokar jaydeokar requested a review from Copilot October 2, 2025 22:40
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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) to podMTU (string) in error message

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@jaydeokar jaydeokar added this to the v1.20.4 milestone Oct 3, 2025
@jaydeokar jaydeokar merged commit 989c19f into aws:master Oct 3, 2025
7 checks passed
@dcoppa dcoppa deleted the podmtu branch October 3, 2025 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants