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

Allow --ip and --mac to be set when joining a CNI net #4542

Merged

Conversation

mheon
Copy link
Member

@mheon mheon commented Nov 20, 2019

These only conflict when joining more than one network. We can still set a single CNI network and set a static IP and/or static MAC.

Fixes #4500

@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mheon

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-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 20, 2019
@mheon
Copy link
Member Author

mheon commented Nov 20, 2019

I'll add a test after lunch

@TomSweeneyRedHat
Copy link
Member

LGTM
remote prune test died, I expect unrelated to this change. I restarted.

@giuseppe
Copy link
Member

LGTM

@rhatdan
Copy link
Member

rhatdan commented Nov 21, 2019

@mheon Reminder on Tests.
Looks like the CI system is hung.

@mheon mheon force-pushed the static_ip_single_net_allowed branch from 1a75aa0 to dc4deb3 Compare November 21, 2019 16:20
@mheon
Copy link
Member Author

mheon commented Nov 21, 2019

Added a test

@mheon
Copy link
Member Author

mheon commented Nov 21, 2019

Some test failures are (wierd) flakes, but it seems like --ip with --net $CNINETWORK is not working. I'm passing the right things into OCICNI, so the problem has to be there.

@vbohinc
Copy link

vbohinc commented Nov 26, 2019

This does not work,

network.RuntimeConfig = map[string]ocicni.RuntimeConfig{
defaultNetwork: rt,
}

is always set to the "podman" netconf, so the static allocations do not get applied.

The problem is that defaultNetwork = r.netPlugin.GetDefaultNetworkName() returns "podman" instead of the user provided value.

Ugly hack I'm using to set defaultNetwork:

if len(networks) == 0 {
defaultNetwork = r.netPlugin.GetDefaultNetworkName()
} else {
defaultNetwork = networks[0]
}

These only conflict when joining more than one network. We can
still set a single CNI network and set a static IP and/or static
MAC.

Fixes containers#4500

Signed-off-by: Matthew Heon <[email protected]>
@mheon mheon force-pushed the static_ip_single_net_allowed branch from dc4deb3 to 01ae532 Compare November 26, 2019 14:56
@mheon
Copy link
Member Author

mheon commented Nov 26, 2019

Good catch - pushed an updated version that should set that properly

@mheon
Copy link
Member Author

mheon commented Nov 26, 2019

It's green.
@vrothberg @baude @TomSweeneyRedHat @rhatdan PTAL

@TomSweeneyRedHat
Copy link
Member

LGTM

@rhatdan
Copy link
Member

rhatdan commented Nov 26, 2019

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Nov 26, 2019
@openshift-merge-robot openshift-merge-robot merged commit b29928f into containers:master Nov 26, 2019
@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 Sep 26, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cannot set a static IP if joining additional CNI networks
7 participants