*: abstract out netns for multiple platforms
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
parent
ebdec2ea5b
commit
fb87c2f68b
7 changed files with 218 additions and 128 deletions
49
lib/sandbox/sandbox_unsupported.go
Normal file
49
lib/sandbox/sandbox_unsupported.go
Normal file
|
@ -0,0 +1,49 @@
|
|||
// +build !linux
|
||||
|
||||
package sandbox
|
||||
|
||||
import (
|
||||
"os"
|
||||
)
|
||||
|
||||
func isNSorErr(nspath string) error {
|
||||
return nil // TODO(vbatts) ... really not sure ...
|
||||
}
|
||||
|
||||
func newNetNs() (*NetNs, error) {
|
||||
return &NetNs{}, nil
|
||||
}
|
||||
|
||||
func getNetNs(path string) (*NetNs, error) {
|
||||
return &NetNs{}, nil
|
||||
}
|
||||
|
||||
// NetNs handles data pertaining a network namespace
|
||||
// for non-linux this is a noop
|
||||
type NetNs struct {
|
||||
symlink *os.File
|
||||
}
|
||||
|
||||
func (nns *NetNs) Path() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (nns *NetNs) symlinkCreate(name string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (nns *NetNs) symlinkRemove() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (nns *NetNs) Close() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (nns *NetNs) Remove() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func hostNetNsPath() (string, error) {
|
||||
return "", nil // TODO(vbatts) maybe this should have a platform error?
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue