summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/pods/create.go6
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
}