mirror of
https://github.com/containers/podman.git
synced 2025-12-07 06:11:07 +08:00
Add containers-common spec and command to podman
Since containers-common package is tied to specific versions of Podman, add tools to build the package into the contrib directory This should help other distributions to figure out which commont package to ship. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
2
vendor/github.com/containers/common/libnetwork/cni/config.go
generated
vendored
2
vendor/github.com/containers/common/libnetwork/cni/config.go
generated
vendored
@@ -69,7 +69,7 @@ func (n *cniNetwork) networkCreate(newNetwork *types.Network, defaultNet bool) (
|
||||
|
||||
switch newNetwork.Driver {
|
||||
case types.BridgeNetworkDriver:
|
||||
err = internalutil.CreateBridge(n, newNetwork, usedNetworks)
|
||||
err = internalutil.CreateBridge(n, newNetwork, usedNetworks, n.defaultsubnetPools)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
27
vendor/github.com/containers/common/libnetwork/cni/network.go
generated
vendored
27
vendor/github.com/containers/common/libnetwork/cni/network.go
generated
vendored
@@ -13,6 +13,7 @@ import (
|
||||
|
||||
"github.com/containernetworking/cni/libcni"
|
||||
"github.com/containers/common/libnetwork/types"
|
||||
"github.com/containers/common/pkg/config"
|
||||
"github.com/containers/storage/pkg/lockfile"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/sirupsen/logrus"
|
||||
@@ -31,6 +32,9 @@ type cniNetwork struct {
|
||||
// defaultSubnet is the default subnet for the default network.
|
||||
defaultSubnet types.IPNet
|
||||
|
||||
// defaultsubnetPools contains the subnets which must be used to allocate a free subnet by network create
|
||||
defaultsubnetPools []config.SubnetPool
|
||||
|
||||
// isMachine describes whenever podman runs in a podman machine environment.
|
||||
isMachine bool
|
||||
|
||||
@@ -62,6 +66,9 @@ type InitConfig struct {
|
||||
// DefaultSubnet is the default subnet for the default network.
|
||||
DefaultSubnet string
|
||||
|
||||
// DefaultsubnetPools contains the subnets which must be used to allocate a free subnet by network create
|
||||
DefaultsubnetPools []config.SubnetPool
|
||||
|
||||
// IsMachine describes whenever podman runs in a podman machine environment.
|
||||
IsMachine bool
|
||||
}
|
||||
@@ -89,15 +96,21 @@ func NewCNINetworkInterface(conf *InitConfig) (types.ContainerNetwork, error) {
|
||||
return nil, errors.Wrap(err, "failed to parse default subnet")
|
||||
}
|
||||
|
||||
defaultSubnetPools := conf.DefaultsubnetPools
|
||||
if defaultSubnetPools == nil {
|
||||
defaultSubnetPools = config.DefaultSubnetPools
|
||||
}
|
||||
|
||||
cni := libcni.NewCNIConfig(conf.CNIPluginDirs, &cniExec{})
|
||||
n := &cniNetwork{
|
||||
cniConfigDir: conf.CNIConfigDir,
|
||||
cniPluginDirs: conf.CNIPluginDirs,
|
||||
cniConf: cni,
|
||||
defaultNetwork: defaultNetworkName,
|
||||
defaultSubnet: defaultNet,
|
||||
isMachine: conf.IsMachine,
|
||||
lock: lock,
|
||||
cniConfigDir: conf.CNIConfigDir,
|
||||
cniPluginDirs: conf.CNIPluginDirs,
|
||||
cniConf: cni,
|
||||
defaultNetwork: defaultNetworkName,
|
||||
defaultSubnet: defaultNet,
|
||||
defaultsubnetPools: defaultSubnetPools,
|
||||
isMachine: conf.IsMachine,
|
||||
lock: lock,
|
||||
}
|
||||
|
||||
return n, nil
|
||||
|
||||
Reference in New Issue
Block a user