Skip to content

Commit 872fda1

Browse files
authored
PYTHON-4574 - FaaS detection logic mistakenly identifies EKS as AWS Lambda (mongodb#1908)
1 parent 9e38c54 commit 872fda1

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

test/asynchronous/test_client.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2019,6 +2019,22 @@ async def test_handshake_08_invalid_aws_ec2(self):
20192019
None,
20202020
)
20212021

2022+
async def test_handshake_09_container_with_provider(self):
2023+
await self._test_handshake(
2024+
{
2025+
ENV_VAR_K8S: "1",
2026+
"AWS_LAMBDA_RUNTIME_API": "1",
2027+
"AWS_REGION": "us-east-1",
2028+
"AWS_LAMBDA_FUNCTION_MEMORY_SIZE": "256",
2029+
},
2030+
{
2031+
"container": {"orchestrator": "kubernetes"},
2032+
"name": "aws.lambda",
2033+
"region": "us-east-1",
2034+
"memory_mb": 256,
2035+
},
2036+
)
2037+
20222038
def test_dict_hints(self):
20232039
self.db.t.find(hint={"x": 1})
20242040

test/test_client.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1977,6 +1977,22 @@ def test_handshake_08_invalid_aws_ec2(self):
19771977
None,
19781978
)
19791979

1980+
def test_handshake_09_container_with_provider(self):
1981+
self._test_handshake(
1982+
{
1983+
ENV_VAR_K8S: "1",
1984+
"AWS_LAMBDA_RUNTIME_API": "1",
1985+
"AWS_REGION": "us-east-1",
1986+
"AWS_LAMBDA_FUNCTION_MEMORY_SIZE": "256",
1987+
},
1988+
{
1989+
"container": {"orchestrator": "kubernetes"},
1990+
"name": "aws.lambda",
1991+
"region": "us-east-1",
1992+
"memory_mb": 256,
1993+
},
1994+
)
1995+
19801996
def test_dict_hints(self):
19811997
self.db.t.find(hint={"x": 1})
19821998

0 commit comments

Comments
 (0)