Skip to content

refactor(operator): drop dead ClusterName defaulting fallback - #88

Merged
fcanovai merged 3 commits into
mainfrom
refactor/remove-dead-clustername-fallback
Aug 13, 2026
Merged

refactor(operator): drop dead ClusterName defaulting fallback#88
fcanovai merged 3 commits into
mainfrom
refactor/remove-dead-clustername-fallback

Conversation

@armru

@armru armru commented Aug 12, 2026

Copy link
Copy Markdown
Member

PluginConfiguration.spec.clusterName is Required with MinLength=1, so the
API server rejects empty values. The two branches in klioconfig that defaulted
an empty ClusterName could no longer fire for any object written through the
current CRD, and they disagreed with each other anyway: one defaulted to the
external cluster's serverName, the other to cluster.Name.

This removes both, along with the stale comment claiming the cluster name
doubles as the host name.

A second commit tightens the documentation of the field: the restore example
still commented it as optional, and neither page mentioned that the value has to
match the host name in the client certificate's Common Name.

Behavior note

Objects created while the field was still optional (v0.0.7 to v0.0.12) are not
revalidated on read, so they can still be served with an empty clusterName.
Such an object now fails at client configuration validation with
invalid client config: cluster_name is empty instead of being silently
defaulted; setting clusterName on the resource fixes it.

Closes #69

@armru
armru force-pushed the refactor/remove-dead-clustername-fallback branch 2 times, most recently from 847f1fd to 1996802 Compare August 12, 2026 12:22
@gabriele-wolfox
gabriele-wolfox force-pushed the refactor/remove-dead-clustername-fallback branch from 50e8051 to f805fbc Compare August 12, 2026 13:50
@leonardoce
leonardoce force-pushed the refactor/remove-dead-clustername-fallback branch from f805fbc to 4b30df8 Compare August 13, 2026 08:24
armru and others added 3 commits August 13, 2026 10:47
The `PluginConfiguration.spec.clusterName` field has been `Required` with
`MinLength=1` since the auto-propagation work, so the API server rejects
empty values and the two defaulting branches in klioconfig could no
longer fire for any object written through the current CRD.

Remove both branches, along with the stale comment claiming the cluster
name doubles as the host name.

Objects created while the field was still optional (v0.0.7 to v0.0.12)
are not revalidated on read, so they can still carry an empty
`clusterName`. Those now fail at client configuration validation with
`invalid client config: cluster_name is empty` instead of being silently
defaulted; setting `clusterName` on the resource fixes them.

Closes #69

Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
The restore example commented `clusterName` as optional, while the field is
`Required` with `MinLength=1`, so omitting it is rejected by the API server.

Also state explicitly that the value must match the host name in the Common
Name of the client certificate, which is the constraint the Kopia client
enforces at connection time.

Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Tier 1 base backups reject a Common Name mismatch at connection time,
but WAL streaming has no such check and can silently misroute WALs.
Also drops a stale GenerateConfig comment for a removed parameter.

Signed-off-by: Gabriele Quaresima <gabriele.quaresima@enterprisedb.com>
@gabriele-wolfox
gabriele-wolfox force-pushed the refactor/remove-dead-clustername-fallback branch from 4b30df8 to baebd42 Compare August 13, 2026 08:48
@fcanovai
fcanovai merged commit 25cd467 into main Aug 13, 2026
16 checks passed
@fcanovai
fcanovai deleted the refactor/remove-dead-clustername-fallback branch August 13, 2026 09:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove dead ClusterName defaulting fallback in klioconfig

4 participants