Skip to content

aws: EKS detector lacks timeout on Kubernetes API calls #9073

@pellared

Description

@pellared

Description

The EKS detector relies entirely on caller-provided context cancellation for Kubernetes API calls. Current-tree validation showed Detect passes the caller context through to isEKS and getClusterName, and getConfigMap passes that context directly to client-go ConfigMaps().Get(...) without adding a timeout or deadline.

Steps To Reproduce

13-3bb8797755288191ba7ed4d8311136ce-eks-detector-lacks-timeout-on-kubernetes-api-calls.zip

  1. Use go.opentelemetry.io/contrib/detectors/aws/eks.
  2. Run the detector with a caller context that has no deadline, such as context.Background().
  3. In an EKS-like environment, make the Kubernetes API request hang or remain unreachable while ConfigMap retrieval is attempted.
  4. Run the PoC from the artifact zip or inspect detectors/aws/eks/detector.go.
  5. Observe that Detect can remain blocked until the caller context is canceled.

Expected behavior

The EKS detector should apply a bounded timeout or require an explicit deadline for Kubernetes API calls so resource detection cannot hang indefinitely when callers provide a context without cancellation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions