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

add netavark dns port option #1084

Merged
merged 3 commits into from
Jul 8, 2022

Conversation

martinetd
Copy link
Contributor

@martinetd martinetd commented Jul 7, 2022

companion PR for containers/netavark#323

I've:

  • added dns_bind_port setting to structs, example config and manual page
    Note the default in go is 0, which means do not set the env var. Someone setting it to 53 explicitly in the config would set the variable if we ever change the default.
  • added a test to validate we parse it; I've tested manually that invalid config value errors out but we don't have any value by value invalid parsing check (setting the value to an int < 0 or > 65535 would fail on Validate(), sure, but I don't see the point and it doesn't allow validating things like dns_bind_port = yes or other nonsensical value)
  • I've taken the liberty to fix a typo where Default was spelled Defult
  • likewise, tests didn't pass on my machine because /usr/libexec/foo doesn't exist. The tests only care that such a directory exist so I've just renamed it to /tmp on both sides (config and test) as that'll help more people than just creating the dir -- this is in a separate commit so if you don't want it I'll just drop it.

If we agree on the approach merge order probably doesn't matter, but I've tested this with the PR branch and it works ok for me.

cc @Luap99

martinetd added a commit to martinetd/netavark that referenced this pull request Jul 7, 2022
- check NETAVARK_DNS_PORT env var for a different port setup
- if set and not 53, setup port forwarding rules for that port and
start aardvark appropriately

Note: this requires containers/common#1084 to be usable by podman
because just setting the env var manually will lose it for teardown,
leading to the port forwading rule never being removed.

Signed-off-by: Dominique Martinet <[email protected]>
Fixes: containers/aardvark-dns#13
@rhatdan
Copy link
Member

rhatdan commented Jul 7, 2022

@Luap99 @mheon @flouthoc @baude PTAL

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.

Overall LGTM, just some small nits.

libnetwork/netavark/network.go Outdated Show resolved Hide resolved
libnetwork/netavark/network.go Outdated Show resolved Hide resolved
pkg/config/config.go Outdated Show resolved Hide resolved
@mheon
Copy link
Member

mheon commented Jul 7, 2022

LGTM once comments from @Luap99 are addressed

cni_plugin_dirs validation require directories to exist, use a
directory that is more likely to exist like /tmp instead of an
arbitrary path that won't exist on most systems

Signed-off-by: Dominique Martinet <[email protected]>
@martinetd martinetd force-pushed the netavark_dns_port branch 2 times, most recently from 916c926 to 30364ba Compare July 8, 2022 00:24
This commit allows using aardvark with an alternate port as per
implementation in containers/netavark#323

Signed-off-by: Dominique Martinet <[email protected]>
@rhatdan
Copy link
Member

rhatdan commented Jul 8, 2022

/lgtm
Thanks @martinetd

@rhatdan
Copy link
Member

rhatdan commented Jul 8, 2022

/approve

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 8, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: martinetd, 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

@openshift-ci openshift-ci bot added the approved label Jul 8, 2022
@openshift-ci openshift-ci bot merged commit c401258 into containers:main Jul 8, 2022
@martinetd
Copy link
Contributor Author

Thanks!
Just a question for tracking this internally -- as I understand, for podman versions, this won't get into 4.1.x but it will get into 4.2 eventually is that correct?

@Luap99
Copy link
Member

Luap99 commented Jul 8, 2022

Yes that is correct

@rhatdan
Copy link
Member

rhatdan commented Jul 8, 2022

Yes. We only back port for RHEL releases, and only under duress. :^)

@martinetd
Copy link
Contributor Author

That's more than fair, thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants