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

Fix default network not being set when priority changes #38

Closed
wants to merge 1 commit into from

Conversation

saschagrunert
Copy link
Member

@saschagrunert saschagrunert commented Jun 13, 2019

If the priorities (sorted by name) of the configured networks change,
then the default network needs to be adapted to ensure it is actually
being used.

/cc @haircommander @mrunalp

This fix seems a bit critical to me since changing the network priority
on the fly currently does not work in CRI-O. It would be awesome if
we could tag a new release afterwards 😇

@openshift-ci-robot openshift-ci-robot added dco-signoff: yes Indicates the PR's author has DCO signed all their commits. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 13, 2019
@openshift-ci-robot openshift-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 13, 2019
If the priorities (sorted by name) of the configured networks change,
then the default network needs to be adapted to ensure it is actually
being used.

Signed-off-by: Sascha Grunert <[email protected]>
@@ -334,11 +334,9 @@ func (plugin *cniNetworkPlugin) syncNetworkConfig() error {
}

plugin.Lock()
defer plugin.Unlock()
if plugin.defaultNetName == "" {
Copy link
Member

Choose a reason for hiding this comment

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

doesn't removing this mean default is never set?

Copy link
Member Author

@saschagrunert saschagrunert Jun 13, 2019

Choose a reason for hiding this comment

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

It's now always set, which was my main intention 👇

ocicni/pkg/ocicni/ocicni.go

Lines 337 to 338 in db4d13e

plugin.defaultNetName = defaultNetName
plugin.networks = networks

@haircommander
Copy link
Member

/approve

@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: haircommander, saschagrunert
To complete the pull request process, please assign dcbw
You can assign the PR to them by writing /assign @dcbw in a comment when ready.

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

@haircommander
Copy link
Member

@dcbw got a moment to review this?

@dcbw
Copy link
Collaborator

dcbw commented Jun 17, 2019

This is very similar in scope to #31 and the same issues with that one hold with this one. None of the PRs so far correctly handle the case of tearing down a container that was using the previous plugins configuration. That is being addressed with containernetworking/cni#678 upstream and when that happens, ocicni will be updated to handle config caching on DEL. And then finally we can correctly handle changing the network plugin between container ADD/DEL.

@saschagrunert
Copy link
Member Author

saschagrunert commented Jun 19, 2019

Thanks for the review, feel free to close this @dcbw in favor to #31 if that change has a higher maturity. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dco-signoff: yes Indicates the PR's author has DCO signed all their commits. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants