Skip to content

DPE-8980 Support Juju 4: use 'ip' instead of 'private-address' (if available)#1318

Merged
taurus-forever merged 2 commits into16/edgefrom
alutay/juju4_support
Feb 6, 2026
Merged

DPE-8980 Support Juju 4: use 'ip' instead of 'private-address' (if available)#1318
taurus-forever merged 2 commits into16/edgefrom
alutay/juju4_support

Conversation

@taurus-forever
Copy link
Copy Markdown
Contributor

@taurus-forever taurus-forever commented Nov 27, 2025

Issue

No Juju 4 support by the charm.

Solution

The Juju 4 has removed support databag fiesl private-address, ingress-address and more. The field we should use is ip now. The PG16 charm still have to support Juju 3.6 LTS, so adding support of the ip field with backward compatibility.

We are not going to allow Juju 4 deployments (assume in metadata.yaml),
however users can use the following command to test Juju 4:

juju deploy postgresql --channel 16/edge --force

@taurus-forever taurus-forever added the enhancement New feature, UI change, or workload upgrade label Nov 27, 2025
@github-actions github-actions Bot added the Libraries: OK The charm libs used are OK and in-sync label Nov 27, 2025
@codecov
Copy link
Copy Markdown

codecov Bot commented Nov 27, 2025

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 70.70%. Comparing base (18cf99b) to head (9c0441e).
⚠️ Report is 4 commits behind head on 16/edge.

Files with missing lines Patch % Lines
src/relations/tls.py 0.00% 0 Missing and 1 partial ⚠️

❌ Your patch status has failed because the patch coverage (0.00%) is below the target coverage (33.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@           Coverage Diff            @@
##           16/edge    #1318   +/-   ##
========================================
  Coverage    70.70%   70.70%           
========================================
  Files           16       16           
  Lines         4298     4298           
  Branches       691      691           
========================================
  Hits          3039     3039           
  Misses        1049     1049           
  Partials       210      210           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@taurus-forever
Copy link
Copy Markdown
Contributor Author

No quick win :-(

ERROR juju.worker.uniter.context cannot apply changes: creating secrets: secret with label "database-peers.postgresql.unit" already exists

image

Need further investigation. No Juju Secret changes spotted in Juju 4 release notes

@taurus-forever
Copy link
Copy Markdown
Contributor Author

taurus-forever commented Nov 27, 2025

It looks like Juju 4 doesn't allow the same Juju Secrets label for different units, while it used to work well in Juju 3.6:

> juju version
3.6.12-genericlinux-amd64

> juju secrets
ID                    Name  Owner         Rotation  Revision  Last updated
d4k4mdm05d8c5p9k29r0  -     postgresql    never            1  10 minutes ago  
d4k4mem05d8c5p9k29rg  -     postgresql/0  never            1  9 minutes ago   
d4k4q7u05d8c5p9k29s0  -     postgresql/1  never            1  2 minutes ago   

> juju show-secret d4k4mem05d8c5p9k29rg
d4k4mem05d8c5p9k29rg:
  revision: 1
  owner: postgresql/0
  label: database-peers.postgresql.unit
  created: 2025-11-27T12:59:47Z
  updated: 2025-11-27T12:59:47Z
> juju show-secret d4k4q7u05d8c5p9k29s0
d4k4q7u05d8c5p9k29s0:
  revision: 1
  owner: postgresql/1
  label: database-peers.postgresql.unit
  created: 2025-11-27T13:07:44Z
  updated: 2025-11-27T13:07:44Z

Juju 4 doesn't allow to create secret with label database-peers.postgresql.unit for postgresql/1 as it is already exist for postgresql/0.

Branched to juju/juju#21344

@taurus-forever
Copy link
Copy Markdown
Contributor Author

taurus-forever commented Dec 2, 2025

The issue juju/juju#21344 has been fixed, and now PostgreSQL cluster can be deployed.
However no success with the relation to postgresql-test-app nor data-integrator 😢
Juju belives the relation has been established succesfully, but no juju secret created with app credentials => app stays pending for data... the further investigation required.

Reproducer: juju deploy postgresql --channel 16/edge/juju4

@github-actions github-actions Bot added Libraries: Out of sync The charm libs used are out-of-sync and removed Libraries: OK The charm libs used are OK and in-sync labels Feb 3, 2026
…ddress')

The Juju 4 has removed support databag fiesl `private-address`, `ingress-address` and more.
The field we should use is `ip` now. The PG16 charm still have to support Juju 3.6 LTS,
so adding support of the ip field with backward compatibility.

Users can deploy it on Juju 4 using:
> juju deploy postgresql --channel 16/edge --force
@taurus-forever taurus-forever marked this pull request as ready for review February 3, 2026 22:04
Comment thread src/relations/tls.py Outdated
@taurus-forever taurus-forever merged commit 114f032 into 16/edge Feb 6, 2026
259 of 271 checks passed
@taurus-forever taurus-forever deleted the alutay/juju4_support branch February 6, 2026 13:59
marceloneppel pushed a commit that referenced this pull request Mar 10, 2026
…ailable) (#1318)

* DPE-8980 Support Juju 4: us 'ip' databag field (overwrites 'private-address')

The Juju 4 has removed support databag fiesl `private-address`, `ingress-address` and more.
The field we should use is `ip` now. The PG16 charm still have to support Juju 3.6 LTS,
so adding support of the ip field with backward compatibility.

Users can deploy it on Juju 4 using:
> juju deploy postgresql --channel 16/edge --force

* Address comments in PR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature, UI change, or workload upgrade Libraries: Out of sync The charm libs used are out-of-sync

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants