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

fix: correct S3 bucket owner label key to prevent retrieval errors #14913

Merged
merged 9 commits into from
Nov 21, 2024

Conversation

AmitRay9615
Copy link
Contributor

@AmitRay9615 AmitRay9615 commented Nov 14, 2024

What this PR does / why we need it:

This PR corrects a variable name used to access the S3 bucket owner in the processS3Event function. Currently, labels["bucketOwner"] is used, which results in an error as it should be labels["bucket_owner"] to match the key name in the labels map. This fix ensures that the code correctly retrieves the bucket owner identity from the S3 event, preventing failures during object retrieval.

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

This change addresses an error encountered when fetching objects from an S3 bucket due to an incorrect map key reference. The update aligns the variable name with the correct label key.

Checklist

  • Reviewed the CONTRIBUTING.md guide (required)
  • [] Documentation added
  • [] Tests updated
  • Title matches the required conventional commits format, see here
    • Note that Promtail is considered to be feature complete, and future development for logs collection will be in Grafana Alloy. As such, feat PRs are unlikely to be accepted unless a case can be made for the feature actually being a bug fix to existing behavior.
  • [] Changes that require user attention or interaction to upgrade are documented in docs/sources/setup/upgrade/_index.md
  • [] If the change is deprecating or removing a configuration option, update the deprecated-config.yaml and deleted-config.yaml files respectively in the tools/deprecated-config-checker directory. Example PR

@AmitRay9615 AmitRay9615 requested a review from a team as a code owner November 14, 2024 09:20
@CLAassistant
Copy link

CLAassistant commented Nov 14, 2024

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor Author

@AmitRay9615 AmitRay9615 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

@AmitRay9615 AmitRay9615 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rafaelroquetto @zerok . please review

Copy link
Contributor Author

@AmitRay9615 AmitRay9615 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@paul1 please review

Copy link
Contributor Author

@AmitRay9615 AmitRay9615 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@trevorwhitney
Copy link
Collaborator

@AmitRay9615 sorry you've had to wait so long on this, but I've never touched or used lambda promtail so I don't feel like the right person to review this for you. I think we need a code owner for lambda promtail, I will bring this up with the other maintainers to try and get a volunteer.

Copy link
Contributor Author

@AmitRay9615 AmitRay9615 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@trevorwhitney thanks. It would be great help. Thanks once again

Copy link
Contributor Author

@AmitRay9615 AmitRay9615 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@paul1r could you please review this.

Copy link
Collaborator

@paul1r paul1r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change appears to be correct. Label parsing done here puts the bucket owner data into bucket_owner, not bucketOwner.

I also note that we don't have a test function for processS3Event, but it appears that would require a large amount of mocking. It however should have caught this issue.

Thanks for the contribution!

This potentially may cause an update to the nix checksum @trevorwhitney

@AmitRay9615
Copy link
Contributor Author

Change appears to be correct. Label parsing done here puts the bucket owner data into bucket_owner, not bucketOwner.

I also note that we don't have a test function for processS3Event, but it appears that would require a large amount of mocking. It however should have caught this issue.

Thanks for the contribution!

This potentially may cause an update to the nix checksum @trevorwhitney

Thank you @paul1r @trevorwhitney .
When these changes got merge in main branch?
Thanks for review @paul1r

@paul1r paul1r merged commit 85aaf63 into grafana:main Nov 21, 2024
57 checks passed
@paul1r
Copy link
Collaborator

paul1r commented Nov 21, 2024

nix squared away via this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants