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

[exporter/kafkaexporter] Add support for configuring SASL handshake version #21075

Merged
merged 15 commits into from
Jul 11, 2023

Conversation

eduojeda
Copy link
Contributor

@eduojeda eduojeda commented Apr 19, 2023

Description:
Adds support for configuring SASL handshake version.

The new parameter defaults to 0 just like Sarama, so the change should be backwards compatible.

Link to tracking Issue: #21074

Testing:

  • Added a test for the check that the SASL version parameter is within the acceptable range
  • Built a custom collector and tested that the version setting works as expected.

Documentation:

  • Updated the README file to document the new SASL configuration parameter.

@eduojeda eduojeda requested a review from a team April 19, 2023 13:24
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Apr 19, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

@atoulme
Copy link
Contributor

atoulme commented Apr 20, 2023

Please add a CHANGELOG entry.

@eduojeda
Copy link
Contributor Author

eduojeda commented May 5, 2023

@atoulme I'm sorry, I'm a bit lost as to how to proceed here. Is there anything else I need to do or is this PR just waiting for a codeowner review now?

@atoulme
Copy link
Contributor

atoulme commented May 5, 2023

Please rebase to fix the build.

@eduojeda eduojeda requested a review from atoulme May 17, 2023 10:01
@github-actions
Copy link
Contributor

github-actions bot commented Jun 1, 2023

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added Stale and removed Stale labels Jun 1, 2023
@eduojeda
Copy link
Contributor Author

eduojeda commented Jun 2, 2023

@atoulme I've been notified that this branch has been marked as stale. As far as I can tell everything is ready for the merge. I've just re-synced with the upstream as well. Would it be possible to give it a final check? Thank you!

Copy link
Contributor

@MovieStoreGuy MovieStoreGuy left a comment

Choose a reason for hiding this comment

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

A few comments from me, I think this should also update the kafka receiver as well.


err := config.Validate()
assert.Error(t, err)
assert.Equal(t, err.Error(), "auth.sasl.version has to be either 0 or 1. configured value 42")
Copy link
Contributor

Choose a reason for hiding this comment

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

Same again here, you can collapse these both to assert.EqualError

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good shout, I corrected a couple other instances of this as well

Comment on lines 182 to 183
assert.Error(t, err)
assert.Equal(t, err.Error(), "auth.sasl.mechanism should be one of 'PLAIN', 'AWS_MSK_IAM', 'SCRAM-SHA-256' or 'SCRAM-SHA-512'. configured value FAKE")
Copy link
Contributor

Choose a reason for hiding this comment

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

use assert.EqualError instead, removes the need to check if it is an error and if the message is equal.


err := config.Validate()
assert.Error(t, err)
assert.Equal(t, err.Error(), "auth.sasl.version has to be either 0 or 1. configured value 42")
Copy link
Contributor

Choose a reason for hiding this comment

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

Same again here, you can collapse these both to assert.EqualError to save you need check if an error happened.

@eduojeda
Copy link
Contributor Author

@MovieStoreGuy I've addressed your comments, is there anything else that I should do to before we can merge the PR?

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

Successfully merging this pull request may close these issues.

3 participants