diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-11-10 23:28:35 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-10 23:28:35 +0100 |
commit | 546ad0e6ab2af88563a41f3526f2ed5ba67904c4 (patch) | |
tree | 26bd1bcf394972914918db923359f25e273ba488 /libpod | |
parent | 9dddc47d283efc3589d1e5a3aafac41935c510a9 (diff) | |
parent | 3690532b3be186c03071d9c845295e7158a0f7f5 (diff) | |
download | podman-546ad0e6ab2af88563a41f3526f2ed5ba67904c4.tar.gz podman-546ad0e6ab2af88563a41f3526f2ed5ba67904c4.tar.bz2 podman-546ad0e6ab2af88563a41f3526f2ed5ba67904c4.zip |
Merge pull request #12242 from Luap99/port-reload
network reload without ports should not reload ports
Diffstat (limited to 'libpod')
-rw-r--r-- | libpod/networking_slirp4netns.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libpod/networking_slirp4netns.go b/libpod/networking_slirp4netns.go index 9da94fb44..674075e23 100644 --- a/libpod/networking_slirp4netns.go +++ b/libpod/networking_slirp4netns.go @@ -678,15 +678,15 @@ func getRootlessPortChildIP(c *Container, netStatus map[string]types.StatusBlock // reloadRootlessRLKPortMapping will trigger a reload for the port mappings in the rootlessport process. // This should only be called by network connect/disconnect and only as rootless. func (c *Container) reloadRootlessRLKPortMapping() error { + if len(c.config.PortMappings) == 0 { + return nil + } childIP := getRootlessPortChildIP(c, c.state.NetworkStatus) logrus.Debugf("reloading rootless ports for container %s, childIP is %s", c.config.ID, childIP) conn, err := openUnixSocket(filepath.Join(c.runtime.config.Engine.TmpDir, "rp", c.config.ID)) if err != nil { - // This is not a hard error for backwards compatibility. A container started - // with an old version did not created the rootlessport socket. - logrus.Warnf("Could not reload rootless port mappings, port forwarding may no longer work correctly: %v", err) - return nil + return errors.Wrap(err, "could not reload rootless port mappings, port forwarding may no longer work correctly") } defer conn.Close() enc := json.NewEncoder(conn) |