mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-28 16:37:24 +02:00
cmd/pomerium-cli: do not require terminal with cached creds (#1196)
This commit is contained in:
parent
fa43db80c1
commit
a555e5fcc3
1 changed files with 5 additions and 4 deletions
|
@ -47,10 +47,6 @@ var kubernetesCmd = &cobra.Command{
|
|||
var kubernetesExecCredentialCmd = &cobra.Command{
|
||||
Use: "exec-credential",
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
if !terminal.IsTerminal(int(os.Stdin.Fd())) {
|
||||
return fmt.Errorf("only interactive sessions are supported")
|
||||
}
|
||||
|
||||
if len(args) < 1 {
|
||||
return fmt.Errorf("server url is required")
|
||||
}
|
||||
|
@ -66,6 +62,11 @@ var kubernetesExecCredentialCmd = &cobra.Command{
|
|||
return nil
|
||||
}
|
||||
|
||||
// require interactive session to handle login
|
||||
if !terminal.IsTerminal(int(os.Stdin.Fd())) {
|
||||
return fmt.Errorf("only interactive sessions are supported")
|
||||
}
|
||||
|
||||
li, err := net.Listen("tcp", "127.0.0.1:0")
|
||||
if err != nil {
|
||||
fatalf("failed to start listener: %v", err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue