Skip to content

Conversation

@awprice
Copy link
Contributor

@awprice awprice commented Sep 18, 2025

Description of changes

Ensure custom EndpointResolver is still used when either EKS_POD_EXECUTION_ROLE environment variable is set OR when role_arn parameter is set.

This ensures the endpoint parameter is still used in either of these cases.

Testing

I have confirmed with the newly added unit test that this bug is fixed:

Before:

$ go test ./kinesis/...
time="2025-09-18T17:21:09+10:00" level=warning msg="[kinesis 0] Found record with 6291478 bytes, truncating to 1MB, stream=stream\n"
time="2025-09-18T17:21:09+10:00" level=warning msg="[kinesis 0] Found record with 6291477 bytes, truncating to 1MB, stream=stream\n"
time="2025-09-18T17:21:09+10:00" level=error msg="[kinesis 0] The partition key could not be found in the record, using a random string instead"
time="2025-09-18T17:21:09+10:00" level=error msg="[kinesis 0] The partition key could not be found in the record, using a random string instead"
--- FAIL: TestNewPutRecordsClient_CustomEndpointWithRoles (0.00s)
    --- FAIL: TestNewPutRecordsClient_CustomEndpointWithRoles/with_role_arn (0.00s)
        kinesis_test.go:453: 
            	Error Trace:	/Users/<redacted>/go/src/github.com/aws/amazon-kinesis-streams-for-fluent-bit/kinesis/kinesis_test.go:453
            	Error:      	Not equal: 
            	            	expected: "https://kinesis.custom-domain.local"
            	            	actual  : "https://kinesis.us-west-2.amazonaws.com"
            	            	
            	            	Diff:
            	            	--- Expected
            	            	+++ Actual
            	            	@@ -1 +1 @@
            	            	-https://kinesis.custom-domain.local
            	            	+https://kinesis.us-west-2.amazonaws.com
            	Test:       	TestNewPutRecordsClient_CustomEndpointWithRoles/with_role_arn
            	Messages:   	Custom endpoint should be preserved when using role-based authentication
    --- FAIL: TestNewPutRecordsClient_CustomEndpointWithRoles/with_eks_role (0.00s)
        kinesis_test.go:453: 
            	Error Trace:	/Users/<redacted>/go/src/github.com/aws/amazon-kinesis-streams-for-fluent-bit/kinesis/kinesis_test.go:453
            	Error:      	Not equal: 
            	            	expected: "https://kinesis.custom-domain.local"
            	            	actual  : "https://kinesis.us-west-2.amazonaws.com"
            	            	
            	            	Diff:
            	            	--- Expected
            	            	+++ Actual
            	            	@@ -1 +1 @@
            	            	-https://kinesis.custom-domain.local
            	            	+https://kinesis.us-west-2.amazonaws.com
            	Test:       	TestNewPutRecordsClient_CustomEndpointWithRoles/with_eks_role
            	Messages:   	Custom endpoint should be preserved when using role-based authentication
    --- FAIL: TestNewPutRecordsClient_CustomEndpointWithRoles/with_both_roles (0.00s)
        kinesis_test.go:453: 
            	Error Trace:	/Users/<redacted>/go/src/github.com/aws/amazon-kinesis-streams-for-fluent-bit/kinesis/kinesis_test.go:453
            	Error:      	Not equal: 
            	            	expected: "https://kinesis.custom-domain.local"
            	            	actual  : "https://kinesis.us-west-2.amazonaws.com"
            	            	
            	            	Diff:
            	            	--- Expected
            	            	+++ Actual
            	            	@@ -1 +1 @@
            	            	-https://kinesis.custom-domain.local
            	            	+https://kinesis.us-west-2.amazonaws.com
            	Test:       	TestNewPutRecordsClient_CustomEndpointWithRoles/with_both_roles
            	Messages:   	Custom endpoint should be preserved when using role-based authentication
FAIL
FAIL	github.com/aws/amazon-kinesis-streams-for-fluent-bit/kinesis	0.991s
?   	github.com/aws/amazon-kinesis-streams-for-fluent-bit/kinesis/mock_kinesis	[no test files]
FAIL

After:

$ go test ./kinesis/...
ok  	github.com/aws/amazon-kinesis-streams-for-fluent-bit/kinesis	0.968s
?   	github.com/aws/amazon-kinesis-streams-for-fluent-bit/kinesis/mock_kinesis	[no test files]

…UTION_ROLE

environment variable is set OR when role_arn parameter is set.

This ensures the endpoint parameter is still used in either of these cases.

Signed-off-by: Alex Price <[email protected]>
@awprice awprice requested a review from a team as a code owner September 18, 2025 07:02
Signed-off-by: Alex Price <[email protected]>
@TheanLim TheanLim merged commit 170390b into aws:mainline Oct 7, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants