Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression in ExecProvider for AWS EKS Token Retrieval after adding shell=True in exec_provider introduced in commit 2dfa782 #2356

Open
HaimLC opened this issue Feb 18, 2025 · 0 comments
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@HaimLC
Copy link

HaimLC commented Feb 18, 2025

Regression in ExecProvider for AWS EKS Token Retrieval

Summary

After commit 2dfa782, our AWS EKS token retrieval command fails when running in a Docker container using Python 3.11. Previously, the same command executed without errors. The regression appears linked to using shell=True for Windows compatibility.

Details

  1. What happened:

    • We run the following command arguments for the exec provider:

      ['aws', '--region', 'us-east-1', 'eks', 'get-token', '--cluster-name', 'cluster', '--output', 'json']
    • Under commit 2dfa782, the command fails. Debugging shows that when recreated without shell=True, it works as expected. When allowed to run as is (with shell=True), the stderr output indicates a failure.

    • Screenshot from the debugger (showing stderr, the recreation of the process, and the JSON output) is included below:

      Debug screenshot
  2. What you expected to happen:

    • The token retrieval command should run successfully, as in previous versions of the Python client.
  3. How to reproduce it:

    • Use a Docker container with Python 3.11:
      FROM python:3.11
      RUN pip install kubernetes
    • Configure AWS EKS or manually set self.args to:
      ['aws', '--region', 'us-east-1', 'eks', 'get-token', '--cluster-name', 'cluster', '--output', 'json']
    • Run:
      from kubernetes import client, config as kubeconfig
      kubeconfig.load_config()
    • Observe that the command fails when using the latest commit that includes shell=True.
  4. Environment:

    • Docker base image: python:3.11
    • Python version: 3.11
    • Kubernetes Python client version: 32.0.0
    • Relevant commit: 2dfa782

Additional Information

  • The issue appears tied to the introduction of shell=True in the code, presumably for Windows support. Removing or bypassing shell=True resolves the problem in a Linux-based environment.
@HaimLC HaimLC added the kind/bug Categorizes issue or PR as related to a bug. label Feb 18, 2025
@HaimLC HaimLC changed the title AWS EKS Token Retrieval Fails after shell=True in exec_provider introduced in commit 2dfa782 Regression in ExecProvider for AWS EKS Token Retrieval after adding shell=True in exec_provider introduced in commit 2dfa782 Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

1 participant