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
- Use
go.opentelemetry.io/contrib/detectors/aws/eks.
- Run the detector with a caller context that has no deadline, such as
context.Background().
- In an EKS-like environment, make the Kubernetes API request hang or remain unreachable while ConfigMap retrieval is attempted.
- Run the PoC from the artifact zip or inspect
detectors/aws/eks/detector.go.
- 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.
Description
The EKS detector relies entirely on caller-provided context cancellation for Kubernetes API calls. Current-tree validation showed
Detectpasses the caller context through toisEKSandgetClusterName, andgetConfigMappasses that context directly to client-goConfigMaps().Get(...)without adding a timeout or deadline.Steps To Reproduce
13-3bb8797755288191ba7ed4d8311136ce-eks-detector-lacks-timeout-on-kubernetes-api-calls.zip
go.opentelemetry.io/contrib/detectors/aws/eks.context.Background().detectors/aws/eks/detector.go.Detectcan 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.