summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/containers/run.go6
-rw-r--r--cmd/podman/system/prune.go32
2 files changed, 29 insertions, 9 deletions
diff --git a/cmd/podman/containers/run.go b/cmd/podman/containers/run.go
index 83a5d7b8a..db7180ca9 100644
--- a/cmd/podman/containers/run.go
+++ b/cmd/podman/containers/run.go
@@ -17,6 +17,7 @@ import (
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
+ "golang.org/x/crypto/ssh/terminal"
)
var (
@@ -106,6 +107,11 @@ func run(cmd *cobra.Command, args []string) error {
return err
}
+ // TODO: Breaking change should be made fatal in next major Release
+ if cliVals.TTY && cliVals.Interactive && !terminal.IsTerminal(int(os.Stdin.Fd())) {
+ logrus.Warnf("The input device is not a TTY. The --tty and --interactive flags might not work properly")
+ }
+
if af := cliVals.Authfile; len(af) > 0 {
if _, err := os.Stat(af); err != nil {
return err
diff --git a/cmd/podman/system/prune.go b/cmd/podman/system/prune.go
index 136c15304..3020a541b 100644
--- a/cmd/podman/system/prune.go
+++ b/cmd/podman/system/prune.go
@@ -55,22 +55,17 @@ func init() {
func prune(cmd *cobra.Command, args []string) error {
var err error
-
// Prompt for confirmation if --force is not set
if !force {
reader := bufio.NewReader(os.Stdin)
volumeString := ""
if pruneOptions.Volume {
volumeString = `
- - all volumes not used by at least one container`
+ - all volumes not used by at least one container`
}
- fmt.Printf(`
-WARNING! This will remove:
- - all stopped containers%s
- - all stopped pods
- - all dangling images
- - all build cache
-Are you sure you want to continue? [y/N] `, volumeString)
+
+ fmt.Printf(createPruneWarningMessage(pruneOptions), volumeString, "Are you sure you want to continue? [y/N] ")
+
answer, err := reader.ReadString('\n')
if err != nil {
return err
@@ -115,3 +110,22 @@ Are you sure you want to continue? [y/N] `, volumeString)
fmt.Printf("Total reclaimed space: %s\n", units.HumanSize((float64)(response.ReclaimedSpace)))
return nil
}
+
+func createPruneWarningMessage(pruneOpts entities.SystemPruneOptions) string {
+ if pruneOpts.All {
+ return `WARNING! This will remove:
+ - all stopped containers
+ - all networks not used by at least one container%s
+ - all images without at least one container associated to them
+ - all build cache
+
+%s`
+ }
+ return `WARNING! This will remove:
+ - all stopped containers
+ - all networks not used by at least one container%s
+ - all dangling images
+ - all dangling build cache
+
+%s`
+}