diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-01-09 13:50:49 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-09 13:50:49 +0100 |
commit | fe49aa0f5058efb2a37af744d20b27ce071f8073 (patch) | |
tree | 7c33a546131028a2ce8c9428ea23c9ec34fde5f7 /pkg | |
parent | aaf94c84e7167103753a5c718f87f0a6f33a8537 (diff) | |
parent | 556cc1fadf9a65da20dcc1e4ef0fa2523850cf7e (diff) | |
download | podman-fe49aa0f5058efb2a37af744d20b27ce071f8073.tar.gz podman-fe49aa0f5058efb2a37af744d20b27ce071f8073.tar.bz2 podman-fe49aa0f5058efb2a37af744d20b27ce071f8073.zip |
Merge pull request #4821 from AkihiroSuda/fix-rootlessport
rootlessport: remove state dir on exit + honor ctr.runtime.config.TmpDir
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/rootlessport/rootlessport_linux.go | 4 |
1 files changed, 3 insertions, 1 deletions
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 |