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

contrib: add firewall reload services #20249

Closed

Conversation

danishprakash
Copy link
Contributor

Should we package this until this is fixed in netavark/aardvark-dns as has been mentioned over on #5431? The unit files have been taken from @githubcek's comment here.

Refers #5431

cc/ @dcermak

Signed-off-by: danishprakash <danish.prakash@suse.com>
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 4, 2023

Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci openshift-ci bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. do-not-merge/release-note-label-needed Enforce release-note requirement, even if just None labels Oct 4, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 4, 2023

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: danishprakash
Once this PR has been reviewed and has the lgtm label, please assign mtrmac for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

@packit-as-a-service
Copy link

Ephemeral COPR build failed. @containers/packit-build please check.

1 similar comment
@packit-as-a-service
Copy link

Ephemeral COPR build failed. @containers/packit-build please check.

Makefile Outdated Show resolved Hide resolved
Co-authored-by: Dan Čermák <45594031+dcermak@users.noreply.github.com>
Signed-off-by: Danish Prakash <danish.prakash@suse.com>
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.

Thank you for your PR! It seems alarmingly fedora-specific and complex. Also, the tests are almost certainly not going to pass, nor are they doing what you think they're doing (see comments inline).

systemctl restart firewalld.service

# ensure the rules are still present
fout=$(run firewall-cmd --zone=trusted --list-all | grep "sources")
Copy link
Member

Choose a reason for hiding this comment

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

run is not intended to be used this way. First, it produces no output. Second, it hides exit status.


# ensure the rules are still present
fout=$(run firewall-cmd --zone=trusted --list-all | grep "sources")
assert "$fout" != " sources: " # non-empty
Copy link
Member

Choose a reason for hiding this comment

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

...therefore this assertion is a NOP. $fout will always be an empty string.

run_podman rm $cname

systemctl stop $reload_service
systemctl stop $restart_service
Copy link
Member

Choose a reason for hiding this comment

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

I'm not seeing a cleanup of the unit files...

systemctl is-active $restart_service

cname="testctr"
run_podman run -d --rm --name $cname fedora:latest sleep 10d
Copy link
Member

Choose a reason for hiding this comment

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

Please don't use fedora:latest like that. Use $IMAGE if possible, or $SYSTEMD_IMAGE if for some reason you actually need fedora

assert "$fout" != " sources: " # non-empty

# restart firewalld service
systemctl restart firewalld.service
Copy link
Member

Choose a reason for hiding this comment

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

This seems unlikely to work rootless...?


[Service]
Type=simple
ExecStart=/usr/bin/bash -c '/usr/bin/busctl monitor --system --match "interface=org.fedoraproject.FirewallD1,member=Reloaded" --match "interface=org.fedoraproject.FirewallD1,member=PropertiesChanged" | while read -r line ; do @@PODMAN@@ network reload --all ; done'
Copy link
Member

Choose a reason for hiding this comment

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

What is the purpose of the read -r line, if $line is never used?

Copy link
Member

@Luap99 Luap99 left a comment

Choose a reason for hiding this comment

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

I am personally not a fan of shipping these by default. Also shouldn't this be just one unit that can do both? I find it hard to maintain if we somehow need to support both dbus-monitor and busctl.

Comment on lines +483 to +484
@test "podman network reload on firewall-cmd --reload" {
setup_firewalld_services
Copy link
Member

Choose a reason for hiding this comment

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

This test must be skipped as rootless and when firewalld is not installed or not active.

But in general I am not sure we really want to test this in systems test, reloading the firewalld could have negative consequences for other applications as well outside of the tests. Given the high amount of different environments these tests are run I don't think it is a good idea to do it.

Comment on lines +500 to +511
firewall-cmd --reload

# ensure the rules are present
fout=$(run firewall-cmd --zone=trusted --list-all | grep "sources")
assert "$fout" != " sources: " # non-empty

# restart firewalld service
systemctl restart firewalld.service

# ensure the rules are still present
fout=$(run firewall-cmd --zone=trusted --list-all | grep "sources")
assert "$fout" != " sources: " # non-empty
Copy link
Member

Choose a reason for hiding this comment

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

This is just asking for flakes, there is no guarantee that by the time you check the network reload command was already run.
Also it would make much more sense to actually test the rules are restored by ding connectivity tests like done in the networking tests.

@vrothberg
Copy link
Member

Reading the comments/reactions, I don't think we should ship this and wait for the fixes.

@dcermak
Copy link
Contributor

dcermak commented Oct 12, 2023

Reading the comments/reactions, I don't think we should ship this and wait for the fixes.

From #5431 (comment) I don't anticipate these fixes to arrive anytime soon. It would be nice to have at least some intermediate solution.

@Luap99
Copy link
Member

Luap99 commented Oct 12, 2023

We added the proper fix to our release planning for 4.8 so it makes no sense to try to work around this now as this PR would also only land in 4.8.
So I suggest we close it and wait for my work to land in netavark in the next weeks.

@Luap99 Luap99 closed this Oct 12, 2023
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Jan 11, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
do-not-merge/release-note-label-needed Enforce release-note requirement, even if just None do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants