mirror of
https://github.com/containers/podman.git
synced 2025-12-05 04:40:47 +08:00
Vendor in latest c/common
Pull in updates made to the filters code for images. Filters now perform an AND operation except for th reference filter which does an OR operation for positive case but an AND operation for negative cases. Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
This commit is contained in:
4
vendor/github.com/containers/common/libnetwork/internal/util/bridge.go
generated
vendored
4
vendor/github.com/containers/common/libnetwork/internal/util/bridge.go
generated
vendored
@@ -7,13 +7,13 @@ import (
|
||||
"github.com/containers/common/libnetwork/types"
|
||||
"github.com/containers/common/libnetwork/util"
|
||||
"github.com/containers/common/pkg/config"
|
||||
pkgutil "github.com/containers/common/pkg/util"
|
||||
"golang.org/x/exp/slices"
|
||||
)
|
||||
|
||||
func CreateBridge(n NetUtil, network *types.Network, usedNetworks []*net.IPNet, subnetPools []config.SubnetPool) error {
|
||||
if network.NetworkInterface != "" {
|
||||
bridges := GetBridgeInterfaceNames(n)
|
||||
if pkgutil.StringInSlice(network.NetworkInterface, bridges) {
|
||||
if slices.Contains(bridges, network.NetworkInterface) {
|
||||
return fmt.Errorf("bridge name %s already in use", network.NetworkInterface)
|
||||
}
|
||||
if !types.NameRegex.MatchString(network.NetworkInterface) {
|
||||
|
||||
2
vendor/github.com/containers/common/libnetwork/internal/util/interface.go
generated
vendored
2
vendor/github.com/containers/common/libnetwork/internal/util/interface.go
generated
vendored
@@ -7,7 +7,7 @@ import "github.com/containers/common/libnetwork/types"
|
||||
|
||||
// NetUtil is a helper interface which all network interfaces should implement to allow easy code sharing
|
||||
type NetUtil interface {
|
||||
// ForEach eaxecutes the given function for each network
|
||||
// ForEach executes the given function for each network
|
||||
ForEach(func(types.Network))
|
||||
// Len returns the number of networks
|
||||
Len() int
|
||||
|
||||
4
vendor/github.com/containers/common/libnetwork/internal/util/util.go
generated
vendored
4
vendor/github.com/containers/common/libnetwork/internal/util/util.go
generated
vendored
@@ -7,8 +7,8 @@ import (
|
||||
|
||||
"github.com/containers/common/libnetwork/types"
|
||||
"github.com/containers/common/pkg/config"
|
||||
"github.com/containers/common/pkg/util"
|
||||
"github.com/sirupsen/logrus"
|
||||
"golang.org/x/exp/slices"
|
||||
)
|
||||
|
||||
// GetBridgeInterfaceNames returns all bridge interface names
|
||||
@@ -51,7 +51,7 @@ func GetFreeDeviceName(n NetUtil) (string, error) {
|
||||
// Start by 1, 0 is reserved for the default network
|
||||
for i := 1; i < 1000000; i++ {
|
||||
deviceName := fmt.Sprintf("%s%d", n.DefaultInterfaceName(), i)
|
||||
if !util.StringInSlice(deviceName, names) {
|
||||
if !slices.Contains(names, deviceName) {
|
||||
logrus.Debugf("found free device name %s", deviceName)
|
||||
return deviceName, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user