Skip to content

exec_auth spawns the command synchronously  #2044

Closed
@feloy

Description

@feloy

Describe the bug

exec_auth spawns the command synchronously.

When the exec command sends information to stdout/stderr to inform the user what to do to authenticate, the program is blocked waiting indefinitely, because the spawn is done synchronously.

** Client Version **
1.0.0-rc7

** Server Version **

Azure 1.29.9

To Reproduce

  • Start an Azure cluster with 'Microsoft Entra ID authentication with Kubernetes RBAC' authn & authz
  • get the credentials
  • do not execute any request to the cluster, so the token is not cached (or you can remove it: rm ~/.kube/cache/kubelogin/yourID.json
  • make a request to the API
  • the program is blocked executing the kubelogin app, which is blocked, waiting for the user to authenticate

Expected behavior

The call should be done async
bonus: the information provided by kubelogin should be displayed to the user

** Example Code**

import { CoreV1Api, KubeConfig } from "@kubernetes/client-node";

const kc = new KubeConfig();
kc.loadFromDefault();

const k8sApi = kc.makeApiClient(CoreV1Api);
const result = k8sApi.listNamespace();

Environment (please complete the following information):

  • OS: MacOS
  • NodeJS Version: v20.15.1
  • Cloud runtime: Azure

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions