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

libnetwork/netavark: accept metric option for mac/ipvlan #2063

Merged
merged 2 commits into from
Jul 12, 2024

Conversation

Luap99
Copy link
Member

@Luap99 Luap99 commented Jun 25, 2024

This option is also supported by netavark for macvlan and ipvlan
networks.

Fixes #2051

This option is also supported by netavark for macvlan and ipvlan
networks.

Fixes containers#2051

Signed-off-by: Paul Holzinger <[email protected]>
Commit 26fc823 added check for the env var inside the network
interface setup code as this is something that is always set by podman.
However if you try to run the unit tests as rootless they now always
failed as the code assumed we have access to a rootful path.

The easy fix is to just fix the test to set the env when running
rootless.

Signed-off-by: Paul Holzinger <[email protected]>
@Luap99
Copy link
Member Author

Luap99 commented Jul 1, 2024

@mheon @containers/podman-maintainers PTAL

@mheon
Copy link
Member

mheon commented Jul 1, 2024

Any way to also test that the route added has the metric?

Code LGTM though

@Luap99
Copy link
Member Author

Luap99 commented Jul 1, 2024

I added such a test to netavark already containers/netavark#1012

I don't really like to add a ton of "runtime" test for netavark here.

@Luap99
Copy link
Member Author

Luap99 commented Jul 12, 2024

@baude @rhatdan @containers/podman-maintainers PTAL

@@ -326,6 +326,11 @@ func createIpvlanOrMacvlan(network *types.Network) error {
return fmt.Errorf("unknown ipvlan mode %q", value)
}
}
case types.MetricOption:
_, err := strconv.ParseUint(value, 10, 32)
Copy link
Member

Choose a reason for hiding this comment

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

Nit: if _, err := ...

Copy link
Member Author

Choose a reason for hiding this comment

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

I am following the style of the rest of the option parsing code with that so I have a slight preference to keep it like this.

@rhatdan
Copy link
Member

rhatdan commented Jul 12, 2024

LGTM

@rhatdan
Copy link
Member

rhatdan commented Jul 12, 2024

/approve
/lgtm

Copy link
Contributor

openshift-ci bot commented Jul 12, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Luap99, 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-merge-bot openshift-merge-bot bot merged commit e90b642 into containers:main Jul 12, 2024
12 checks passed
@Luap99 Luap99 deleted the metric branch July 12, 2024 09:24
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.

Error: unsupported macvlan network option metric
3 participants