Path []string
}
+// CNIConfig implements the CNI interface
+var _ CNI = &CNIConfig{}
+
// AddNetwork executes the plugin with the ADD command
func (c *CNIConfig) AddNetwork(net *NetworkConfig, rt *RuntimeConf) (*types.Result, error) {
pluginPath, err := invoke.FindInPath(net.Network.Type, c.Path)
Path string
}
+// Args implements the CNIArgs interface
+var _ CNIArgs = &Args{}
+
func (args *Args) AsEnv() []string {
env := os.Environ()
pluginArgsStr := args.PluginArgsStr
closed bool
}
+// netNS implements the NetNS interface
+var _ NetNS = &netNS{}
+
func getCurrentThreadNetNSPath() string {
// /proc/self/ns/net returns the namespace of the main thread, not
// of whatever thread this goroutine is running on. Make sure we
SupportedVersions_ []string `json:"supportedVersions,omitempty"`
}
+// pluginInfo implements the PluginInfo interface
+var _ PluginInfo = &pluginInfo{}
+
func (p *pluginInfo) Encode(w io.Writer) error {
return json.NewEncoder(w).Encode(p)
}
"net"
"os"
"path/filepath"
+
+ "github.com/containernetworking/cni/plugins/ipam/host-local/backend"
)
const lastIPFile = "last_reserved_ip"
dataDir string
}
+// Store implements the Store interface
+var _ backend.Store = &Store{}
+
func New(network, dataDir string) (*Store, error) {
if dataDir == "" {
dataDir = defaultDataDir
import (
"net"
+
+ "github.com/containernetworking/cni/plugins/ipam/host-local/backend"
)
type FakeStore struct {
lastReservedIP net.IP
}
+// FakeStore implements the Store interface
+var _ backend.Store = &FakeStore{}
+
func NewFakeStore(ipmap map[string]string, lastIP net.IP) *FakeStore {
return &FakeStore{ipmap, lastIP}
}