-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Show network name network events with podman -remote events #21409
Conversation
The word |
06cc30e
to
98f1601
Compare
test/e2e/events_test.go
Outdated
@@ -222,6 +222,38 @@ var _ = Describe("Podman events", func() { | |||
Expect(result2.OutputToString()).To(ContainSubstring(fmt.Sprintf("pod_id=%s", id))) | |||
}) | |||
|
|||
It("podman events network connection", func() { | |||
SkipIfRootless("Network creation not supported in rootless") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is actually true?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error: "slirp4netns" is not supported: invalid network mode
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah this should not be skipped, you must create the container with --network bridge
to support connect/disconnect
Code LGTM but I have a question about the test |
@Luap99 PTAL and merge. |
test/e2e/events_test.go
Outdated
@@ -222,6 +222,38 @@ var _ = Describe("Podman events", func() { | |||
Expect(result2.OutputToString()).To(ContainSubstring(fmt.Sprintf("pod_id=%s", id))) | |||
}) | |||
|
|||
It("podman events network connection", func() { | |||
SkipIfRootless("Network creation not supported in rootless") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah this should not be skipped, you must create the container with --network bridge
to support connect/disconnect
pkg/domain/entities/events.go
Outdated
@@ -64,6 +68,7 @@ func ConvertToEntitiesEvent(e libpodEvents.Event) *types.Event { | |||
attributes["containerExitCode"] = strconv.Itoa(*e.ContainerExitCode) | |||
} | |||
attributes["podId"] = e.PodID | |||
attributes["network"] = e.Network |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be wrapped in if e.Network != "" {}
to only add this attribute if there is a network.
Note to self I have not checked how this is exposed in the docker compat API.
Dunno why (nor care really) the secret-scanner is mad here. Probably due to the merge commit, is my best guess. Probably safe to ignore. |
@Luap99 one more time... |
Still some not-addressed comments |
Fixes: containers#21311 Signed-off-by: Daniel J Walsh <[email protected]>
I addressed these comments before and must never have pushed them and then lost them. Good thing they are small. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, and new test (correctly) fails when run against main with -remote.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: edsantiago, rhatdan The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/unhold |
246831b
into
containers:main
Fixes: #21311
Does this PR introduce a user-facing change?