aboutsummaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
Diffstat (limited to 'libpod')
-rw-r--r--libpod/container_internal.go4
-rw-r--r--libpod/oci_internal_linux.go8
2 files changed, 10 insertions, 2 deletions
diff --git a/libpod/container_internal.go b/libpod/container_internal.go
index f1456548b..a4dcd23be 100644
--- a/libpod/container_internal.go
+++ b/libpod/container_internal.go
@@ -622,6 +622,10 @@ func (c *Container) refresh() error {
return err
}
+ if rootless.IsRootless() {
+ return nil
+ }
+
return c.refreshCNI()
}
diff --git a/libpod/oci_internal_linux.go b/libpod/oci_internal_linux.go
index a5cce795b..437b7cf4d 100644
--- a/libpod/oci_internal_linux.go
+++ b/libpod/oci_internal_linux.go
@@ -137,8 +137,12 @@ func (r *OCIRuntime) createOCIContainer(ctr *Container, restoreOptions *Containe
return errors.Wrapf(err, "failed to create rootless network sync pipe")
}
} else {
- defer errorhandling.CloseQuiet(ctr.rootlessSlirpSyncR)
- defer errorhandling.CloseQuiet(ctr.rootlessSlirpSyncW)
+ if ctr.rootlessSlirpSyncR != nil {
+ defer errorhandling.CloseQuiet(ctr.rootlessSlirpSyncR)
+ }
+ if ctr.rootlessSlirpSyncW != nil {
+ defer errorhandling.CloseQuiet(ctr.rootlessSlirpSyncW)
+ }
}
// Leak one end in conmon, the other one will be leaked into slirp4netns
cmd.ExtraFiles = append(cmd.ExtraFiles, ctr.rootlessSlirpSyncW)