Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ExecProvider swallows interactive messages #1787

@JJ11teen

Description

@JJ11teen

What happened (please include outputs or screenshots):
When using kubelogin as an ExecProvider in kube config, upon initial use, kubelogin prints a message to stderr of the form:

To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code <device-code> to authenticate.

The current ExecProvider implementation swallows this message and blocks until the code times out and the kubelogin command returns (an exit code of 1).

What you expected to happen:
The ExecProvider implementation to provide some method to access the message such that it is either accessible to the python application to pass to a user, or passed to the user to action on some standard bus (stderr?).

How to reproduce it (as minimally and precisely as possible):
Have kubelogin installed
Have a kube config setup with exec using kubelogin:

<other config values>
users:
- name: aad-user
  user:
    exec:
      apiVersion: client.authentication.k8s.io/v1beta1
      command: kubelogin
      args: <kubelogin args depending on your azure auth setup>

Don't authenticate through another means first (ie using kubectl)
Attempt to auth using kubernetes library initially:

from kubernetes import config

config.load_kube_config()

Anything else we need to know?:
I don't believe this is kubelogin specific, but rather any exec auth provider that prompts for user action will have the same issue. Let me know if I'm off basis and this should be a kubelogin issue instead tho :)

Environment:
kubernetes (python): 23.3.0
kubelogin: v0.0.10
Beyond that not environment specific

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions