summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libpod/networking_linux.go1
-rw-r--r--pkg/rootlessport/rootlessport_linux.go4
2 files changed, 4 insertions, 1 deletions
diff --git a/libpod/networking_linux.go b/libpod/networking_linux.go
index 06b3fe957..89dac2b5d 100644
--- a/libpod/networking_linux.go
+++ b/libpod/networking_linux.go
@@ -344,6 +344,7 @@ func (r *Runtime) setupRootlessPortMapping(ctr *Container, netnsPath string) (er
NetNSPath: netnsPath,
ExitFD: 3,
ReadyFD: 4,
+ TmpDir: ctr.runtime.config.TmpDir,
}
cfgJSON, err := json.Marshal(cfg)
if err != nil {
diff --git a/pkg/rootlessport/rootlessport_linux.go b/pkg/rootlessport/rootlessport_linux.go
index 655d1a448..3e678d33a 100644
--- a/pkg/rootlessport/rootlessport_linux.go
+++ b/pkg/rootlessport/rootlessport_linux.go
@@ -46,6 +46,7 @@ type Config struct {
NetNSPath string
ExitFD int
ReadyFD int
+ TmpDir string
}
func init() {
@@ -101,10 +102,11 @@ func parent() error {
}
// create the parent driver
- stateDir, err := ioutil.TempDir("", "rootlessport")
+ stateDir, err := ioutil.TempDir(cfg.TmpDir, "rootlessport")
if err != nil {
return err
}
+ defer os.RemoveAll(stateDir)
driver, err := rkbuiltin.NewParentDriver(&logrusWriter{prefix: "parent: "}, stateDir)
if err != nil {
return err