From 56d6ee0808d30c96289568724d748a0e85008638 Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Fri, 22 Apr 2022 12:02:07 +0200 Subject: move golang.org/x/crypto/ssh/terminal to golang.org/x/term golang.org/x/crypto/ssh/terminal is deprecated. The package was moved to golang.org/x/term. golang.org/x/crypto/ssh/terminal was already just calling golang.org/x/term itslef so there are no functional changes. Signed-off-by: Paul Holzinger --- cmd/podman/containers/export.go | 4 ++-- cmd/podman/containers/run.go | 4 ++-- cmd/podman/images/load.go | 4 ++-- cmd/podman/images/save.go | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) (limited to 'cmd/podman') diff --git a/cmd/podman/containers/export.go b/cmd/podman/containers/export.go index 0fed94e86..681df93e0 100644 --- a/cmd/podman/containers/export.go +++ b/cmd/podman/containers/export.go @@ -11,7 +11,7 @@ import ( "github.com/containers/podman/v4/pkg/domain/entities" "github.com/pkg/errors" "github.com/spf13/cobra" - "golang.org/x/crypto/ssh/terminal" + "golang.org/x/term" ) var ( @@ -69,7 +69,7 @@ func init() { func export(cmd *cobra.Command, args []string) error { if len(exportOpts.Output) == 0 { file := os.Stdout - if terminal.IsTerminal(int(file.Fd())) { + if term.IsTerminal(int(file.Fd())) { return errors.Errorf("refusing to export to terminal. Use -o flag or redirect") } exportOpts.Output = "/dev/stdout" diff --git a/cmd/podman/containers/run.go b/cmd/podman/containers/run.go index 1d98eb3b3..4ad8d3183 100644 --- a/cmd/podman/containers/run.go +++ b/cmd/podman/containers/run.go @@ -18,7 +18,7 @@ import ( "github.com/pkg/errors" "github.com/sirupsen/logrus" "github.com/spf13/cobra" - "golang.org/x/crypto/ssh/terminal" + "golang.org/x/term" ) var ( @@ -112,7 +112,7 @@ func run(cmd *cobra.Command, args []string) error { var err error // TODO: Breaking change should be made fatal in next major Release - if cliVals.TTY && cliVals.Interactive && !terminal.IsTerminal(int(os.Stdin.Fd())) { + if cliVals.TTY && cliVals.Interactive && !term.IsTerminal(int(os.Stdin.Fd())) { logrus.Warnf("The input device is not a TTY. The --tty and --interactive flags might not work properly") } diff --git a/cmd/podman/images/load.go b/cmd/podman/images/load.go index 30f88b02b..6f85fb7e7 100644 --- a/cmd/podman/images/load.go +++ b/cmd/podman/images/load.go @@ -16,7 +16,7 @@ import ( "github.com/containers/podman/v4/pkg/util" "github.com/pkg/errors" "github.com/spf13/cobra" - "golang.org/x/crypto/ssh/terminal" + "golang.org/x/term" ) var ( @@ -90,7 +90,7 @@ func load(cmd *cobra.Command, args []string) error { return err } } else { - if terminal.IsTerminal(int(os.Stdin.Fd())) { + if term.IsTerminal(int(os.Stdin.Fd())) { return errors.Errorf("cannot read from terminal. Use command-line redirection or the --input flag.") } outFile, err := ioutil.TempFile(util.Tmpdir(), "podman") diff --git a/cmd/podman/images/save.go b/cmd/podman/images/save.go index a9fe675e1..fb642bafd 100644 --- a/cmd/podman/images/save.go +++ b/cmd/podman/images/save.go @@ -14,7 +14,7 @@ import ( "github.com/containers/podman/v4/pkg/util" "github.com/pkg/errors" "github.com/spf13/cobra" - "golang.org/x/crypto/ssh/terminal" + "golang.org/x/term" ) var ( @@ -109,7 +109,7 @@ func save(cmd *cobra.Command, args []string) (finalErr error) { if len(saveOpts.Output) == 0 { saveOpts.Quiet = true fi := os.Stdout - if terminal.IsTerminal(int(fi.Fd())) { + if term.IsTerminal(int(fi.Fd())) { return errors.Errorf("refusing to save to terminal. Use -o flag or redirect") } pipePath, cleanup, err := setupPipe() -- cgit v1.2.3-54-g00ecf