Comments (8)
I don't really follow; why does the plugin need anything other than the absolute path?
from cni.
I mean, in rkt we DO pass an absoluteCNI_NETNS
as far as I can tell - where are you seeing the logic you referenced?
from cni.
I have not dug into the rkt code myself, but the testing I've done with rkt v0.9.0 shows that rkt still passes in the relative CNI_NETNS
path. I wrote up a simple plugin to show this:
luke@test-master:~/rkt-v0.9.0$ cat > 10-test.conf <<EOF
{
"name": "test",
"type": "test-rkt"
}
EOF
luke@test-master:~/rkt-v0.9.0$ sudo mv 10-test.conf /etc/rkt/net.d/
luke@test-master:~/rkt-v0.9.0$ cat > test-rkt <<EOF
#!/bin/bash
echo \$CNI_NETNS > ~/netns.txt
EOF
luke@test-master:~/rkt-v0.9.0$ chmod +x test-rkt; sudo mv test-rkt /usr/lib/rkt/plugins/net/
luke@test-master:~/rkt-v0.9.0$ sudo ./rkt run docker://busybox --net=test
luke@test-master:~/rkt-v0.9.0$ cat ~/netns.txt
netns
from cni.
We can require absolute path but the plugin can also just $(pwd)/$CNI_NETNS
to get the full path.
from cni.
The latter approach seems to preclude using namespaces of the form /proc/<pid>/ns/net
, which is what we want to do in our Kubernetes plugin. I think that means that passing an absolute path is more flexible.
from cni.
Why does it preclude the use of relative path? I mean, if the cwd is /proc/<pid>
, then yes, ns/net
would be a bad path. If it was /var/lib/mycontainer
, ../../../proc/<pid>/ns/net
would be fine. Obviously the container runtime has to ensure that the path it provides makes sense when the plugin is executed. But the plugin can just expect any path, relative or absolute, and can make a relative into absolute easily.
I mean all normal Unix commands work fine with both. You can do ls ./foo/
and ls /home/me/foo
.
from cni.
I tested this out - it looks like rkt does pass the correct path relative to the cwd
of the plugin, so I think this is fine. If anything, I think the CNI_NETNS
variable should just be documented to include that it can either be an absolute path, or a path relative to the current working directory of the plugin.
Either way, I think this issue can be closed.
from cni.
I mean all normal Unix commands work fine with both. You can do ls ./foo/ and ls /home/me/foo.
This is my general understanding too, and the CNI plugins are no exception.
Either way, I think this issue can be closed.
Agreed.
from cni.
Related Issues (20)
- How to perform docker run -p xxxx:xxxx using containerd/client and go-cni
- run a Docker container with NS set up by CNI plugins Fail HOT 3
- Add MTU as a Route property HOT 2
- update NetConf.DNS's tag to omitempty
- Network endpoints created by CNI NAT plugin is not attached to container
- Why were the patch versions for CVE-2021-20206 released so late?
- Security Slam 2023 Participation
- Dereference of NULL HOT 1
- Proposal: Add metadata map field to Interface object in CNI Result HOT 8
- Failed to destroy the network because of empty cached cni result. HOT 4
- Interface vethbe68c466 Mac doesn't match HOT 4
- Documents, READM.me- Suggest Korean Localization
- Add Table ID in CNI Result and Attribute HOT 2
- MACSEC communication between nodes in K8s environment
- CFP: add Device convention HOT 4
- Does the bridge cni support k8s networkpolicy?
- CFP: do we need an escape-valve from GC? HOT 1
- GC Improvement HOT 1
- Will the CNI support traffic mirroring, just like the span port of a switch
- cnitool should support testing chained CNI plugins HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cni.