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 String for logging of PodInfo and IPConfig #2020

Merged
merged 1 commit into from
Jun 19, 2023

Conversation

rbtr
Copy link
Contributor

@rbtr rbtr commented Jun 16, 2023

Reason for Change:

Adds String() to PodInfo so that logging the interface type works.
Currently, logging with %[+]v will insert the interface address in to the string instead of the values of the underlying type:

... ipState: {ID:abc IPAddress:123.456.789.0 LastStateTransition:2023-06-15 05:30:57.855233208 +0000 UTC m=+4.301209489 NCID:def PodInfo:0xc000529ae0 state:Assigned stateMiddlewareFuncs:[0x164faa0]}

Note:

PodInfo:0xc000529ae0

and (impl detail which should be removed)

stateMiddlewareFuncs:[0x164faa0]

With String() implemented on both types, loggers may use %s and get correctly formatted and populated output for the underlying types:

... ipState: {ID: [abc], NCID: [def], IPAddress: [123.456.789.0], State: [Assigned], LastStateTransition: [2023-06-16T21:26:43Z] PodInfo: [InfraContainerID: [pqr], InterfaceID: [mno], Key: [mno], Name: [ghi], Namespace: [jkl]]

Issue Fixed:

Requirements:

Notes:

@rbtr rbtr requested a review from a team as a code owner June 16, 2023 21:28
@rbtr rbtr added cns Related to CNS. fix Fixes something. labels Jun 16, 2023
@rbtr rbtr self-assigned this Jun 16, 2023
@rbtr rbtr enabled auto-merge (squash) June 16, 2023 21:29
Signed-off-by: Evan Baker <rbtr@users.noreply.github.com>
@rbtr rbtr disabled auto-merge June 19, 2023 16:55
@rbtr rbtr merged commit 6fd545a into Azure:master Jun 19, 2023
31 checks passed
@rbtr rbtr deleted the fix/ipconfig-fmt branch June 19, 2023 16:55
jaer-tsun pushed a commit to jaer-tsun/azure-container-networking that referenced this pull request Jul 17, 2023
Signed-off-by: Evan Baker <rbtr@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cns Related to CNS. fix Fixes something.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants