-
Notifications
You must be signed in to change notification settings - Fork 15.4k
MINOR: fix system test TestSecurityRollingUpgrade #10694
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -89,18 +89,21 @@ def add_sasl_mechanism(self, new_client_sasl_mechanism): | |
| self.bounce() | ||
|
|
||
| def roll_in_sasl_mechanism(self, security_protocol, new_sasl_mechanism): | ||
| # Roll cluster to update inter-broker SASL mechanism. This disables the old mechanism. | ||
| # Roll cluster to update inter-broker SASL mechanism. | ||
| # We need the inter-broker SASL mechanism to still be enabled through this roll. | ||
| self.kafka.client_sasl_mechanism = "%s,%s" % (self.kafka.interbroker_sasl_mechanism, new_sasl_mechanism) | ||
| self.kafka.interbroker_sasl_mechanism = new_sasl_mechanism | ||
| self.bounce() | ||
|
|
||
| # Bounce again with ACLs for new mechanism. | ||
| self.kafka.client_sasl_mechanism = new_sasl_mechanism # Removes old SASL mechanism completely | ||
| self.set_authorizer_and_bounce(security_protocol, security_protocol) | ||
|
|
||
| def add_separate_broker_listener(self, broker_security_protocol, broker_sasl_mechanism): | ||
| # Enable the new internal listener on all brokers first | ||
| self.kafka.open_port(self.kafka.INTERBROKER_LISTENER_NAME) | ||
| self.kafka.port_mappings[self.kafka.INTERBROKER_LISTENER_NAME].security_protocol = broker_security_protocol | ||
| self.kafka.client_sasl_mechanism = broker_sasl_mechanism | ||
| self.kafka.port_mappings[self.kafka.INTERBROKER_LISTENER_NAME].sasl_mechanism = broker_sasl_mechanism | ||
|
Comment on lines
-103
to
+106
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can't rely on the client SASL mechanism here with the KRaft-related changes that were made in #10199 because those KRaft changes made the code very explicit about which SASL mechanisms to add: if the client security protocol is PLAINTEXT then the client SASL mechanism isn't listed as an enabled mechanism. And in fact for this test the client security protocol is PLAINTEXT. So we need another way to transmit the SASL mechanism, and that's what the new optional |
||
| self.bounce() | ||
|
|
||
| # Update inter-broker listener after all brokers have been updated to enable the new listener | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we make use of this new argument anywhere? I can't seem to find any
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! I missed leveraging this, and it results in
sasl.enabled.mechanisms=(i.e. blank) on the first of the two rolls. The test was still passing, but I think that's just luck. I've fixed it inkafka.py-- we now pass in the SASL mechanism, and we are now seeingsasl.enabled.mechanisms=PLAINas expected.