mirror of
https://github.com/containers/podman.git
synced 2025-08-03 01:37:51 +08:00
Fix podman network IDs handling
The libpod network logic knows about networks IDs but OCICNI does not. We cannot pass the network ID to OCICNI. Instead we need to make sure we only use network names internally. This is also important for libpod since we also only store the network names in the state. If we would add a ID there the same networks could accidentally be added twice. Fixes #9451 Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
This commit is contained in:
@ -81,9 +81,9 @@ func GetCNIConfigPathByNameOrID(config *config.Config, name string) (string, err
|
||||
return "", errors.Wrap(define.ErrNoSuchNetwork, fmt.Sprintf("unable to find network configuration for %s", name))
|
||||
}
|
||||
|
||||
// ReadRawCNIConfByName reads the raw CNI configuration for a CNI
|
||||
// ReadRawCNIConfByNameOrID reads the raw CNI configuration for a CNI
|
||||
// network by name
|
||||
func ReadRawCNIConfByName(config *config.Config, name string) ([]byte, error) {
|
||||
func ReadRawCNIConfByNameOrID(config *config.Config, name string) ([]byte, error) {
|
||||
confFile, err := GetCNIConfigPathByNameOrID(config, name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
Reference in New Issue
Block a user