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

[MISC] Enable Juju 3.6 #813

Merged
merged 4 commits into from
Jan 8, 2025
Merged

[MISC] Enable Juju 3.6 #813

merged 4 commits into from
Jan 8, 2025

Conversation

dragomirp
Copy link
Contributor

@dragomirp dragomirp commented Jan 7, 2025

Fix missing certificates in Juju 3.6

Copy link

codecov bot commented Jan 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.57%. Comparing base (b9f24b2) to head (3a375ec).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #813   +/-   ##
=======================================
  Coverage   75.57%   75.57%           
=======================================
  Files          12       12           
  Lines        3108     3108           
  Branches      464      464           
=======================================
  Hits         2349     2349           
  Misses        620      620           
  Partials      139      139           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines +133 to +136
if not event.certificate:
logger.debug("No certificate available.")
event.defer()
return
Copy link
Contributor Author

Choose a reason for hiding this comment

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

In local deployments there were None certificates in the charm's internal secrets for the follower units. I think the CertificateAvailableEvent triggers for the application, not the unit.

Copy link
Contributor

Choose a reason for hiding this comment

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

@dragomirp Q: How MySQL charm handles this?

Comment on lines +138 to +147
chain = self.charm.get_secret(SCOPE, "chain")
new_chain = "\n".join(event.chain) if event.chain is not None else None
if chain != new_chain:
self.charm.set_secret(SCOPE, "chain", new_chain)
cert = self.charm.get_secret(SCOPE, "cert")
if cert != event.certificate:
self.charm.set_secret(SCOPE, "cert", event.certificate)
ca = self.charm.get_secret(SCOPE, "ca")
if ca != event.ca:
self.charm.set_secret(SCOPE, "ca", event.ca)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this fires a secret_changed event even if the secret value is the same.

Copy link
Member

Choose a reason for hiding this comment

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

So, it's worth reporting it as either a DP-Libs or a Juju bug.

@dragomirp
Copy link
Contributor Author

Revision 281 (testing for the primary label change) does not seem to idle on Juju 3.6, even when using the correct resource (Juju 3.4 deploys an image with PG 14.11, Juju 3.6 deploys an image with PG 14.13). How should I proceed here? Should I disable the test?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For focal compatibility, unrelated to the TLS issue.

@dragomirp dragomirp requested review from a team, taurus-forever, marceloneppel and lucasgameiroborges and removed request for a team January 7, 2025 20:13
Comment on lines +133 to +136
if not event.certificate:
logger.debug("No certificate available.")
event.defer()
return
Copy link
Contributor

Choose a reason for hiding this comment

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

@dragomirp Q: How MySQL charm handles this?

@dragomirp
Copy link
Contributor Author

dragomirp commented Jan 8, 2025

Revision 281 (testing for the primary label change) does not seem to idle on Juju 3.6, even when using the correct resource (Juju 3.4 deploys an image with PG 14.11, Juju 3.6 deploys an image with PG 14.13). How should I proceed here? Should I disable the test?

Marking label tests as unstable for the time being. The ticket to remove that logic is DPE-5443

@dragomirp dragomirp marked this pull request as ready for review January 8, 2025 16:08
Comment on lines +138 to +147
chain = self.charm.get_secret(SCOPE, "chain")
new_chain = "\n".join(event.chain) if event.chain is not None else None
if chain != new_chain:
self.charm.set_secret(SCOPE, "chain", new_chain)
cert = self.charm.get_secret(SCOPE, "cert")
if cert != event.certificate:
self.charm.set_secret(SCOPE, "cert", event.certificate)
ca = self.charm.get_secret(SCOPE, "ca")
if ca != event.ca:
self.charm.set_secret(SCOPE, "ca", event.ca)
Copy link
Member

Choose a reason for hiding this comment

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

So, it's worth reporting it as either a DP-Libs or a Juju bug.

@dragomirp dragomirp merged commit de74296 into main Jan 8, 2025
99 checks passed
@dragomirp dragomirp deleted the juju-36 branch January 8, 2025 20:53
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