-
Notifications
You must be signed in to change notification settings - Fork 206
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1761 from Luap99/rootlessnetns
libnetwork: add rootlessnetns package
- Loading branch information
Showing
25 changed files
with
1,261 additions
and
158 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package rootlessnetns | ||
|
||
type NetworkBackend int | ||
|
||
const ( | ||
Netavark NetworkBackend = iota | ||
CNI | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package rootlessnetns | ||
|
||
import ( | ||
"errors" | ||
|
||
"github.com/containers/common/pkg/config" | ||
"github.com/containers/storage/pkg/lockfile" | ||
) | ||
|
||
var ErrNotSupported = errors.New("rootless netns only supported on linux") | ||
|
||
type Netns struct{} | ||
|
||
func New(dir string, backend NetworkBackend, conf *config.Config) (*Netns, error) { | ||
return nil, ErrNotSupported | ||
} | ||
|
||
func (n *Netns) Setup(nets int, toRun func() error) error { | ||
return ErrNotSupported | ||
} | ||
|
||
func (n *Netns) Teardown(nets int, toRun func() error) error { | ||
return ErrNotSupported | ||
} | ||
|
||
func (n *Netns) Run(lock *lockfile.LockFile, toRun func() error) error { | ||
return ErrNotSupported | ||
} |
Oops, something went wrong.