mirror of
https://github.com/containers/podman.git
synced 2025-11-02 14:55:28 +08:00
Update containers common package
The new version adds NetworkCreateOptions. For now pass nil [NO NEW TESTS NEEDED] Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
This commit is contained in:
7
vendor/github.com/containers/common/libnetwork/netavark/config.go
generated
vendored
7
vendor/github.com/containers/common/libnetwork/netavark/config.go
generated
vendored
@ -21,7 +21,7 @@ import (
|
||||
|
||||
// NetworkCreate will take a partial filled Network and fill the
|
||||
// missing fields. It creates the Network and returns the full Network.
|
||||
func (n *netavarkNetwork) NetworkCreate(net types.Network) (types.Network, error) {
|
||||
func (n *netavarkNetwork) NetworkCreate(net types.Network, options *types.NetworkCreateOptions) (types.Network, error) {
|
||||
n.lock.Lock()
|
||||
defer n.lock.Unlock()
|
||||
err := n.loadNetworks()
|
||||
@ -30,6 +30,11 @@ func (n *netavarkNetwork) NetworkCreate(net types.Network) (types.Network, error
|
||||
}
|
||||
network, err := n.networkCreate(&net, false)
|
||||
if err != nil {
|
||||
if options != nil && options.IgnoreIfExists && errors.Is(err, types.ErrNetworkExists) {
|
||||
if network, ok := n.networks[net.Name]; ok {
|
||||
return *network, nil
|
||||
}
|
||||
}
|
||||
return types.Network{}, err
|
||||
}
|
||||
// add the new network to the map
|
||||
|
||||
Reference in New Issue
Block a user