Skip to content

Conversation

@coderbirju
Copy link
Contributor

Current network inspect respone provides only container names
This PR adds other fields in the EndpointResource Struct

@coderbirju coderbirju closed this Jan 7, 2026
@coderbirju coderbirju reopened this Jan 7, 2026
@coderbirju coderbirju force-pushed the add-details-network-inspect branch from 2385db1 to eb356cf Compare January 9, 2026 00:27
Comment on lines +445 to +452
// Test IPv4 address field exists in response
assert.Assert(t, true, "IPv4Address field exists: %q", container.IPv4Address)

// Test MAC address field exists in response
assert.Assert(t, true, "MacAddress field exists: %q", container.MacAddress)

// Test IPv6 address field exists in response
assert.Assert(t, true, "IPv6Address field exists: %q", container.IPv6Address)
Copy link
Member

Choose a reason for hiding this comment

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

Since true is specified, the test will pass under any circumstances. I think we need tests corresponding to the container variable.

}

// Use the primary interface if available, otherwise use the first valid interface
if x.Index == container.Process.NetNS.PrimaryInterface || endpoint.IPv4Address != "" {
Copy link
Member

Choose a reason for hiding this comment

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

Looking at another function that determines whether it's PrimaryInterface, is this processing really necessary?

// determinePrimaryInterface returns a net.Interface.Index value, not a slice index.
// Zero means no primary interface was detected.
func determinePrimaryInterface(interfaces []native.NetInterface) int {
for _, f := range interfaces {
if f.Interface.Flags&net.FlagLoopback == 0 && f.Interface.Flags&net.FlagUp != 0 && !strings.HasPrefix(f.Name, "lo") {
return f.Index
}
}
return 0
}

I'm not very familiar with PrimaryInterface, so I'd like to hear other maintainers' opinions as well 🙏

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