Skip to content

[DPE-10607] Substrate-aware CharmState SAN/CN accessors (2/4)#177

Merged
marceloneppel merged 2 commits into
16/edgefrom
tls-2-state-accessors
Jul 9, 2026
Merged

[DPE-10607] Substrate-aware CharmState SAN/CN accessors (2/4)#177
marceloneppel merged 2 commits into
16/edgefrom
tls-2-state-accessors

Conversation

@marceloneppel

Copy link
Copy Markdown
Member

Issue

#173 (PR 2/4 of the TLS-state work) was incorrectly merged into tls-1-state instead of 16/edge. This re-applies the same change, rebased onto current 16/edge (which already carries 1/4 via #165), so the branch targets the correct base.

Solution

Cherry-picks PR #173's two original commits onto origin/16/edge:

  • substrate-aware CharmState TLS SAN/CN accessors (core/state.py + two unit-test files)
  • docstring trim on _k8s_cert_common_name

The resulting tree is identical to the merged tls-1-state tip (4d9a0a5) — only the base moved from tls-1-state to 16/edge; no logical change vs. the reviewed #173.

Checklist

  • I have added or updated any relevant documentation.
  • I have cleaned any remaining cloud resources from my accounts.

Layer the certificate-SAN and common-name policy onto CharmState, on top of the raw peer-databag accessors from the previous branch, so the substrate-specific certificate identity is reviewable as a unit with its own tests before any manager or handler consumes it.

K8s must regain the parity the migration had dropped: common_hosts has to advertise the primary/replicas Service FQDNs and the resolved pod FQDN, and the operator-cert common name has to be the endpoints FQDN (wildcarded past the 64-char CN limit) rather than the VM-style host/address; the peer SAN set must exclude the ip key the original K8s charm never emitted. VM behaviour is left host/address-derived as before. The CharmState charm parameter is also widened to ops.CharmBase so the state object no longer depends on the concrete charm type.

These accessors are additive and only read state, so the existing charm keeps constructing unchanged.

Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
…cstring

The 'migration had switched this to VM-style ...; restore the endpoints-FQDN
CN for K8s parity' sentence narrates a completed regression fix and is
redundant with the preceding 'Matches the original K8s charm' line. The
format, wildcard rule, and parity rationale already carry the load-bearing
context; the migration history belongs in the original commit message, not
the docstring.

Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
@marceloneppel
marceloneppel marked this pull request as ready for review July 9, 2026 13:59
@marceloneppel
marceloneppel requested a review from a team as a code owner July 9, 2026 13:59
@marceloneppel
marceloneppel requested review from carlcsaposs-canonical, dragomirp, juju-charm-bot and taurus-forever and removed request for a team July 9, 2026 13:59
@marceloneppel
marceloneppel merged commit 0b4577e into 16/edge Jul 9, 2026
11 of 16 checks passed
@marceloneppel
marceloneppel deleted the tls-2-state-accessors branch July 9, 2026 17:25
marceloneppel added a commit that referenced this pull request Jul 9, 2026
Bring tls-3-manager-events up to date with 16/edge (now carries squashed
1/4 #165 + 2/4 #177). Reconciles cleanly: 16/edge's content is already
present in this branch via the unsquashed 1/4/2/4 commits.

Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
marceloneppel added a commit that referenced this pull request Jul 10, 2026
Bring tls-4-tests up to date with 16/edge (now carries squashed 1/4 #165,
2/4 #177, 3/4 #178). Content-neutral: 16/edge's 1/4-3/4 content is already
present via the unsquashed commits, so the merge only adds ancestry.

Signed-off-by: Marcelo Henrique Neppel <marcelo.neppel@canonical.com>
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