mirror of
https://github.com/cozystack/cozystack.git
synced 2026-12-02 21:30:46 +09:00
<!-- Thank you for making a contribution! Here are some tips for you:
- Use Conventional Commits for the PR title: `type(scope): description`
- Types: feat, fix, docs, style, refactor, perf, test, build, ci, chore
- Scopes are not an exhaustive list — pick the most specific scope for
the change and extend the list when a genuinely new area appears.
Examples:
- System components: dashboard, platform, operator, cilium, kube-ovn,
linstor, fluxcd, cluster-api
- Managed apps: postgres, mariadb, redis, kafka, clickhouse,
virtual-machine, kubernetes
- Development and maintenance: api, hack, tests, ci, docs, maintenance
- Breaking changes: append `!` after type/scope (`feat(api)!: ...`) or
add a `BREAKING CHANGE:` footer
- If it's a work in progress, consider creating this PR as a draft.
- Don't hesistate to ask for opinion and review in the community chats,
even if it's still a draft.
- Add the label `backport` if it's a bugfix that needs to be backported
to a previous version.
-->
## What this PR does
On release-1.6, a password changed in `users.<name>.password` of a
MariaDB app is written to the `<release>-credentials` Secret, but
nothing reconciles the `User` when that Secret changes: mariadb-operator
only reconciles on a Secret change when the Secret carries the
`k8s.mariadb.com/watch` label, which the chart does not set, and the
`User` spec does not change (it only references the Secret key). The new
password therefore reaches the server only on the operator's periodic
SQL requeue, 10h plus up to 1h of jitter after the last reconcile. Until
then the previous password stays valid and the new one is refused, also
after a pod restart.
Reproduced on a 1.6 cluster: after changing a user's password in the app
values, the Secret holds the new value, the `User` stays at `generation:
1`, and only the old password authenticates, still six minutes later and
after restarting the pod. With the label, the change is reconciled as
soon as the Secret is updated.
`main` already sets this label since passwords became chart-generated
(9f857f64e), which is a breaking change and cannot be backported. This
PR adds only the label on release-1.6, plus a helm unittest that fails
without it.
The same symptom exists for RabbitMQ users on release-1.6, where the
chart changes only an annotation of the `User`;
messaging-topology-operator 1.14.2 does not watch the imported
credentials Secret. It is fixed on `main` by the 1.20 operator, which
watches labelled import Secrets, and is not addressed here.
### Screenshots
Not a UI change.
### Downstream repositories
The diff adds a label to a rendered Secret and a test file: no values
key, schema, default, package, CRD or `hack/` path changes, so the
trigger map comes out empty.
- [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:
### Release note
```release-note
fix(mariadb): a user password changed in the app values is now applied as soon as the credentials Secret changes; previously it was applied only on the operator's periodic requeue, up to about 11 hours later, and the old password stayed valid until then.
```
Supersedes #5145, moved to a branch of this repository so E2E can run on
release-1.6.
How to test packages local
cd packages/core/installer
make image-cozystack REGISTRY=YOUR_CUSTOM_REGISTRY
make apply
kubectl delete po -l app=source-controller -n cozy-fluxcd