k8splugin support manager_networkmanage_network_ns_lifecycle=true from CRI-O #1153
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of the changes
Type of fix:
Bug fix
Fixes #
#1054.
Please describe:
The cni 0.3 support the network namespace path can be
/proc/[pid]/ns/net
or a bind-mount/link(like/var/run/netns/cni-<something>
;) to it.So, when the flag
**manage_network_ns_lifecycle=true**
on the CRI-O runtime, contiv return the bug contiv cni plugin is broken with cri-o runtime. #1054.When, the runtime send the pid process the operation inside the container is permitted, but when is the path of network namespace I have problems to exec same operation I get the error: RTNETLINK answers: Invalid argument, exit status 2
This is result inside the container contiv-netplugin running on k8s
So, the k8s_cni is part of the contivk8s plugin execute on the host.
I make some test to try maintain the logical on
./netplugin\mgmtfn\k8splugin\driver.go
but no success.I made some logical modifications to contiv run over buth net path. Some problems of permission on container, I can't execute the operation on the mounted path and that force me send part of the code to
k8s_cni.go
code.Modifications:
On the function
addPod()
of filedriver.go
of the k8splugin package. And put the same logical on the functionaddPodToContiv()
of filek8s_cni.go
of cniapi package;type of testing done (both manual and automated)
Manual tests on Kubernetes v1.10.5 with CRI-O v1.10.6 and Kata Container v1.1.0, and Kata needed the manage_network_ns_lifecycle=true, https://github.com/kata-containers/documentation/blob/master/architecture.md#cni.
And modify the
k8s_cni_test.go
toTODO