Seven guides in docs/ were written next to the code and left in the
source tree, where no operator looks. The website carries them now, so
a second copy here only lets the two drift again: the Backup Classes
page had already fallen behind its original.
docs/release.md, docs/deprecating-applications.md and the two SeaweedFS
runbooks in docs/operations stay. A migration, a bats suite, a workflow
or AGENTS.md reads each of them by path, which is the test for keeping
a document in this repository.
Assisted-by: LLM
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
mariadb-operator up to v0.0.27 mounted the referenced ConfigMap key as
/etc/mysql/conf.d/my.cnf whatever the key was called. Since v0.0.28 the
file takes the key's own name, so the chart's key "config" became
/etc/mysql/conf.d/config, and the server's !includedir reads only *.cnf
files from that directory. Every setting in the chart's my.cnf has been
ignored since that operator bump: instances run on stock defaults,
including a 128M InnoDB buffer pool inside the 128Mi default limit.
Renaming the key restores the file as intended. Existing instances roll
their pods once, since the projected volume in the pod template changes,
and come back with the chart's settings in effect, including sql-mode
and innodb_flush_log_at_trx_commit, not only the resource sizing.
Fixes: a9c42c8ef0 ("Update mariadb-operator v0.28.1 (#124)")
Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
## What this PR does
This replaces the open Renovate PRs with one rollup. Go modules move to
their newest releases that keep the Kubernetes libraries and
controller-runtime where they are, the toolchain and builder images move
to Go 1.27.1, and the first-party code gets the Go 1.27 modernizers.
Tests for the code the bumps touch come first, in their own commits, and
pass on both the old and the new dependencies.
Before the bumps:
- The e2e sandbox image builds again: dl.min.io answers 410 for mc since
MinIO archived it, so mc now comes from its last GitHub release with a
pinned checksum.
- Renovate stops offering tags of the apimachinery fork. They mirror
upstream, so #2999 is a downgrade that drops our patch.
- `make unit-tests` now runs the tests of the nested Go modules
(kubevirt-csi-driver, token-proxy, kubeovn-webhook, api/apps/v1alpha1).
They never ran in CI before.
- New tests: JWT verification in the dashboard token proxy, the kube-ovn
plunger metrics, cert-manager object idempotency in the tenant gateway,
values-file layering in the operator, and the kubevirt CSI driver
wrapper.
- One real fix. The lineage webhook decoded admitted objects with
encoding/json, so an int64 above 2^53 came back rounded. jsonpatch v2.5
compares numbers exactly and would emit a replace that rewrites such a
field in the pod. The webhook now decodes with apimachinery's json.
Held back on purpose, with the reasons in the commit messages:
- Kubernetes libraries stay on v0.35. #3001 needs the apimachinery fork
rebased onto release-1.37 first.
- cel-go v0.29.2 and etcd v3.6.15, the lines k8s.io/apiserver v0.35 is
built and tested with.
- grpc v1.83.2. v1.84.0 is affected by GO-2026-6443 and no v1.84 patch
release carries the fix yet.
- kubevirt.io/api and the CDI API stay on what upstream csi-driver
builds against. From CDI v1.60 it no longer compiles.
- api/apps/v1alpha1 keeps go 1.26.4, so consumers of the published types
are not forced onto Go 1.27.
- go fix runs without embedlit (Go 1.27-only syntax, breaks backports to
release branches on Go 1.26) and omitzero (would make metadata, spec and
status required in the published OpenAPI schemas), and one errorsastype
rewrite that did not compile is left out.
govulncheck reports nothing reachable in any of the five modules,
standard library included.
Supersedes #4311, #4310, #4309, #3452, #3993, #3927, #3902, #3805,
#3451, #3415, #3414, #3413, #3302, #4050 and #3363. #3001 stays open.
Not checked locally: the images that build upstream projects (kube-ovn,
kamaji, cilium, linstor-csi and others) with the Go 1.27 builder. The
image build jobs of this PR cover them.
Closes#4487.
### Screenshots
No UI changes.
### Downstream repositories
- [x] No downstream repository is affected by this change
- [ ] [cozystack/website](https://github.com/cozystack/website) -
follow-up:
- [ ]
[cozystack/terraform-provider-cozystack](https://github.com/cozystack/terraform-provider-cozystack)
- follow-up:
- [ ]
[cozystack/ansible-cozystack](https://github.com/cozystack/ansible-cozystack)
- follow-up:
- [ ] [cozystack/ccp](https://github.com/cozystack/ccp) - follow-up:
- [ ] [cozystack/talm](https://github.com/cozystack/talm) - follow-up:
- [ ] [cozystack/cozyhr](https://github.com/cozystack/cozyhr) -
follow-up:
- [ ] [cozystack/cozy-proxy](https://github.com/cozystack/cozy-proxy) -
follow-up:
- [ ]
[cozystack/cozystack-telemetry-server](https://github.com/cozystack/cozystack-telemetry-server)
- follow-up:
- [ ]
[cozystack/external-apps-example](https://github.com/cozystack/external-apps-example)
- follow-up:
- [ ] [cozystack/examples](https://github.com/cozystack/examples) -
follow-up:
- [ ] [cozystack/community](https://github.com/cozystack/community) -
follow-up:
### Release note
```release-note
chore(deps): move the toolchain and builder images to Go 1.27.1 and raise Go dependencies to their latest compatible releases, closing the published advisories; the lineage webhook no longer rewrites int64 fields above 2^53 in admitted objects.
```
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **New Features**
* Added a restore resource policy option for Velero strategies.
* Added a test target to run Go tests across tracked modules.
* **Bug Fixes**
* Updated the end-to-end test environment to download and verify the
MinIO client from its current release location.
* Added coverage for token validation, webhook patching, controller
behavior, and reconciliation.
* **Maintenance**
* Updated the Go toolchain, dependencies, and container image versions.
* Refreshed pinned workflow actions and base image digests.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## What this PR does
Corrects two sentences of the boilerplate shared by the app READMEs,
both raised in the review of #3936.
- "When left empty, the preset defined in `resourcesPreset` is applied"
describes an all-or-nothing rule, but
`cozy-lib.resources.defaultingSanitize` merges per key: every resource
`resources` leaves unset is taken from the preset. Twelve READMEs
carried the sentence.
- The legacy flat names were called aliases of their "1:1 instance-type
equivalents", which reads as the `c1` series listed just before it.
`nano` through `small` equal the `t1` sizes, and `medium` equals
`c1.small` rather than `c1.medium`, the trap
`docs/operations/resource-presets.md` already warns about. Ten READMEs
carried the sentence.
Only the hand-written section changes. `make generate` for all twelve
packages leaves the diff at exactly those 22 lines.
### Screenshots
Not a UI change.
### Downstream repositories
Walked the trigger map against the diff: README prose only, no values,
schema, default or package change. The website regenerates the app
reference pages from these READMEs on release, so nothing to open there.
- [x] No downstream repository is affected by this change
- [ ] [cozystack/website](https://github.com/cozystack/website) -
follow-up:
- [ ]
[cozystack/terraform-provider-cozystack](https://github.com/cozystack/terraform-provider-cozystack)
- follow-up:
- [ ]
[cozystack/ansible-cozystack](https://github.com/cozystack/ansible-cozystack)
- follow-up:
- [ ] [cozystack/ccp](https://github.com/cozystack/ccp) - follow-up:
- [ ] [cozystack/talm](https://github.com/cozystack/talm) - follow-up:
- [ ] [cozystack/cozyhr](https://github.com/cozystack/cozyhr) -
follow-up:
- [ ] [cozystack/cozy-proxy](https://github.com/cozystack/cozy-proxy) -
follow-up:
- [ ]
[cozystack/cozystack-telemetry-server](https://github.com/cozystack/cozystack-telemetry-server)
- follow-up:
- [ ]
[cozystack/external-apps-example](https://github.com/cozystack/external-apps-example)
- follow-up:
- [ ] [cozystack/examples](https://github.com/cozystack/examples) -
follow-up:
- [ ] [cozystack/community](https://github.com/cozystack/community) -
follow-up:
### Release note
```release-note
NONE
```
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Documentation**
* Clarified how resource settings work across several app READMEs: any
unset resource field now inherits its value from the preset, rather than
requiring the entire resource block to be empty.
* Updated legacy preset name guidance to explain that deprecated flat
names keep their original sizes, including `nano`–`small` matching `t1`
sizes and `medium` matching `c1.small`.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
users[].password is gone from the chart, its schema and the API type.
Every password, root included, is generated into <release>-credentials
and kept across reconciles by lookup, and a password left in values is
ignored. An upgrade that finds no credentials Secret fails instead of
minting new passwords, because mariadb-operator applies root only at
datadir bootstrap and would advertise a root it never set. The Secret
carries k8s.mariadb.com/watch so the operator applies a changed password
without waiting for its requeue interval.
A username or database name becomes a Secret key and a resource name, so
render-time guards reject a name outside the DNS-1123 rule or past its
limit: 80 for a username, as the User CRD allows, and 64 for a database,
as the server allows. Names that differ only in "_" and "-" collide on
one resource; that is rejected on install only, since an existing
release already applied the overwrite. A user in both admin and readonly
of a database keeps a single ALL grant under the unchanged Grant name,
because renaming a Grant makes the operator revoke the live privilege. A
role member past 128 characters, the server's account-name limit, and a
database name of 65-80 characters, which the Database CRD accepts but
the server does not, are rejected on install and on upgrade only when
their Grant or Database does not exist yet, so a release that already
applied one keeps upgrading. User CR names and keys are quoted so a
username that reads as a YAML scalar stays a string.
Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io>
Two sentences of the boilerplate shared by the app READMEs were wrong.
"When left empty, the preset is applied" described an all-or-nothing
rule, but cozy-lib.resources.defaultingSanitize merges per key: every
resource that resources leaves unset comes from the preset. And the
legacy flat names were called aliases of their "1:1 instance-type
equivalents", which reads as the c1 series; nano through small match t1,
and medium matches c1.small rather than c1.medium, the trap
docs/operations/resource-presets.md already warns about.
Signed-off-by: Yan Bondarenko <202671653+yankawai@users.noreply.github.com>
With watch granted, kubectl delete waits for the claims to be gone, and
its default for that wait is a week. A claim held by a pod that will not
stop, or a stuck detach, would hold the post-delete hook until
helm-controller's 300s uninstall budget ran out and leave the
HelmRelease stuck uninstalling.
The PVC deletes in the clickhouse, harbor, mariadb and qdrant hooks now
wait 120s at most and report the claims still terminating by name, and
each Job carries activeDeadlineSeconds 270 with a 10s termination grace
period, the numbers packages/apps/tenant/templates/cleanup-job.yaml
documents against that budget, so a kubectl that never returns cannot
hold the hook either.
The mariadb Role no longer grants watch on the named Secrets: they carry
no finalizer, so the delete never reaches the watch, and a resourceNames
rule does not authorize a collection watch anyway.
Signed-off-by: Yan Bondarenko <202671653+yankawai@users.noreply.github.com>
Assisted-by: LLM
kubectl delete waits for the object to disappear unless told otherwise,
and that wait is a watch. The post-delete hook Roles of harbor,
clickhouse, mariadb and qdrant granted get, list and delete only, so
every uninstall logged a forbidden watch, the wait was skipped and the
hook reported success before the PVCs were actually gone.
The rules now carry watch for every resource the hooks delete, including
the named Secrets the mariadb hook removes.
Signed-off-by: Yan Bondarenko <202671653+yankawai@users.noreply.github.com>
Both cleanup suites asserted the delete as
"(?s)kubectl delete secret -n \S+.*<name>". Under (?s) the dot matches a
newline, so the gap runs past the end of the command: any earlier
"kubectl delete secret" satisfies the opening and the names may then sit
on any later command in the script. The pattern never established that
they are arguments of the delete at all.
Moving the two cert-manager Secrets off the delete onto a "kubectl get",
leaving the password delete above them untouched, keeps both suites green
while the CA private key and the server private key outlive the release
in a namespace the tenant shares with its other applications — the one
outcome this hook exists to prevent. The comments beside the assertions
already claimed the verb was pinned, so a reader trusting them had no
reason to re-check; they stand unchanged because the patterns now do what
they say.
Pin the whole invocation with its argument list instead, spelling out the
shell's line continuations rather than stepping over them. Whitespace and
backslashes are the only separators the pattern admits, and no command
can be written in those, so a match cannot leave the command it began in.
That mutation now reddens both suites, as does dropping one name from the
list, as does swapping the verb for a read.
Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
The clause claimed the ApplicationDefinition names neither Secret. It
names this one: "mariadb-<name>.ca-tls" sits in its secrets.exclude list,
and the bats guard pins it there. What is true is narrower — neither is
named as the source the anchor is published from — so say that and say
where the name does appear, or the sentence invites a reader to conclude
the ApplicationDefinition has no reference to the Secret at all.
Rewrap the SAN-list paragraph's one 124-column line back into the block it
sits in, which is otherwise at 78.
Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
The issuer resolver maps anything that is not exactly "cert-manager" to
operator issuance, so a typo fails open: the instance keeps the operator's
CA and nothing at render time reports that the value was not understood.
The enum is the only thing that refuses it, and one kubebuilder marker
generates that enum into both the chart's values.schema.json and the
ResourceDefinition's copy, so a single lost marker opens both guards at
once.
The suite already pins the rejection for the sibling field on this object
and left this one, the direction that fails quietly, uncovered. Removing
the enum from the schema fails this case and no other.
Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
Two claims the chart makes about itself stopped being true when the anchor
moved to a projection.
certmanager.yaml said the ApplicationDefinition names the operator's
key-free "<release>-ca-bundle" as the publication source. It does not: the
TenantProjection this chart renders names it, and the ApplicationDefinition
carries no name for it at all — it selects the published anchor by label.
The ApplicationDefinition's own include comment then listed the two
cert-manager Secrets among those the lineage webhook resolves to this
instance. The webhook resolves an object through ownerReferences, or
failing that the Flux helm label, and returns nothing when it has neither.
A cert-manager Secret has neither while enableCertificateOwnerRef stays
false, which is the upstream default this platform does not override, and
is the same fact the uninstall hook relies on when it deletes those Secrets
itself. What does resolve is the operator's own "-ca", "-server-cert",
"-client-cert" and "-ca-bundle". The two names stay in exclude, because one
setting flip is all it takes to make the sentence true.
Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
The chart asks cert-manager for two Secrets and names them after the
release: "<release>-ca-tls" for the CA and "<release>-tls" for the leaf.
The release prefix is "mariadb-", so an application named foo produces
mariadb-foo-ca-tls, and an application named foo-ca produces
mariadb-foo-ca-tls as well. One release's CA private key and another
release's server private key claim the same object. Two sibling
applications in one tenant namespace are enough to hit it: whichever
cert-manager writes last owns the Secret, and each instance then serves
or trusts material issued for the other.
The suffix set is what makes it ambiguous. It holds both "-tls" and
"-ca-tls", and one is a tail of the other, so a hyphen leaves nothing to
say where the release name ends. A dot does: an application name is
validated as a DNS-1035 label and the release prefix as ^[a-z0-9-]*$, so
neither can contain one, and "<release>.ca-tls" and "<release>.tls" split
uniquely. Secret names are DNS-1123 subdomains, which admit the dot.
Only the two suffixes this chart chooses move. The Certificate and Issuer
object names keep the hyphen, because their suffixes are not a pair where
one is a tail of the other, and the operator-managed
"<release>-ca-bundle" that the trust-anchor projection reads is not this
chart's to rename.
Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
The case titled "renders regardless of tls.issuer" set issuer: operator,
which is the chart default, so both sides of its claim were the same
side. Hiding the sentinel behind the cert-manager gate — the one edit
the title rules out — left it green.
Being ungated is the projection's entire contract, so each state is now
its own case: the default, operator, cert-manager, and an explicit null,
which the issuer helper treats as unset rather than as a spelling of the
default.
Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
The notContains element omitted optional: true, and contains compares
each list element whole rather than as a subset, so the element it
described equalled nothing the template can render. Mounting the server
key Secret as the backup CA volume — the exact substitution the
assertion names — left it green, and only the neighbouring positive
caught the mutation.
The comment two cases below already described this trap as handled,
which is how it survived being reintroduced.
Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
Both suites matched only the Secret name list in the hook's script, so
replacing kubectl delete with kubectl get left all 106 cases green while
the CA private key and the server private key survived the release. The
verb is the claim these tests exist to make; the names alone are just
text that happens to appear in a shell script.
Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
The migration procedure was headed "the order that avoids downtime" and
closed by claiming step 3 is the only step that can refuse a connection.
Step 1 restarts the instance: under cert-manager the CR gains
serverCertSecretRef and serverCASecretRef, so the name of the Secret
projected into the pods changes, and a pod-template change rolls the
StatefulSet. The chart supports single-replica instances, and for those
a rolling restart is plain downtime.
The document already knew this in the other direction — the going-back
section warns that deleting the Secret before the operator has reissued
and rolled the StatefulSet leaves the next pod unable to start, and
prints the rollout-status command — so the two halves contradicted each
other.
Both claims are now scoped to what they are true of: the order still
matters, because it keeps enforcement behind the client migration, and
step 3 remains the only step that refuses a client by policy rather than
by restarting the server under it.
Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
The rule sold itself as least privilege while granting -ca-tls and -tls
under every tls.issuer, including operator, where neither Secret is ever
rendered. The comment gave no reason for that, which reads as an
oversight in a rule whose whole point is scope.
Unconditional is what the template's own logic supports, so the reason
is now written rather than the grant narrowed. The delete above is
unconditional too and leans on --ignore-not-found: a release issued by
cert-manager and later switched to tls.issuer: operator still has both
Secrets on the cluster, and uninstall renders the Role from the values
current at that moment. Gating the names on the issuer would drop the
grant for exactly that release, failing the delete on RBAC and leaving
the CA and server private keys in a namespace the tenant shares with its
other applications.
Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
The comment sent the reader to certmanager_test.yaml, which this chart
does not have. Its cert-manager coverage — the rendering of the CA and
leaf Certificates under each tls.issuer value — lives in tls_test.yaml.
Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
The publication guards asserted notExists on the labels
internal.cozystack.io/publish-ca-cert and its -release variant. Neither
name exists anywhere in the tree. The chart renders only
k8s.mariadb.com/watch into secretTemplate.labels, so a notExists on a
path no template can produce holds under every value, and the two cases
titled for a CA publication source could not fail for what they named.
The labels that decide tenant visibility are tenant-ca, which the
ApplicationDefinition's secrets.include selects on, and tenantresource,
which tenantsecrets serves on. Both are now asserted absent on each
key-bearing Certificate. Exclude-by-name in the ApplicationDefinition
stays the backstop behind them, not a substitute.
The documents are addressed by the Secret each Certificate writes plus
an explicit kind rather than by documentIndex, because an index follows
the slot: reordering the template would slide a labelled key-bearing
Certificate out from under the assertion and pass green. metadata.name
cannot serve, as the CA Certificate and the CA Issuer share the name
<release>-ca.
The operator-issuer case promised a label check its body never made; it
asserts only that the template renders nothing. Under that issuer no
Certificate exists to label, so zero documents is the whole statement
available, and the title now says that instead.
Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
The dashboard Role and the ApplicationDefinition granted the operator's
key-free mariadb-<name>-ca-bundle Secret directly by name. Every other
converged engine (mongodb, postgres, nats, qdrant) instead renders a
TenantProjection that lifts ca.crt into the canonical <release>.tenant-ca
object, reached through core.cozystack.io/tenantsecrets rather than a
per-Secret grant.
Add templates/tenant-projection.yaml sourcing from the operator's
ca-bundle, drop the name grant from the dashboard Role and from the
ApplicationDefinition's secrets.include (the existing tenant-ca
matchLabels selector now has something to match), and remove the
ApplicationDefinition's caCert field, which named a field the
ApplicationDefinition CRD does not define and would have rejected the
whole object under server-side apply.
Update the README and the pinned RBAC tests to the new tenant-ca name.
Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
The backup CA case is called "checks the CA file exists and names it" but
only guarded the first half. Deleting the Secret name from the error left
the suite green, so the reason MYSQL_CA_SECRET is passed to the CronJob at
all — telling the operator which Secret to go look at, since the client
reports a missing CA without naming a file or its source — was unpinned.
The cozyrds suite header also counted its own coverage wrong. It claimed
two live tests and three placeholders; there are seven and four. The four
exclude guards are live and went unmentioned, and the case reading the
source key is inert like its neighbours but carried no placeholder marker.
That header is the file's honest-coverage statement, so an understated
ledger is the one error it cannot afford.
Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
Three assertions matched text that survived the mutation they exist to
catch.
The backup CA guard was pinned by three separate substrings: the two test
expressions and the message. Flipping its exit status to 0, or short
circuiting the condition with `false &&`, leaves all three intact and the
suite green — while the backup runs on with --ssl-ca pointing at a file
that is missing or empty, and in the exit-0 case reports success having
dumped nothing. Match the whole construct through its exit instead.
The exclude entries were checked by name without checking they still sit
under resourceNames. A nil resourceNames matches every name, so dropping
that key turns the backstop into a match-everything selector while each
name is still present in the block. Assert the key.
The leaf certificate pinned renewBefore but not duration. cert-manager
rejects a duration that does not exceed renewBefore, so pinning one of
the pair lets the other drift into a certificate that renders but cannot
be applied.
Each is verified by the mutation it was blind to: exit 1 to exit 0, a
short-circuited condition, a renamed resourceNames key, and an 8760h
duration shrunk to 1h all now fail the suite.
Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
The backstop guards grepped the whole file for each name. Both lists sit
at the same indentation, so an entry in `include` satisfied a guard that
exists to prove the name is in `exclude` — and moving a name between them
is the single most dangerous edit this file allows, since exclude is what
keeps a Secret away from the tenant.
Moving `-ca`, the operator's CA private key, from exclude to include left
all ten guards green. So did moving `-root`. Extract the exclude block and
match inside it; both mutations now fail on the name that moved, and the
suite is unchanged otherwise.
Also correct two descriptions the TLS work outdated. The cleanup hook's
Role comment still said the rule covered two operator-generated Secrets;
it now covers four, and two of them are issued by cert-manager, which the
block above already explains. The runtime message called them all
operator-generated for the same reason.
Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
The guard asserting that the trust anchor is surfaced to the tenant
grepped the whole file. The bundle is also named in a comment and in the
caCert declaration, so either of those could satisfy it while the
secrets.include entry it exists to protect was gone. Scope it to the
include block, the way the sibling key-bearing-Secret guard already does.
Verified by deleting the include entry with a matching string left
elsewhere in the file: the guard now fails, where before it passed.
The suite header described a comment as stating that spec.tls.issuer is
true. There is no such field on the MariaDB CR — issuer is a chart value,
and what the chart renders is spec.tls.enabled, which is what the rest of
that sentence already describes. Name the field the assertions actually
check.
Also drop the claim that an 11.4 client verifies by default. The default
that changed in 11.4 is the --ssl-verify-server-cert flag, not whether
verification happens: without --ssl-ca that client has no trust anchor,
and falls back to an anti-tampering check derived from the password hash
which establishes neither the chain nor the hostname, and which cannot be
derived at all for a passwordless user. Passing both flags is what gives
chain and hostname verification, on either client version. The documented
command was already correct; the sentence around it invited dropping the
flag that carries it.
Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
Both comments justify a security decision, and both overstated it.
The exclude list described `-ca`, `-server-cert` and `-client-cert` as
what the operator creates "when it issues its own" certificates. Only
`-server-cert` is conditional. The chart never sets the client refs, so
at the pinned 25.10.2 `WithCA`/`WithCert` gate on those refs being nil
and the operator issues the client leg — and `-ca`, which carries the CA
private key — under both issuers. The list was already right; the
comment invited a future reader to prune two live private-key names as
inapplicable under cert-manager.
The watch label was described as the difference between picking up a
cert-manager renewal and waiting for the next full resync. The operator
requeues every five minutes whenever TLS is on, so the label buys
promptness, not correctness. Say that, and note the operator sets the
same label on Certificates it builds itself, which is why the chart
mirrors it here.
Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
The exclude backstop enumerated the internal credential Secrets but
omitted `-metrics-config`. The operator writes it for every instance —
`MetricsConfigSecretKeyRef` at the pinned 25.10.2 fixes the name as
`<name>-metrics-config` — and its `exporter.cnf` carries
[client]
user=...
password=...
in plaintext. The exporter user is granted SELECT, PROCESS, REPLICATION
CLIENT, REPLICA MONITOR and SLAVE MONITOR on `*.*`, so that password
reads every table in every database.
It is not a hypothetical Secret: the chart sets `metrics.enabled: true`
unconditionally, so it exists on every ready instance. The include side
selects by label with no name constraint, and a nil `resourceNames`
matches everything, so the exclude list is what keeps it away from the
tenant. Exclude beats include, so naming it there is sufficient.
This is inside the enumerable part of the gap, not the part the comment
already disclaims: that carve-out covers Secrets a future operator adds
or creates mid-rotation, and this one exists today under a stable name.
Also complete a sentence in the suite that lost the words naming which
issuer it describes.
Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
The eight cases covering the backup client's TLS flags read as coverage
of a live path. They are not: that CronJob cannot start, because it reads
the root password from a Secret name and key the chart does not render,
and the mismatch predates this branch.
Keep the cases — the flag defect was real, and they are what will stop
--ssl-mode returning whenever the job is repaired or dropped — but say in
the header what they actually pin, so the suite does not quietly claim a
path it never exercises.
Signed-off-by: Aleksei Sviridkin <f@lex.la>
The awk that was supposed to read secrets.include reset on any two-space
key and then re-entered on the next four-space include:, so it swept
services.include as well. It passes today only because no Service happens
to end in -tls — the exact case the comment promised it handled would
have misfired on a Service name. The exclude reader had the same shape.
Gate both on the secrets: section header instead of on indentation alone.
Verified in both directions: a Service named -tls no longer trips the
guard, and a Secret named -tls under secrets.include still does.
Also correct which CA the backup client verifies against: the bundle
carries the chart's CA too under the cert-manager issuer, which is what
makes the unconditional --ssl-ca right in both configurations.
Signed-off-by: Aleksei Sviridkin <f@lex.la>
Renaming the field left the suite describing the design it replaced:
titles about keeping TLS off, comments about a tri-state falling through
to external inheritance, one case named for a boolean value the enum no
longer has. The suite is where the contract is read, so it was still
teaching the old one.
The migration note also claimed the backup client's new verification is a
live change to running jobs. It is not: that CronJob reads the root
password from a Secret name the chart does not render, so it cannot start
in the first place. Say that, and point at the supported backup flow
instead of implying the deprecated one works.
Signed-off-by: Aleksei Sviridkin <f@lex.la>
The note explaining why this chart spells the field `tls.issuer` called
the other charts' switch `tls.issuer` as well, which inverted it: it read
as though those charts use this same key to mean on/off. They spell it
`tls.enabled`.
Restore that name and hedge the claim to "some other charts". The key is
not uniformly a switch elsewhere either — one chart uses it to select
whether a hostname is added to a certificate its engine serves regardless
— so an unqualified "other charts" overstates how settled the meaning is.
Link the epic tracking the convergence of the TLS surface, so the
divergence the note describes points somewhere instead of only being
asserted.
Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
tls.enabled read as a switch and was not one — TLS is served under every
value, and what the field actually chose was which authority issues the
server certificate. The same key means on/off in other charts here, so a
tenant carrying that habit across would have read this exactly backwards.
Replace it with tls.issuer: operator | cert-manager, defaulting to
operator. The value now states the behaviour instead of needing prose to
undo the name: operator is what runs today, so the fact that nothing
changes on upgrade is visible in the default rather than argued in a
comment. Being an enum, a typo is rejected by the schema, which a bool
could not do.
The explanation the old name required is gone with it — the helper
docblock and the CR comment lose the paragraphs that existed only to say
this was not a switch, and the README states the split in a table.
Not marked breaking: the field is introduced by this series and does not
exist on the target branch, so there is no released spelling to migrate
from. Breaking is measured against what is merged, not against the
intermediate history of the branch.
Signed-off-by: Aleksei Sviridkin <f@lex.la>
Four claims of mine were broader than the thing they described.
The bats header said it pins the invariants deciding whether a private
key can reach a tenant. Three of its tests touch the declaration that the
API does not accept yet, so they pin an intended spelling and nothing
more; if the field lands under another name they stay green while the
feature does nothing. Say which tests are live and which are placeholders.
The certificate comment said the operator skips reconciliation entirely.
It skips issuance, which is why SANs go unvalidated, but it still reads
the Secret for the pod annotation hash and status.
The README mapped the client's verification default onto the version
enum, which selects the server image. The default belongs to the client
library, so an 11.4 client verifies against a 10.6 server.
The backup guard is described as catching a missing or unusable bundle.
On a fresh managed-TLS install the bundle can be present and non-empty
while holding only the operator's client CA, and the failure lands at
verification instead. Note the window, and note in the README that a new
instance stays down until cert-manager issues.
Signed-off-by: Aleksei Sviridkin <f@lex.la>
These strings flow into the ApplicationDefinition schema and become the
help text beside the fields in the console. They had grown into
paragraphs of rationale — 704 and 613 characters against 48 for the
neighbouring external — which is the wrong length for a form label and
duplicated what the README already explains at the right length.
Say what the field does and that it is opt-in; the reasoning stays in the
README, which is where a reader goes for it.
Signed-off-by: Aleksei Sviridkin <f@lex.la>
Two claims of mine were wrong about mechanism.
The empty-selector warning said such a selector would project every Secret
in the namespace. The lineage webhook computes those labels only for
objects whose ownership resolves to the application, so the reach is the
instance's own Secrets. Still the thing to prevent — that set contains
-ca-tls and -tls — but the stated reason should match the code, since it
is what a reader checks the guard against.
The teardown step told the user to delete both Secrets with no ordering.
The server keypair stays mounted in the running pods until the operator
reissues from its own CA and rolls the StatefulSet, so following that
literally leaves the next pod unable to start. Wait for the rollout
first.
Signed-off-by: Aleksei Sviridkin <f@lex.la>
The note said the hostname check is off on 10.11 and on across 11.x. The
default actually changed in 11.4. Measured all four versions this chart
offers: 10.6 and 10.11 leave it off, 11.4 and 11.8 enable it. Name the
versions rather than the series, since the reader is choosing between
exactly those.
Scope the key-bearing-Secret guard to the secrets block as well. It
scanned the whole file, so a Service whose name ends in -tls would have
tripped it while a Secret entry with a trailing comment slipped past —
the wrong answer in both directions for the check that decides whether a
private key can reach a tenant.
Signed-off-by: Aleksei Sviridkin <f@lex.la>
The comment said the operator offers no way to extend its SAN list, as a
standing fact. It is only true of the version pinned here: upstream has
since added serverCertAdditionalNames, which its SAN builder appends. Left
as an absolute, the next operator bump would inherit the workaround
without anyone reconsidering it.
Say which version the limitation belongs to and what to check at the next
bump, since that is the point where handing the leaf back to the operator
becomes possible and most of this template can go.
Signed-off-by: Aleksei Sviridkin <f@lex.la>
The kindIs "invalid" guard on required had no coverage, and writing one
showed why: the schema types the field as a boolean and rejects null
before the template runs, so the guard is defensive rather than a live
path. Assert the rejection instead of inventing a rendering that cannot
happen, which also catches the schema being relaxed later.
Signed-off-by: Aleksei Sviridkin <f@lex.la>
The text said --ssl-ca alone leaves the hostname unchecked, without
saying for which client. Measured both: the 10.11 client the backup image
ships defaults --ssl-verify-server-cert to off, the 11.x client defaults
it on. The sentence was therefore right for one and wrong for the other,
in the paragraph a reader uses to decide whether their connection is
verified.
Also record why the tenant reaches the anchor through a Role here rather
than through the shared trust-anchor helper: that helper renders the
Secret from a CA supplied as a template value, and this CA only exists at
runtime, so the chart has no PEM to give it.
Signed-off-by: Aleksei Sviridkin <f@lex.la>
The comments described the CA-extraction controller in the present tense,
as something that copies the certificate today. It is not in this repo:
the controller, the spec.caCert field it reads, and the tenant-ca label
all arrive with a separate change, and against the current API the block
is pruned on apply. A reader would have gone looking for a controller
that is not there.
State that it is inert until that lands, why it is declared now anyway,
and that the tenant reaches the anchor meanwhile through the plain name
grant beside it, which needs nothing new.
Signed-off-by: Aleksei Sviridkin <f@lex.la>
The guard tested only readability, so a present-but-empty ca.crt passed
it and the run continued into exactly the unnamed client error the guard
was added to replace. Empty is reachable rather than theoretical: the
operator omits expired certificates when it assembles the bundle, so a CA
set that has fully expired leaves the file in place with nothing in it.
Check size as well, and say "missing or empty" so the message matches
both cases. Verified by running the rendered script against an absent and
an empty file.
Signed-off-by: Aleksei Sviridkin <f@lex.la>
Uninstall removes the cert-manager Secrets now, but turning managed TLS
off while the instance keeps running does not: the post-delete hook does
not run on an upgrade, and cert-manager does not own what it issued. The
note said the Secrets stay behind without saying what to do about it.
Not automating this on upgrade is deliberate. A hook that deletes Secrets
on every reconcile, including for instances that never had TLS, is a
worse thing to get wrong than an inert Secret that no tenant grant
exposes and nothing reads.
Signed-off-by: Aleksei Sviridkin <f@lex.la>
cert-manager is deployed with enableCertificateOwnerRef disabled, so
removing a Certificate leaves the Secret it issued in place. Uninstalling
an instance that used managed TLS therefore left <release>-ca-tls, which
holds the CA signing key, and <release>-tls, which holds the server key,
sitting in a namespace the tenant shares with its other applications, for
as long as the namespace exists.
The chart already had the mechanism: the post-delete hook deletes the
operator-generated password Secrets by name under an RBAC rule scoped to
exactly those names. Add these two to both lists. -ca-bundle stays out —
the operator gives it an ownerRef, so Kubernetes collects it, and naming
it here would widen the grant for nothing.
Signed-off-by: Aleksei Sviridkin <f@lex.la>
The client reports an unreadable CA only as "TLS/SSL error: No such file
or directory", with no path and no filename — verified against the
MariaDB client the backup image ships. Since the bundle is an optional
mount, that message is exactly what an operator sees during the window
before the trust bundle is reconciled, and it says nothing about what to
look at. Check the file first and fail with its path and the Secret it
comes from.
Correct the migration note as well. It said nothing changes on upgrade
until TLS is opted into, which is not true for instances still using the
deprecated backup CronJob: their backup client now verifies the server
where before it did not. It verifies against the operator's own bundle
and the operator's certificate already covers the host the job dials, so
no action is needed — but a behaviour change to a running job should be
stated rather than contradicted.
Signed-off-by: Aleksei Sviridkin <f@lex.la>
The section described one certificate covering the in-cluster names plus
the external hostname, which was true while managed TLS followed
external. It no longer does, so the default for an externally exposed
instance is the operator's certificate — and that one cannot carry the
external hostname, because the operator has no way to learn it.
A reader following the verification instructions on such an instance
would have failed hostname verification with no explanation, having done
everything the page asked. Describe the two issuers separately and say
plainly that verifying an external connection is what tls.enabled: true
is for.
Signed-off-by: Aleksei Sviridkin <f@lex.la>
The migration section only walked the enable direction. Reverting hands
issuance back to the operator, which means clients have to pick up its CA
again, and cert-manager leaves the Secrets it issued behind when the
Certificates go away. Neither is dangerous, but both are surprising to
find out afterwards.
Signed-off-by: Aleksei Sviridkin <f@lex.la>
The example passed the password on the command line, where it lands in
shell history and in process arguments any other user on the host can
read. Prompting costs nothing in an example whose subject is protecting
the connection.
Signed-off-by: Aleksei Sviridkin <f@lex.la>
The bundle volume was a required mount. The operator reconciles it only
after certificates settle, so on first install with managed TLS there is
a window where it does not exist, and a required mount leaves the pod in
ContainerCreating rather than failing. With concurrencyPolicy: Forbid
that one stuck pod blocks every subsequent backup for as long as it
hangs. Marking it optional turns that into a run that fails with a
message naming the missing file, retries, and lets the schedule proceed.
Correct the reason given for enforcement defaulting to false while here.
It said the tenant had nothing to verify the server against, but this
same change grants the tenant read access to the bundle, so the anchor
is reachable. The default is still right — enforcement refuses clients
that have not moved yet, which is a decision to make rather than
something an upgrade does — but that is the reason, and it was stated in
five places, all fed from the values annotations.
Signed-off-by: Aleksei Sviridkin <f@lex.la>
Making managed TLS opt-in left the suite describing the behaviour it
replaced: the header still mapped external=true with tls.enabled unset
to managed, the section comment and several test titles still said TLS
was enabled via external, and every one of those cases only passed
because it now sets tls.enabled explicitly. The suite is where someone
reads the tri-state contract, so it was the one place still teaching the
old one.
The SAN comment also promised more than the test delivers. Pinning the
list catches an accidental edit to the template, but the expected values
are a copy of what the template renders, so an operator-side rename
would leave it green — and the operator skips certificate reconciliation
entirely when both secret refs are supplied, so it does not check
either. Say that the gap is real and that closing it needs a handshake,
rather than implying it is covered.
Signed-off-by: Aleksei Sviridkin <f@lex.la>