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

Show network name network events with podman -remote events #21409

Merged
merged 1 commit into from
Feb 8, 2024

Conversation

rhatdan
Copy link
Member

@rhatdan rhatdan commented Jan 29, 2024

Fixes: #21311

Does this PR introduce a user-facing change?

podman -remote network events now show network name

@edsantiago
Copy link
Member

The word remote does not appear in test/e2e/events_test.go, suggesting that those tests are not skipped-remote. Maybe you could add a test there?

@openshift-ci openshift-ci bot added approved Indicates a PR has been approved by an approver from all required OWNERS files. release-note labels Jan 29, 2024
@rhatdan rhatdan force-pushed the events branch 2 times, most recently from 06cc30e to 98f1601 Compare January 29, 2024 17:05
@@ -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")
Copy link
Member

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?

Copy link
Member

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

Copy link
Member

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

@mheon
Copy link
Member

mheon commented Jan 30, 2024

Code LGTM but I have a question about the test

@rhatdan
Copy link
Member Author

rhatdan commented Jan 30, 2024

@Luap99 PTAL and merge.

@@ -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")
Copy link
Member

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

@@ -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
Copy link
Member

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.

@cevich
Copy link
Member

cevich commented Feb 5, 2024

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.

@rhatdan
Copy link
Member Author

rhatdan commented Feb 6, 2024

@Luap99 one more time...

@rhatdan
Copy link
Member Author

rhatdan commented Feb 6, 2024

@edsantiago @giuseppe @vrothberg @baude PTAL

@mheon
Copy link
Member

mheon commented Feb 6, 2024

Still some not-addressed comments

@rhatdan
Copy link
Member Author

rhatdan commented Feb 6, 2024

I addressed these comments before and must never have pushed them and then lost them. Good thing they are small.

Copy link
Member

@edsantiago edsantiago left a 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.

Copy link
Contributor

openshift-ci bot commented Feb 6, 2024

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@rhatdan rhatdan added lgtm Indicates that a PR is ready to be merged. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. 5.0 labels Feb 7, 2024
@rhatdan
Copy link
Member Author

rhatdan commented Feb 8, 2024

/unhold

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 8, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit 246831b into containers:main Feb 8, 2024
88 of 89 checks passed
@stale-locking-app stale-locking-app bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label May 9, 2024
@stale-locking-app stale-locking-app bot locked as resolved and limited conversation to collaborators May 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
5.0 approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. release-note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Network connect/disconnect events don't include network ID/name
5 participants