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] Only update tls flags on the Juju leader unit #770

Merged
merged 1 commit into from
Nov 18, 2024

Conversation

dragomirp
Copy link
Contributor

@dragomirp dragomirp commented Nov 14, 2024

Issue

Trying to update tls flags in the client relation data from follower unit causes warnings:

2024-11-14T03:01:16.3917364Z unit-postgresql-k8s-2: 03:00:51 ERROR unit.postgresql-k8s/2.juju-log This operation (update_relation_data()) can only be performed by the leader unit
2024-11-14T03:01:16.3935892Z unit-postgresql-k8s-2: 03:00:51 ERROR unit.postgresql-k8s/2.juju-log This operation (update_relation_data()) can only be performed by the leader unit

Solution

Check leadership before setting the relation data

Copy link

codecov bot commented Nov 14, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 75.46%. Comparing base (2a7f044) to head (12226b5).
Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
src/relations/postgresql_provider.py 50.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #770      +/-   ##
==========================================
- Coverage   75.60%   75.46%   -0.15%     
==========================================
  Files          12       12              
  Lines        3116     3118       +2     
  Branches      475      476       +1     
==========================================
- Hits         2356     2353       -3     
- Misses        617      622       +5     
  Partials      143      143              

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

@dragomirp dragomirp changed the title [MISC] Only update tls flags on leader [MISC] Only update tls flags on the Juju leader unit Nov 14, 2024
@dragomirp dragomirp marked this pull request as ready for review November 14, 2024 14:10
@dragomirp dragomirp requested review from a team, taurus-forever, marceloneppel and lucasgameiroborges and removed request for a team November 14, 2024 14:10
@taurus-forever
Copy link
Contributor

@dragomirp Thank you for the housekeeping reaction to the warnings!

@dragomirp dragomirp merged commit c5e6100 into main Nov 18, 2024
105 checks passed
@dragomirp dragomirp deleted the suppress-leader-only-warnings branch November 18, 2024 13:19
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