Bump c/storage to v1.57.1, c/image v5.34.0, c/common v0.62.0

If not already bumped, this will bump:

c/storage v1.57.1
c/image v5.34.0
c/common v0.62.0

in preparation for Podman v5.4 and beyond.

Buildah will be vendored in a separate PR.

Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
This commit is contained in:
tomsweeneyredhat
2025-01-31 18:28:48 -05:00
parent b06d78651a
commit 211d3ea3cf
16 changed files with 226 additions and 137 deletions

View File

@@ -86,7 +86,7 @@ func (n *cniNetwork) networkCreate(newNetwork *types.Network, defaultNet bool) (
switch newNetwork.Driver {
case types.BridgeNetworkDriver:
internalutil.MapDockerBridgeDriverOptions(newNetwork)
err = internalutil.CreateBridge(n, newNetwork, usedNetworks, n.defaultsubnetPools)
err = internalutil.CreateBridge(n, newNetwork, usedNetworks, n.defaultsubnetPools, true)
if err != nil {
return nil, err
}

View File

@@ -135,6 +135,15 @@ func (n *Netns) getOrCreateNetns() (ns.NetNS, bool, error) {
}
// In case of errors continue and setup the network cmd again.
} else {
// Special case, the file might exist already but is not a valid netns.
// One reason could be that a previous setup was killed between creating
// the file and mounting it. Or if the file is not on tmpfs (deleted on boot)
// you might run into it as well: https://github.com/containers/podman/issues/25144
// We have to do this because NewNSAtPath fails with EEXIST otherwise
if errors.As(err, &ns.NSPathNotNSErr{}) {
// We don't care if this fails, NewNSAtPath() should return the real error.
_ = os.Remove(nsPath)
}
logrus.Debugf("Creating rootless network namespace at %q", nsPath)
// We have to create the netns dir again here because it is possible
// that cleanup() removed it.

View File

@@ -10,11 +10,13 @@ import (
"github.com/containers/common/pkg/config"
)
func CreateBridge(n NetUtil, network *types.Network, usedNetworks []*net.IPNet, subnetPools []config.SubnetPool) error {
func CreateBridge(n NetUtil, network *types.Network, usedNetworks []*net.IPNet, subnetPools []config.SubnetPool, checkBridgeConflict bool) error {
if network.NetworkInterface != "" {
bridges := GetBridgeInterfaceNames(n)
if slices.Contains(bridges, network.NetworkInterface) {
return fmt.Errorf("bridge name %s already in use", network.NetworkInterface)
if checkBridgeConflict {
bridges := GetBridgeInterfaceNames(n)
if slices.Contains(bridges, network.NetworkInterface) {
return fmt.Errorf("bridge name %s already in use", network.NetworkInterface)
}
}
if !types.NameRegex.MatchString(network.NetworkInterface) {
return fmt.Errorf("bridge name %s invalid: %w", network.NetworkInterface, types.RegexError)

View File

@@ -169,11 +169,9 @@ func (n *netavarkNetwork) networkCreate(newNetwork *types.Network, defaultNet bo
switch newNetwork.Driver {
case types.BridgeNetworkDriver:
internalutil.MapDockerBridgeDriverOptions(newNetwork)
err = internalutil.CreateBridge(n, newNetwork, usedNetworks, n.defaultsubnetPools)
if err != nil {
return nil, err
}
// validate the given options, we do not need them but just check to make sure they are valid
var vlan int
// validate the given options,
for key, value := range newNetwork.Options {
switch key {
case types.MTUOption:
@@ -183,7 +181,7 @@ func (n *netavarkNetwork) networkCreate(newNetwork *types.Network, defaultNet bo
}
case types.VLANOption:
_, err = internalutil.ParseVlan(value)
vlan, err = internalutil.ParseVlan(value)
if err != nil {
return nil, err
}
@@ -218,6 +216,17 @@ func (n *netavarkNetwork) networkCreate(newNetwork *types.Network, defaultNet bo
return nil, fmt.Errorf("unsupported bridge network option %s", key)
}
}
// If there is no vlan there should be no other config with the same bridge.
// However with vlan we want to allow that so that you can have different
// configs on the same bridge but different vlans
// https://github.com/containers/common/issues/2095
checkBridgeConflict := vlan == 0
err = internalutil.CreateBridge(n, newNetwork, usedNetworks, n.defaultsubnetPools, checkBridgeConflict)
if err != nil {
return nil, err
}
case types.MacVLANNetworkDriver, types.IPVLANNetworkDriver:
err = createIpvlanOrMacvlan(newNetwork)
if err != nil {