summaryrefslogtreecommitdiff
path: root/utils/utils.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-01-05 17:50:37 +0100
committerGitHub <noreply@github.com>2022-01-05 17:50:37 +0100
commitcbb2b68fc9630ef8cadd19674ab591b7fee9c7d0 (patch)
tree67523c28abe72177ca0138655e897eddacb656e0 /utils/utils.go
parent6902d9d9093e1d977ba733a182969bea3489dfbe (diff)
parentf6d00ea6ef977bbaf167d1187d1e4e43632f6b5c (diff)
downloadpodman-cbb2b68fc9630ef8cadd19674ab591b7fee9c7d0.tar.gz
podman-cbb2b68fc9630ef8cadd19674ab591b7fee9c7d0.tar.bz2
podman-cbb2b68fc9630ef8cadd19674ab591b7fee9c7d0.zip
Merge pull request #12429 from cdoern/scp
podman image scp never enter podman user NS
Diffstat (limited to 'utils/utils.go')
-rw-r--r--utils/utils.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/utils/utils.go b/utils/utils.go
index 45cec2c5f..4c04b939d 100644
--- a/utils/utils.go
+++ b/utils/utils.go
@@ -229,3 +229,12 @@ func MovePauseProcessToScope(pausePidPath string) {
}
}
}
+
+// CreateSCPCommand takes an existing command, appends the given arguments and returns a configured podman command for image scp
+func CreateSCPCommand(cmd *exec.Cmd, command []string) *exec.Cmd {
+ cmd.Args = append(cmd.Args, command...)
+ cmd.Env = os.Environ()
+ cmd.Stderr = os.Stderr
+ cmd.Stdout = os.Stdout
+ return cmd
+}