summaryrefslogtreecommitdiff
path: root/pkg/adapter/runtime_remote.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-08-10 12:01:57 +0200
committerGitHub <noreply@github.com>2019-08-10 12:01:57 +0200
commit3a554a0fda3acb460d0656b1bf059603dfd79a4d (patch)
tree151424d1e16f30b56c04200c2a0ed45106be3133 /pkg/adapter/runtime_remote.go
parent8c77dd77af6852d1980949730663fc6814aacbdf (diff)
parentb31130a79d51ad68e9d332eafd712abf7266e22c (diff)
downloadpodman-3a554a0fda3acb460d0656b1bf059603dfd79a4d.tar.gz
podman-3a554a0fda3acb460d0656b1bf059603dfd79a4d.tar.bz2
podman-3a554a0fda3acb460d0656b1bf059603dfd79a4d.zip
Merge pull request #3746 from baude/enablewindowsremote
enable windows remote client
Diffstat (limited to 'pkg/adapter/runtime_remote.go')
-rw-r--r--pkg/adapter/runtime_remote.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/pkg/adapter/runtime_remote.go b/pkg/adapter/runtime_remote.go
index 828838bde..0cafbb2aa 100644
--- a/pkg/adapter/runtime_remote.go
+++ b/pkg/adapter/runtime_remote.go
@@ -10,6 +10,7 @@ import (
"io"
"io/ioutil"
"os"
+ "path/filepath"
"strings"
"text/template"
"time"
@@ -68,6 +69,12 @@ func GetRuntime(ctx context.Context, c *cliconfig.PodmanCommand) (*LocalRuntime,
cmd: c.GlobalFlags,
}
configPath := remoteclientconfig.GetConfigFilePath()
+ // Check if the basedir for configPath exists and if not, create it.
+ if _, err := os.Stat(filepath.Dir(configPath)); os.IsNotExist(err) {
+ if mkdirErr := os.MkdirAll(filepath.Dir(configPath), 0750); mkdirErr != nil {
+ return nil, mkdirErr
+ }
+ }
if len(c.GlobalFlags.RemoteConfigFilePath) > 0 {
configPath = c.GlobalFlags.RemoteConfigFilePath
customConfig = true