Skip to content

KubernetesClientConfiguration.BuildConfigFromConfigFile with ExternalExecution deadlocks waiting for exit #1542

Closed
@thejuan

Description

@thejuan

Describe the bug
KubernetesClientConfiguration.ExecuteExternalCommand causes a deadlock by waiting on the process before reading the Standard Output Stream this means the timeout occurs when the command actually completed successfully.

Kubernetes C# SDK Client Version
13.0.11

Dotnet Runtime Version
net8

To Reproduce
Call KubernetesClientConfiguration.BuildConfigFromConfigFile() using a config like below that relies on executing a plugin to authenticate. If the response payload is big enough the command will timeout. If you debug before the wait and manually evaluate the standard output stream with ReadToEnd, you'll see the command succeeds

KubeConfig

contexts:
- context:
    cluster: my-cluster
    user: oidc-prod
users:
- name: oidc-prod
  user:
    exec:
      apiVersion: client.authentication.k8s.io/v1beta1
      args:
      - oidc-login
      - get-token
      - --oidc-issuer-url=https://sso-url
      - --oidc-client-id=k8s-clusters-prod
      - --oidc-client-secret=my-secret
      command: kubectl
      env: null
      interactiveMode: IfAvailable
      provideClusterInfo: false

Where do you run your app with Kubernetes SDK (please complete the following information):

  • OS: Windows 11

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