diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-05-21 19:27:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-21 19:27:19 +0200 |
commit | 17553caca453b3ca24ad3e5f1c15ffeaad87030a (patch) | |
tree | 2d9f2f1963240fa230768469aea1865f8e4b9f3c /cmd/podman | |
parent | 6c8ce3eff60d0e220d3ca04706d9d05b3887b5ed (diff) | |
parent | 9415670722373d1c374da3587ce953b3d99f8961 (diff) | |
download | podman-17553caca453b3ca24ad3e5f1c15ffeaad87030a.tar.gz podman-17553caca453b3ca24ad3e5f1c15ffeaad87030a.tar.bz2 podman-17553caca453b3ca24ad3e5f1c15ffeaad87030a.zip |
Merge pull request #6313 from sujil02/pod-create-id
Fixes podman pod create --pod-id-file #6292
Diffstat (limited to 'cmd/podman')
-rw-r--r-- | cmd/podman/pods/create.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/cmd/podman/pods/create.go b/cmd/podman/pods/create.go index e24cdef98..88b615fab 100644 --- a/cmd/podman/pods/create.go +++ b/cmd/podman/pods/create.go @@ -3,6 +3,7 @@ package pods import ( "context" "fmt" + "io/ioutil" "os" "strings" @@ -147,6 +148,11 @@ func create(cmd *cobra.Command, args []string) error { if err != nil { return err } + if len(podIDFile) > 0 { + if err = ioutil.WriteFile(podIDFile, []byte(response.Id), 0644); err != nil { + return errors.Wrapf(err, "failed to write pod ID to file %q", podIDFile) + } + } fmt.Println(response.Id) return nil } |