-
Notifications
You must be signed in to change notification settings - Fork 15
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
[DPE-3928] - feat: secrets integration #189
Conversation
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.
Mostly non-blocking nitpicks and questions. I have not reviewed the tests yet, I'll get back to them later
8637571
to
30528b2
Compare
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.
Changes look mostly fine. I have a couple of points worth raising
- I'm a bit concerned about the
update_client_data
which seems out of place and a bit off the new pattern. - Instantiation of
KafkaClient
using some "general" properties rather than the databag value.
Of the two, 1. is definitely more important than 2. But actually, these two may also nicely connect into one point, as I would suggest to refactor a bit the KafkaClient
class such that:
- it aligns a bit closer with the actual data shared with client applications over the relations
- It also provides implementation of writing to the databag, therefore having in the
update_client_data
method, and not spread databag schema/information in the charm code
Just discussed offline with Marc. Actually I did not realized that this pattern is also like this in ZK, here. Although also Marc is not fond of this, we can just keep it as-is for the time being, but I would like to improve this in the next weeks when we are together in Madrid. |
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.
Very thorough! I stole some changes that you added back to the Karapace PRs :)
Features
feat: zookeeper, peer and client data secrets supported
zookeeper
interface, and upcomingzookeeper_client
interface, optionally using secretschore: bump data_interfaces to v34
Refactoring
chore: support tls + tls-ca and ca + ca-cert
ca-cert
andca
in peer-data, cleaning up old ones when we get granted a new CAbool(tls-ca)
from ZooKeeper, defaulting to originaltls=enabled
refactor: align with ZooKeeper charm patterns
provider.update_connection_info()
-->charm.update_client_data()
with newstate.clients
+models.KafkaClient
literals.Substrate
-->core.models.SUBSTRATES
+literals.SUBSTRATE
state.broker
-->state.unit_broker
, mostly for clarity that this is 'the unit'test: replace model_full_name with ops_test
test: updating int-test helpers
test: sync unit-tests with K8s
Bug Fixes
fix: explicitly emit config_changed events where necessary
self._on_config_changed(event)
whenever we wanted to do thingsconfig_changed
deferred, it re-ran the whole event, which caused a whole lot of restarting issues and non-idempotent event handling and hard-to-grok event orderingcertificates-available
, which calledconfig_changed
, which deferred. Incertificates-available
, we have a check that says 'If I already have a cert, restart'. So after we deferred the event, we re-run it, have a cert, and restart, which we may not have wantedconfig-changed
event helps avoid issues like that, as only the 'changed' event gets deferredchore: avoid ruff warnings
pyproject.toml
to avoid warningstest: add async sleeps to int-tests
secret-changed
events where before we had 'instant'relation-changed
eventsfast-forward: asyncio.sleep
has helped somewhat. Will keep looking at this