mirror of
https://github.com/cozystack/cozystack.git
synced 2026-12-06 07:03:45 +09:00
0f97ae304a33e7f01653b18ec1498b3174a6a877
8925
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
0f97ae304a |
feat(api): mint engine-issued credentials by waiting for the new grant
The keys of an engine-issued account, one whose template names a BucketAccess, come from a COSI grant the API cannot make, so a mint writes the account Secret without keys and with a request id, waits a bounded time for cozystack-controller to store the keys of a new grant marked with that id, and returns them once together with the access key. A revoke waits the same way for the controller to mark the Secret once the old grant is gone, and returns nothing. A wait that runs out answers a retryable timeout and shows nothing, so the same keys are never disclosed twice. Both operations are refused while a BucketAccess the controller did not create holds the template's name, since the controller could serve neither. The wait is set by --credentials-cosi-wait. Assisted-by: LLM Signed-off-by: Andrei Kvapil <kvapss@gmail.com> |
||
|
|
1c4f433fec |
feat(controller): re-create the BucketAccess of an engine-issued account
The COSI driver issues a Bucket user's keys and never accepts chosen ones, so the password reconciler cannot seed such an account. A separate reconciler creates and owns the BucketAccess a template names, adopts the one the conversion marked so existing keys survive, and copies the keys of the live grant into the account Secret. A mint or a revoke reaches it as a request id on that Secret: a BucketAccess created for an older request is deleted, which makes the sidecar revoke its identity. A mint gets a new BucketAccess; a revoke gets none, so it locks the account out until the next mint. A changed readonly flag or storage pool gives the template another BucketAccess class. The controller records that as a revoke of its own: the account Secret loses its keys and gets a request id and a Revoke entry by the controller, so the revoke path deletes the old grant, creates none, and the next mint is granted under the new class. Re-granting at once would leave keys nobody was shown under a record that says the last mint issued the live ones. A mint the Secret already carries is served under the new class instead. The sidecar has the driver grant an identity before it puts its finalizer on the BucketAccess, so a BucketAccess is deleted only once it carries that finalizer, or once the sidecar can no longer grant it, its class or claim gone or the bucket not ready: a delete in between would skip the driver revoke and leave a working identity behind. A finalizer on the template holds a deleted one until then, so a user removed inside the grant window does not orphan its identity at the provider. The template's status mirrors the account Secret while a request is pending, so a request that never completes does not turn every later one into a conflict, and a lost account Secret is rewritten from the live grant instead of rotating keys under its clients. Lost after a revoke, it is written again as revoked from that status, so it does not take the create path and re-grant keys nobody minted. The password reconciler skips templates that name a BucketAccess and is otherwise unchanged. The account Secret names its BucketAccess in an annotation, which is how the controller tells an engine-issued account Secret from the others. Assisted-by: LLM Signed-off-by: Andrei Kvapil <kvapss@gmail.com> |
||
|
|
08cb839283 |
feat(api): describe engine-issued keys on CredentialTemplate
A Bucket user's keys come from the COSI driver, which accepts no caller-chosen secret, so the platform cannot choose them the way it chooses a password. The optional bucketAccess field lets a template name the BucketAccess whose grant issues the keys, which makes the account engine-issued whatever its format. The keys are stored as they are issued, so a CEL rule requires the plaintext format on such a template; a format name of its own would say who issues the secret, which bucketAccess already says, and would stop format meaning only how a password is stored. A mint can return the access key that goes with the secret key through one optional field on CredentialRequestStatus. Assisted-by: LLM Signed-off-by: Andrei Kvapil <kvapss@gmail.com> |
||
|
|
94807d93f3 |
feat(platform): migrate Redis and Valkey passwords to minted credentials
The converted charts stop rendering <release>-auth and point the operator at the account Secret of the default credential. Without a migration that Secret would be seeded with a new random password, and every existing client, and the running servers, would lose the one they have. Migrations 69 (Redis) and 70 (Valkey) seed that Secret from the password in <release>-auth before the charts switch, so the operator finds the same password under the new name; then a finish Job per kind deletes whatever is left of the old Secret. Each Job's ClusterRole, ServiceAccount and binding are named for its migration, so the two conversions in one upgrade share none. Both hold every release of their kind, suspended, until the redis-operator Deployment runs its new revision, and the finish Jobs, which may read Deployments, resume them. The new chart changes the pod template, and the old operator rolls such a change by deleting the master, which failed client writes for up to 78 s per instance on a test cluster before the new operator, which moves the master off first and applies the password without a restart, had started. Assisted-by: LLM Signed-off-by: Andrei Kvapil <kvapss@gmail.com> |
||
|
|
5f9d6b9a87 |
feat(credentials-migrate): convert a kind with fixed accounts
Redis and Valkey have no accounts map: one default user exists while authEnabled is on, and its password sits under the single key password of <release>-auth. The conversion read accounts only from the keys of a values map. --fixed-account names the users such a chart always renders, and --enabled-flag the boolean that switches them off; unset counts as true, the chart default, and a non-boolean leaves the release out rather than guess what the chart renders. The password key comes from the existing --source-key, which already covers a source not keyed by user name, rather than from a flag of its own. Assisted-by: LLM Signed-off-by: Andrei Kvapil <kvapss@gmail.com> |
||
|
|
3c0a113c14 |
feat(valkey)!: issue the password through the credentials API
Valkey runs on the same operator as Redis and had the same chart-made password in a tenant-readable <release>-auth. The chart now renders a CredentialTemplate for the default account while authEnabled is on and points the operator at that account's Secret. As for Redis, the operator keeps replication, the Sentinels and the exporter on its internal account, so a mint reaches only the default user and applies with no restart, and the ResourceDefinition excludes the internal account's Secret. BREAKING CHANGE: <release>-auth is no longer rendered or readable; clients get the password by minting the default credential. Assisted-by: LLM Signed-off-by: Andrei Kvapil <kvapss@gmail.com> |
||
|
|
0999d9cfd2 |
feat(redis)!: issue the password through the credentials API
The chart generated the password of the default user itself, kept it readable by the tenant in <release>-auth, and shared it with replication, the Sentinels, the exporter and backups. It now renders a CredentialTemplate for the default account while authEnabled is on, and points the operator at that account's Secret, which the platform seeds and rewrites on a mint and which the tenant cannot read. The operator keeps replication, the Sentinels, the probes and the exporter on an internal account of its own, so the minted password reaches only the servers' default user and the backup Job, which is why the backup strategy reads the same Secret, and a mint restarts no pod. The ResourceDefinition no longer selects <release>-auth and excludes the internal account's Secret, which carries an ownerReference to the RedisFailover, so the tenant-visible set holds the trust anchor alone. The e2e mint step fails if a mint restarts a pod or moves the master. BREAKING CHANGE: <release>-auth is no longer rendered or readable; clients get the password by minting the default credential. Assisted-by: LLM Signed-off-by: Andrei Kvapil <kvapss@gmail.com> |
||
|
|
8346e98d24 |
feat(redis-operator): apply a minted password without a restart
The operator reads the auth Secret on every reconcile but applies the password only through redis.conf, which a server reads at start, and everything it runs authenticated with that client password. A changed Secret therefore moved the operator, the Sentinels and any restarted pod onto the new password while every running server still required the old one, and rolling the pods to fix that deleted the master: about 30 s of failed writes per mint on Redis and Valkey alike. Platform-minted credentials rewrite that Secret, so a mint has to be cheap. Replication, the Sentinels, the probes and the shutdown hook authenticate as an internal ACL user, rf-internal, and the exporter as a user of its own, rf-exporter, both kept in the operator's own Secret. The auth Secret's password belongs to the default user alone, so a mint applies it on every running server: no restart and no failover. An existing RedisFailover gets both users live on every server and Sentinel before its ConfigMap and pod template switch to them, which rolls its pods once. The client password can read masterauth with CONFIG GET, so rf-internal has two passwords. The pod password, which the probes and the shutdown hook read from their environment at start, is on the servers only as a SHA-256 hash in the ACL, never appears in CONFIG, and stays fixed, since changing it would restart those containers. The link password, which masterauth and the Sentinels' auth-pass carry, is rotated on every change of the client password. The stages keep the old link password valid until no server, replica or Sentinel uses it, and the ConfigMap records the new client password only after that, so a completed revoke leaves the old link password valid nowhere. Each stage reads before it writes and the Secret records progress, so a pass that stops anywhere is finished by the next one. rf-internal may run only what replication, the Sentinels, the probes and the shutdown hook send, on the Sentinels' hello channel alone, and has no CONFIG GET; rf-exporter may run only what redis_exporter sends. CONFIG SET requirepass alone would leave every connection that authenticated with the old password open, and the default user may run CONFIG GET requirepass, so a holder of a leaked password could keep one connection across a mint or revoke and read the new password from it. A client password change is therefore one MULTI/EXEC per server: reset the operator's users, delete any other user, set requirepass, and kill every connection of the default and exporter users. No connection made with the old password, or with a password its holder added to an operator user, sees the new one. Replication and Sentinel links and the liveness probe stay up. A server is changed only while it still takes the old password, so a pass that stops halfway resumes on the servers left. A connection that needs no new password can still outlive a revoke: a replication stream opened as rf-internal with the link password read from masterauth, or a MONITOR, which ACL checks only when it starts. The link rotation therefore ends, before it is recorded as done, by killing every MONITOR and every operator-user connection from an address that is no pod of the RedisFailover and not loopback. For the roll that switches an existing RedisFailover, and any other, the operator moves the master role off a stale master with SENTINEL FAILOVER and relabels the pods before rolling it as a replica, so writes stop only for the failover rather than until the Sentinels notice a deleted master. The roll reports a moved master and the pass ends there, so the next pass starts from the new master instead of pointing the Sentinels back at the old one. When a quorum of Sentinels names one of two masters, the other becomes its replica; with no quorum the operator asks for a manual fix. The tenant's default user can run ACL, CONFIG and, on the unauthenticated Sentinels, SENTINEL SET, so the operator does not trust its own setup to stay. Every pass reads the operator's users with ACL GETUSER and resets one that is missing, disabled, has another password, other rules or an extra selector, checks masteruser/masterauth with CONFIG GET, and re-sends a Sentinel's auth-user/auth-pass when CLIENT LIST shows it connected as another user, since SENTINEL SET cannot be read back. Between passes a guard checks the internal user on every server every 2 s from what the last pass left in memory, with no API call, and resets it and every Sentinel's auth where it differs, well before a tenant's ACL DELUSER rf-internal on the master would make the Sentinels fail it over, about 9 s later. Every rotation and every guard run also deletes any ACL user but default, rf-internal, rf-exporter and the liveness probe's pinger, which disconnects clients authenticated as them, since such a user would keep a tenant in after a revoke. Nothing a tenant changes outlives a restart, because redis reads redis.conf from the read-only ConfigMap volume and no aclfile is configured. Every mint and revoke disconnects the tenant's clients. The redis-tls e2e reads INFO replication as REDIS_USER, since the redis container's REDIS_PASSWORD is now rf-internal's. Assisted-by: LLM Signed-off-by: Andrei Kvapil <kvapss@gmail.com> |
||
|
|
acb5310526 |
feat(platform): migrate RabbitMQ users to minted credentials
Migration 68 writes the account Secret of every existing RabbitMQ user from the per-user Secret the old chart generated, before the chart switches, so clients keep their passwords through the upgrade and the CredentialTemplate controller adopts the Secrets afterwards. The finish Job strips leftover users.<name>.password values, deletes a per-user Secret Helm did not prune, and labels the operator's -default-user Secret not tenant-visible once the converted definition excludes it, which removing it from the definition alone does not do for a Secret the lineage webhook already stamped. The Job's ServiceAccount, ClusterRole and binding carry the migration number: migration 64 deletes and re-owns a ServiceAccount with a shared name, which would cut off a finish Job of another conversion running in the same upgrade. The role adds list on Secrets for the per-user sources and list on ApplicationDefinitions for the visibility check. Assisted-by: LLM Signed-off-by: Andrei Kvapil <kvapss@gmail.com> |
||
|
|
6b7694a3ef |
feat(credentials-migrate): read per-account sources and hide Secrets
Some charts keep one generated Secret per account, holding username and password, instead of one Secret keyed by username. RabbitMQ does, under names derived with sprig's kebabcase. --source-selector finds those Secrets by label and by the Helm release that rendered them, so the CLI does not re-implement the chart's name mapping, and retires them once the chart has switched. It is the second way to locate the per-account sources --source-per-account finds by name, so it shares --source-key for the password key and the same retire path, and the two are mutually exclusive. A platform account can also live in a Secret no chart renders, such as the -default-user Secret the RabbitMQ cluster operator creates. The lineage webhook stamped its visibility at admission, so dropping it from the ApplicationDefinition does not hide it. --hide-secret-suffix labels it not tenant-visible in finish, but only once the definition in the API excludes it, and waits for that within the Job's timeout. An operator's rewrite replaces the Secret's labels, and the webhook then stamps it from the definition it sees; the cluster operator's first pass after an upgrade rewrites it before rabbitmq-rd upgrades, so a label written earlier would be undone and the administrator's Secret readable again. Assisted-by: LLM Signed-off-by: Andrei Kvapil <kvapss@gmail.com> |
||
|
|
b9652c4faa |
feat(lineage-webhook): tell whether a definition shows a Secret
The webhook decides a Secret's tenant visibility from the owning ApplicationDefinition on every write that drops the lineage labels, as an operator's rewrite does. A conversion that hides an operator Secret has to know whether the definition in the API already excludes it, because a label it writes earlier is undone by the next rewrite. SecretTenantVisible evaluates a definition exactly as the webhook does. The tests also load the converted RabbitMQ, MongoDB, MariaDB and ClickHouse definitions and pin that each one hides the platform Secrets its conversion keeps, as an operator rewrite would present them. Assisted-by: LLM Signed-off-by: Andrei Kvapil <kvapss@gmail.com> |
||
|
|
a4397fda90 |
feat(rabbitmq)!: render a CredentialTemplate per user
RabbitMQ passwords were generated at render time, kept with lookup and stored in a per-user Secret that every tenant tier could read, next to the operator's administrator in -default-user. The chart now renders a CredentialTemplate per user and points each User's importCredentialsSecret at the account Secret the credentials API mints into. messaging-topology-operator 1.20.2 watches that Secret and puts the password to the broker again on every change, so a mint applies without a Helm run. The operator hashes the password itself, so the account Secret holds the plaintext, as the design's wave 2 does; no tenant role reads it. The User objects keep their names, since a rename would make the operator delete and recreate the broker user. -default-user is a platform account: the ApplicationDefinition stops selecting it and excludes it instead. Tenants lose the administrator login and the per-user Secrets; users.<name>.password is no longer read, and a value left there draws an admission warning that points at a mint on the user's Credential. A user whose account name is longer than 63 characters, does not start and end with a letter or a digit, or is shared with another user is refused at render. Assisted-by: LLM Signed-off-by: Andrei Kvapil <kvapss@gmail.com> |
||
|
|
1791336e04 |
feat(mongodb)!: mint tenant passwords through the credentials API (#5380)
## What this PR does MongoDB passwords are no longer readable from the per-user `<release>-user-<name>` Secrets, and tenants lose the `databaseAdmin` login from `<release>-credentials`. Every tenant tier can read both today. An administrator mints a password on the user's `Credential` and sees it once, the operator applies it live, and the next mint or a revoke kills it. MongoDB computes SCRAM itself, so the account Secret keeps the plaintext, readable only by the platform. A user removed from `users` is now also dropped from the database. This is the MongoDB part of the user secrets API design (cozystack/community#137). Stacked on #5379. Review only the top three commits: - `credentials-migrate` gets `--source-key` and `--source-per-account`, to read one source Secret per user. - The chart renders a `plaintext` CredentialTemplate per user, points `passwordSecretRef` at its account Secret and hides `<release>-credentials` from tenants. Every declared user holds an empty marker role, and a post-upgrade hook drops users that hold it but are no longer declared, since the Percona operator never drops a user removed from `spec.users`. - Migration 67 seeds the account Secrets from the per-user Secrets before the chart switches. Its finish Job deletes the per-user Secrets Helm left behind. Tested on a three-node cluster, fresh install: a minted password logs in after 3 s, the old one fails 3 s after the next mint, revoke works, no pod restarts. That run showed a removed user staying in the database, which the last commit fixes. Full upgrade from 1.7.1 on the same cluster, all engines at once with a client loop each: migrations 64-71 ran in order and every account was adopted with its old password. The MongoDB loop had one server-selection timeout during the platform roll and no authentication error. After the upgrade, a removed user is gone from `admin.system.users`. Breaking for users: tenants lose `databaseAdmin`, their only admin login today. Passwords can't be read any more. A user name that collides with a system user, maps to an invalid account name (such as `_backup`), is longer than 63 characters, or maps to the same account as another name (`a.b` and `a-b`) now fails the render. A user removed from `users` is dropped on the next upgrade. Open questions: 1. Should the conversion rotate `databaseAdmin`? Tenants could read it. 2. Without `databaseAdmin`, no tenant user can manage users or the cluster. Add a per-database admin role, or leave it like that? 3. The drop hook fails the upgrade if there's no writable primary within 5 minutes, on purpose. Is that the right trade? ### Screenshots No UI change. ### Downstream repositories - [ ] No downstream repository is affected by this change - [ ] [cozystack/website](https://github.com/cozystack/website) - follow-up: needed, a MongoDB note for the credentials API docs (cozystack/website#753) and an upgrade note that tenants lose `databaseAdmin` - [ ] [cozystack/terraform-provider-cozystack](https://github.com/cozystack/terraform-provider-cozystack) - follow-up: needed, `cozystack_mongodb` still sends `users.<name>.password` - [ ] [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: needed, the MongoDB row in the design, and the `databaseAdmin` row once question 1 is decided ### Release note ```release-note feat(mongodb)!: MongoDB passwords are issued through the credentials API. The per-user `<release>-user-<name>` Secrets are removed, `users.<name>.password` is ignored, and tenants can no longer read `databaseAdmin`. An administrator mints a password on the user's Credential; it is shown once and applies within seconds without a restart. A user removed from `users` is now dropped from MongoDB. Existing passwords keep working through the upgrade. Clients that log in as `databaseAdmin` must move to a declared user, and user names that collide with a system user must be renamed before upgrading. ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **New Features** * MongoDB user passwords are now managed through platform account credentials, with one-time issuance and revocation. Password values in app configuration are ignored, and reserved MongoDB system-user names are rejected. * Obsolete chart-managed MongoDB users are removed during upgrades. * Migration support transfers existing MongoDB passwords to platform-managed account credentials. * **Bug Fixes** * MongoDB credential Secrets are excluded from tenant access and enumeration. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
06c2be9745 |
fix(platform): stop handing tenants a root S3 the root tenant does not run (#5097)
## What this PR does `cozystack-basics` writes `seaweedfs: tenant-root` into the `cozystack-values` Secret of the root tenant unconditionally, so every tenant without its own SeaweedFS inherits `tenant-root` as its S3, even when `Tenant/root` has `spec.seaweedfs: false`. On a v1.6.5 cluster whose root tenant runs no SeaweedFS, a tenant created a Bucket, its BucketClaim asked for bucket class `tenant-root`, and the objectstorage controller logged `bucketclasses.objectstorage.k8s.io "tenant-root" not found` 8796 times over three days while the app stayed Ready. #5096 makes that state visible in WorkloadsReady, this PR removes its cause. The new platform value `seaweedfs.rootEnabled` reaches cozystack-basics as `_cluster.seaweedfs-enabled`, the same way `monitoring.rootEnabled` reaches it as `_cluster.monitoring-enabled` for #3181, and `_namespace.seaweedfs: tenant-root` is written only when it is true. The default `true` keeps today's behaviour. The slim variants, which do not install SeaweedFS for the root tenant, set it to `false` next to `monitoring.rootEnabled`. Without S3 up the tenant chain the bucket and harbor charts now fail to render with a message that names the problem, instead of creating a claim for a class that never appears. A lookup of the live Tenant is not used, for the reason `monitoring-external-services.yaml` gives for the monitoring gate. An existing Bucket or Harbor in a tenant without S3 up its chain fails its next upgrade with that message once the flag is false. Its BucketClaim was never provisioned, so nothing that worked stops working. The platform tests cover propagation of seaweedfs.rootEnabled. Rendering the root Secret with a missing flag keeps S3 enabled for older installations. For a present key, only true or the string "true" enables it. The bucket and harbor tests also cover the error when the tenant has no S3. All 546 Helm tests across the four charts passed locally. ### Screenshots Not a UI change. ### Downstream repositories `packages/core/platform/values.yaml` gains `seaweedfs.rootEnabled`, which the trigger map routes to `platform-package.md` on the website. The variants page lists what the slim variants need for SeaweedFS, so it gets the same note as monitoring. No app schema, values default or other contract changes. - [ ] No downstream repository is affected by this change - [x] [cozystack/website](https://github.com/cozystack/website) - follow-up: https://github.com/cozystack/website/pull/774 - [ ] [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 fix(platform): new platform value seaweedfs.rootEnabled. Set it to false when the root tenant runs no SeaweedFS, so tenants stop inheriting tenant-root as their S3 and a Bucket or Harbor without S3 up its tenant chain fails to render with a clear message instead of waiting on a bucket class that does not exist. The slim variants set it to false, so a slim cluster that runs SeaweedFS on Tenant/root must set seaweedfs.rootEnabled: true before the upgrade, or its Buckets and Harbors stop rendering. ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **New Features** * Added a setting to control whether the root tenant provides SeaweedFS for S3. It is enabled by default and disabled in slim ISP configurations. * Tenant configuration now includes SeaweedFS when root provision is enabled or the setting is unspecified, and omits it when disabled. * **Bug Fixes** * Bucket and Harbor deployments now report a clear error when neither the tenant nor an ancestor provides SeaweedFS, rather than rendering an unusable S3 bucket claim. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
69f5d07c1d |
feat(mariadb)!: mint tenant passwords through the credentials API (#5379)
## What this PR does MariaDB passwords are no longer readable from `<release>-credentials`, which every `use` member and every parent tenant can read today. An administrator mints a password on the user's `Credential` and sees it once. The database stores only its `mysql_native_password` hash, and the next mint or a revoke kills it within seconds. `root` stays the platform's account and is hidden from tenants. This is the MariaDB part of the user secrets API design (cozystack/community#137). Stacked on #5378. Review only the top three commits: - `credentials-migrate` gets `--skip-account`, so no account is written for `users.root`, which the chart always ignored. - The chart renders a `mysql-native` CredentialTemplate per user and points each `User` at its account Secret through `passwordHashSecretKeyRef`. - Migration 66 writes the hashed account Secrets before the chart switches. Its finish Job removes the tenant keys from `<release>-credentials` and keeps `root`. Tested on a three-node cluster, fresh install: a minted password logs in after 3 s, the old one gets `Access denied` 3 s after the next mint, revoke works, and removing a user drops the `mysql.user` row too. Full upgrade from 1.7.1 on the same cluster, all engines at once with a client loop each: migrations 64-71 ran in order and every account was adopted with its old password. The MariaDB client loop had no failures. Breaking for users: passwords can't be read any more. A user name longer than 63 characters, one that starts or ends with a character other than a letter or digit (such as `_backup`), or two names that map to one account (`a.b` and `a-b`), now fail the render; such a release is not converted. A password changed inside MariaDB is reverted by the operator. Open questions: 1. `root` is not rotated, although the design says it should be. The operator reads it on every reconcile and the pods take it as `MARIADB_ROOT_PASSWORD` for their probes, so changing it needs a coordinated restart. So the `root` password tenants could read stays valid. Accept that and fix the design, or rotate it before merge? 2. Not from this diff: the backup CronJob reads `root-password` from a Secret `<release>` that doesn't exist. It needs a separate fix. ### Screenshots No UI change. ### Downstream repositories - [ ] No downstream repository is affected by this change - [ ] [cozystack/website](https://github.com/cozystack/website) - follow-up: needed, a MariaDB note for the credentials API docs (cozystack/website#753), an upgrade note, and `backup-classes.md` still points at credentials in `<release>-credentials` - [ ] [cozystack/terraform-provider-cozystack](https://github.com/cozystack/terraform-provider-cozystack) - follow-up: needed, `mariadb_schema.go` tells users the password is in `mariadb-<name>-credentials` - [ ] [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: needed only if `root` stays unrotated, to fix the design ### Release note ```release-note feat(mariadb)!: MariaDB passwords are issued through the credentials API and are no longer readable from `<release>-credentials`. An administrator mints a password on the user's Credential; it is shown once and applies within seconds. `root` is no longer visible to tenants. Existing passwords keep working through the upgrade. A user name longer than 63 characters, one that starts or ends with a character other than a letter or digit (such as `_backup`), or two names that map to one account name (such as `a.b` and `a-b`), now fail the render and keep the release unconverted until renamed. Switch clients to minted passwords after the upgrade. ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **New Features** * MariaDB tenant accounts now use individually issued credentials. Passwords are returned when minted, while only password hashes are stored; credentials can be rotated or revoked through the credentials API. * Existing MariaDB accounts are migrated to the new credential system. The platform-managed `root` account remains separate from tenant accounts. * **Bug Fixes** * Tenant-supplied `password` values and `root` entries are ignored, with admission warnings for supplied passwords. Password changes made directly in MariaDB are reverted during reconciliation. * Tenant access to MariaDB credentials Secrets is restricted. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
236d039ae3 |
docs(agents): require an upstream reference for downstream patches (#5437)
<!-- 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, security (a fix that comes through a security advisory), 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. - Fixes merged to `main` reach the release lines the backport batch runs for automatically, so do not open backport PRs by hand: https://github.com/cozystack/cozystack/blob/main/docs/release/backports.md --> ## What this PR does A patch this repository carries on top of someone else's code (an image source patch, a vendored chart patch, a fork pin, a carried backport) is meant to live only until the same change lands upstream. Nothing written down asks for that link today, so whether a patch was ever offered upstream, and when it can be dropped, depends on whoever wrote it. Existing patch headers provide examples of upstream references and drop conditions. The rule is written once, in a new "Patches to other projects' code" section of `CONTRIBUTING.md`: a PR that adds or changes a downstream patch links the upstream pull request or submission, or at least the issue or thread where it was raised; the patch header carries the link next to its drop condition; a patch with no upstream counterpart says why in the PR. The other places point to it rather than restating it: - `AGENTS.md` gets a working principle that links the section and adds what only agents need: an agent prepares the upstream change and its text but does not open a pull request, issue or thread in another project without explicit approval for that submission. - The PR checklist in `docs/agents/contributing.md` gets one line linking the section. - The PR template gets a commented-out `Upstream:` field under "What this PR does", with a one-line note to uncomment it when the PR touches a downstream patch. I checked what reads the PR body or the template: `pr-labeler.yaml` reads only the title and a `BREAKING CHANGE:` footer, and `hack/downstream-trigger-map.bats` reads only the `- [ ] [cozystack/...]` checklist lines. A commented field reaches neither. `hack/downstream-trigger-map.bats`, `hack/md-no-hardwrap.bats` and `hack/label-workflows-contract.bats` pass. ### Screenshots <!-- REQUIRED for UI changes: attach screenshots or screen recordings demonstrating the visual impact of your changes. PRs with UI changes without screenshots will not be merged. --> Not a UI change. ### Downstream repositories <!-- Cozystack is upstream for repositories that are NOT kept in sync with it automatically, and nothing in CI compares the two sides, so a change here can break them silently. Which change forces what, and which file to touch, is the trigger map in docs/agents/contributing.md under "Downstream Repositories". Walk it before you tick anything. IF YOU ARE AN AI AGENT OR AN LLM, THIS IS PART OF THE TASK, NOT A FORM TO FILL IN: 1. Walk the trigger map against the actual diff of this PR, file by file. Do not decide from the PR title or from your memory of what you changed. 2. For every repository you tick, open the follow-up PR there and link it on the same line. A ticked box with no link claims work that does not exist, which is worse than an empty box. Search that repository for an open PR or issue covering it first, and link that instead of filing a duplicate. 3. When the follow-up is out of scope, or needs a decision that is not yours to make, open an issue in that repository instead, link that, and say so in the PR body. Do not push a speculative PR into another repository just to fill a line here. 4. Do not tick "No downstream repository is affected" to make the checklist go away. If you are unsure, leave every box empty and say so in the PR body, so a human decides. --> I left every box empty for a maintainer to decide. The trigger map lists a PR template change under `cozystack/community`: its `contributors/README.md` "Open the pull request" section restates the required parts of the template. The new field is commented out and optional, so that section stays correct, but the onboarding guide may also want the new rule itself. - [ ] 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 <!-- Write a release note: - Explain what has changed internally and for users. - Start with the same `type(scope):` prefix as in the PR title - Follow the guidelines at https://github.com/kubernetes/community/blob/master/contributors/guide/release-notes.md. --> ```release-note docs(agents): a pull request that adds or changes a downstream patch now links the same change offered upstream, or says why there is none. ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Documentation** * Added guidance requiring downstream patches to link to the related upstream submission or discussion, or explain why no counterpart exists. * Clarified that upstream submissions require explicit user approval; without approval, prepare the change and submission text and ask first. * Updated the pull request template and checklist to prompt for upstream links or an explanation when none exists. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
137b68f07a |
test(hack): skip request-timeout calls that name a kubeconfig or context (#5406)
## What this PR does `hack/check-hook-request-timeout.bats` exempts a file only when it names `KUBECONFIG`. A hook script under `files/` that gets `KUBECONFIG` from its template's env has no reason to name it, so a call that goes through that kubeconfig with `--context` is flagged as an in-cluster call. That is what turned `capi-providers-core/files/upgrade-providers.sh` red on main; #5398 fixed that script by naming `KUBECONFIG`, and this keeps the next script written the same way from hitting it again. The check now skips a line that passes a non-empty `--context` or `--kubeconfig`. client-go serves such a call from the loaded kubeconfig, and without one `--context` fails with "context was not found" instead of falling back to localhost:8080. An empty value (`--context ""`, `--context=`, `--kubeconfig=`) does fall back, so it is still reported, and so is a bare call in the same file. The header notes the limits: a variable that is empty at runtime is not visible to the check, and the match is per line. Tested with `bats hack/check-hook-request-timeout.bats`: 11 of 11 pass, the new cases fail without the change, and each part of the filter is pinned by a mutation. The empty-value fallback was reproduced with kubectl v1.37.2. ### Screenshots <!-- REQUIRED for UI changes: attach screenshots or screen recordings demonstrating the visual impact of your changes. PRs with UI changes without screenshots will not be merged. --> ### Downstream repositories <!-- Cozystack is upstream for repositories that are NOT kept in sync with it automatically, and nothing in CI compares the two sides, so a change here can break them silently. Which change forces what, and which file to touch, is the trigger map in docs/agents/contributing.md under "Downstream Repositories". Walk it before you tick anything. IF YOU ARE AN AI AGENT OR AN LLM, THIS IS PART OF THE TASK, NOT A FORM TO FILL IN: 1. Walk the trigger map against the actual diff of this PR, file by file. Do not decide from the PR title or from your memory of what you changed. 2. For every repository you tick, open the follow-up PR there and link it on the same line. A ticked box with no link claims work that does not exist, which is worse than an empty box. Search that repository for an open PR or issue covering it first, and link that instead of filing a duplicate. 3. When the follow-up is out of scope, or needs a decision that is not yours to make, open an issue in that repository instead, link that, and say so in the PR body. Do not push a speculative PR into another repository just to fill a line here. 4. Do not tick "No downstream repository is affected" to make the checklist go away. If you are unsure, leave every box empty and say so in the PR body, so a human decides. --> - [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 <!-- Write a release note: - Explain what has changed internally and for users. - Start with the same `type(scope):` prefix as in the PR title - Follow the guidelines at https://github.com/kubernetes/community/blob/master/contributors/guide/release-notes.md. --> ```release-note NONE ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Bug Fixes** * Timeout checks now exclude matching lines that specify a non-empty context or kubeconfig value. Empty option values and bare calls on separate lines are still reported; files naming `KUBECONFIG` remain excluded. * **Documentation** * Clarified how context and kubeconfig options affect timeout reporting. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
79ed8e1164 |
fix(redis): let the operator delete a disabled Sentinel PDB instead of a per-upgrade hook (#5429)
## What this PR does When a Redis instance runs a single pod, the chart runs one Sentinel and sets `disablePodDisruptionBudget` on it. The redis-operator stops ensuring the Sentinel PDB once that flag is set, but never deletes the PDB it created earlier, and the PDB's owner reference only removes it together with the RedisFailover. An instance scaled down from three pods therefore keeps a `minAvailable: 1` PDB on its only Sentinel, and every node drain blocks on it. The chart worked around this with a post-upgrade Helm hook: a ServiceAccount, a Role, a RoleBinding and a kubectl Job, rendered on every upgrade of every single-replica instance, to delete a PDB the operator should have removed itself. The operator image is already built in this repository with carried patches, so I fixed it there instead. - `redis-operator`: a new source patch makes the operator look the Sentinel or Redis PDB up on reconcile while its `disablePodDisruptionBudget` is set, and delete it only when the RedisFailover is its controller. A PDB without that owner is left alone, no delete is sent when there is no PDB, and one that disappears between the lookup and the delete counts as done. It has a unit test next to the operator's own `EnsureSentinelDeployment` tests, which the image build runs for every package a patch touches. The patch header says it is carried until an upstream release includes the change. - `redis`: the hook, its RBAC, its chart tests and the `redis.sentinelReplicas` helper extracted for it are removed. The single-Sentinel change and its tests stay as they were. - e2e: the base Redis case now scales its instance from two replicas to one and asserts that `rfs-<name>` existed before and is gone after, and that the data pods' PDB stays. Upgrade: an instance that still has the stale PDB loses it on the first reconcile by the updated operator, which resyncs every RedisFailover every 30 seconds. Until the operator Deployment rolls, the PDB stays, so drains on such an instance can block for that window. Hook objects from earlier upgrades are not release resources, so Helm does not touch them; the successful runs already deleted theirs through `hook-succeeded`. A run that failed leaves its ServiceAccount, Role and RoleBinding named `<release>-sentinel-pdb` behind (its Job goes after an hour through `ttlSecondsAfterFinished`). They grant only get and delete on one PDB and can be removed by hand. Cost: while a PDB is disabled, every reconcile (on each RedisFailover change and on the 30-second resync) reads it once from the API server; a delete is sent only when an owned PDB is still there. I have not run the image build or the e2e suite. The patch series applies on the v3.3.5 tarball, alone and together with the operator patch of the open draft #5382, and every package it touches passes `go test` and `go vet -tags integration`. `helm unittest packages/apps/redis` passes. Upstream v3.3.5 is the latest release and its master still has the same code, so there is no version to bump to; a version of the patch rebased onto upstream master, without the `tlsHash` parameter the carried TLS patch adds, is open as freshworks-oss/redis-operator#93, and the patch header links to it. ### Screenshots Not a UI change. ### 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: No values key, schema, README or version enum changes; the diff touches an image patch, chart templates and tests, and the Redis e2e suite only. ### Release note ```release-note fix(redis): the redis-operator now deletes the Sentinel or Redis PodDisruptionBudget it created once that budget is disabled, so a Redis scaled down to one replica no longer keeps the Sentinel PDB that blocks node drains, and the chart no longer runs a cleanup Job with its own RBAC on every upgrade of a single-replica instance. ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Bug Fixes** * Redis and Sentinel PodDisruptionBudgets are removed when their respective settings disable management, provided they are owned by the RedisFailover. Missing or unrelated budgets are left unchanged. * Sentinel replica counts remain at one when Redis is configured with one replica, and three otherwise. * When switching to one Sentinel replica with PDB management disabled, the Sentinel budget is removed while the data-pod budget remains. The Helm release is then verified as ready. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
17eb78d952 |
docs(agents): require accepted designs before merging implementations (#5465)
<!-- Thank you for making a contribution! Here are some tips for you: - Use Conventional Commits for the PR title: `type(scope): description` --> ## What this PR does The contributing guide sends architectural changes to a design proposal in cozystack/community, but it never said when the code implementing one may merge. A clean implementation could land while its proposal was still under review, and the design then had to follow the code that shipped first. `CONTRIBUTING.md` now says that such a pull request stays in draft until the proposal is merged into community, that opening it early as a proof of concept is welcome, and that it closes if the proposal is closed without being accepted. The `triage/needs-proposal` line in `AGENTS.md` and the pull request checklist in `docs/agents/contributing.md` point to that paragraph, so the rule lives in one place. ### Screenshots Not a UI change. ### Downstream repositories - [ ] 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: None of the code repositories is reached. I left the community box open on purpose: its `design-proposals/README.md` could state the same rule from the proposal side, and whether to add it is a maintainers' call, so I have not opened anything there. ### Release note ```release-note docs(contributing): a pull request that implements a design proposal stays in draft until the proposal is accepted in cozystack/community. ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Documentation** * Clarified that implementation pull requests for design proposals may be opened early as drafts for proof-of-concept work, but can merge only after the proposal is accepted. * Added guidance to link early proof-of-concept work from the proposal and to close the implementation if the proposal is not accepted. * Clarified that accepted proposals require a separate implementation issue, which may be an existing issue that references the proposal. * Updated the contributor checklist to reference the draft pull request guidance. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
19ab55c030 |
fix(platform): stop handing tenants a root S3 the root tenant does not run
cozystack-basics wrote seaweedfs: tenant-root into the root values unconditionally, so every tenant without its own SeaweedFS inherited tenant-root as its S3 even when Tenant/root runs none. A Bucket there got a BucketClaim for a bucket class that never appears, and Harbor got its registry bucket the same way. seaweedfs.rootEnabled records that choice the way monitoring.rootEnabled does for monitoring, and the bucket and harbor charts refuse to render without S3 up the tenant chain rather than wait on a class that does not exist. Older configurations have no SeaweedFS flag. Keep their root S3 enabled. For an explicit value only true or the string "true" enables it. Assisted-by: LLM Signed-off-by: Yan Bondarenko <202671653+yankawai@users.noreply.github.com> |
||
|
|
7bf48125ca |
fix(cluster-api): pin the ConfigMap version in every provider selector (#5400)
## What this PR does Closes #5394. capi-operator v0.30 lists every ConfigMap a provider's `fetchConfig.selector` matches and returns an error when more than one comes back, before it reads `spec.version` (`processProviderConfigMaps`). Five of the six provider packages here selected their bundle on a provider-kind label alone, so a version bump — which renames the ConfigMap — left the old and the new ConfigMap matching for the length of the Helm upgrade and failed that reconcile. Helm deletes the old one in the same upgrade, so the next reconcile succeeds: an error window rather than data loss, but one that hits every upgrade of those providers. `capi-providers-core` and the kubeadm half of `capi-providers-bootstrap` already put `provider.cluster.x-k8s.io/version` on the ConfigMap and in the selector. This does the same for the remaining five pairs: | package | provider | version pinned | |---|---|---| | `capi-providers-bootstrap` | talos | `v0.6.13-bootstrap-talos` | | `capi-providers-infraprovider` | kubevirt | `v0.1.10-infraprovider` | | `capi-providers-infraprovider-proxmox` | proxmox | `v0.7.7-infraprovider-proxmox` | | `capi-providers-cpprovider` | kamaji | `v0.19.0-cozystack.0` | | `capi-providers-ipam-in-cluster` | in-cluster | `v1.0.3-ipam-in-cluster` | The kind label each package already had (`infraprovider-provider`, `cp-components`, `ipamprovider-provider`, `bootstrap-provider`) stays: it is what keeps one provider's bundle out of another's selector, and it is unrelated to the version match. The comment in the Proxmox ConfigMap said the operator would still install the right one because it keys every matched ConfigMap by name. That is not what v0.30 does any more — it rejects the multiple match outright — so the comment is replaced with what the operator does now, and the reason the version label is there. ## Verification New asserts in `hack/capi-provider-components_test.bats`, run with bats 1.14.0 and helm 3.19.0: - `every provider selector pins the ConfigMap version` — for each of the five packages plus core: exactly one provider object and one compressed bundle render, the bundle's `provider.cluster.x-k8s.io/version` label is non-empty, and both the selector and `spec.version` carry that same value. - `an upgrade with the previous ConfigMap present still matches one bundle` — synthesises the upgrade window by adding the previous release's bundle beside the rendered one; the selector has to keep matching exactly one object. - `the double-match fixture fails when the version label is removed` — the negative control: with the version label dropped from both the selector and the ConfigMap copy, that same fixture has to match two, so the assertion above is known to be able to fail. - `both bootstrap providers pin their own ConfigMap version` — the Talos pair, which the single-provider helper cannot cover. ``` $ bats hack/capi-provider-components_test.bats ok 25 every provider selector pins the ConfigMap version ok 26 an upgrade with the previous ConfigMap present still matches one bundle ok 27 the double-match fixture fails when the version label is removed ok 28 both bootstrap providers pin their own ConfigMap version ``` A/B: with the template changes stashed and the tests kept, all four new asserts fail (`selector does not pin the ConfigMap version`, `an upgrade matches more than one ConfigMap`, `talos does not select exactly one bundle`); restored, they pass. Also run, unchanged by this PR: - `bats hack/capi-upgrade-chart_test.bats` — 16/16 - `bats hack/capi-upgrade_test.bats` — 44/44 - `bats hack/capk-provider_test.bats` — 4/4 - `bats hack/bats-no-negated-assert.bats`, `bats-strict-setup.bats`, `bats-no-exit-trap.bats` — 10/10, 19/19, 22/22 - `make -C packages/system/capi-providers-bootstrap test` (helm-unittest 1.1.2) — 9/9 - `bash hack/check-commit-trailers.sh origin/main..HEAD` — OK - `python3 hack/check-helm-document-indices.py main` — clean - `git diff --check` — clean Not covered locally: 8 asserts in `hack/capi-provider-components_test.bats` fail on this machine both before and after this change, all with `sed: illegal option -- -` — `check_sums` / `check_patched_sums` use GNU `sed --quiet`, which is not POSIX and not present in macOS's BSD sed. They are unrelated to this diff and pass in CI on Linux. No full ctest/Go build was needed: the change is Helm templates and bats only. ## Downstream repositories No downstream repository is affected. This changes the labels and selectors inside five `packages/system/` charts; nothing in `cozystack/website`, `terraform-provider-cozystack`, `ansible-cozystack`, `ccp`, `talm`, `cozyhr`, `cozy-proxy`, `cozystack-telemetry-server`, `external-apps-example`, `examples` or `community` reads those label keys or restates these templates. `packages/system/` is not imported into the website's managed-apps reference, and no values key, schema, or release-notes convention changes. ```release-note fix(cluster-api): pin the ConfigMap version in every provider selector Bumping the Talos bootstrap, KubeVirt, Kamaji, Proxmox or in-cluster IPAM provider left its old and new components ConfigMap both matching the provider's selector for the length of the Helm upgrade, which capi-operator v0.30 rejects with "multiple ConfigMaps match selector". Each selector now carries `provider.cluster.x-k8s.io/version`, as the core and kubeadm providers already did, so an upgrade matches exactly one bundle. ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Bug Fixes** * Provider configurations now select the components bundle matching their version, avoiding ambiguous matches when older and newer bundles coexist during upgrades. * Bootstrap providers now select their own version-specific bundle, so each provider uses the correct components configuration. * Provider and bundle versions remain aligned across supported infrastructure, IPAM, control-plane, and bootstrap providers. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
1b5a5e5cf5 |
test(redis): assert a scaled-down instance loses its Sentinel PDB
Every Redis e2e case runs two replicas, so the single-Sentinel path, where the chart disables the Sentinel PDB and the operator has to delete the one it created for three Sentinels, was covered only by the operator's unit test. Scale the base instance from two replicas to one and assert that the PDB existed before, is gone after, and that the data pods' PDB stays. Assisted-by: LLM Signed-off-by: Aleksei Sviridkin <f@lex.la> |
||
|
|
aeb9bf6fbf |
fix(redis): drop the post-upgrade hook that deleted the Sentinel PDB
The hook ran a ServiceAccount, Role, RoleBinding and a kubectl Job on every upgrade of every single-replica instance, to delete the Sentinel PDB the operator left behind once disablePodDisruptionBudget was set. The operator now deletes a disabled PDB itself on reconcile, so the hook, its RBAC and the helper extracted for it have no work left. An instance that still carries the stale PDB loses it on the first reconcile by the updated operator. Assisted-by: LLM Signed-off-by: Aleksei Sviridkin <f@lex.la> |
||
|
|
56648783b3 |
fix(redis-operator): delete a PDB once it is disabled
The operator ensures the Sentinel and Redis PDBs only while disablePodDisruptionBudget is unset. Setting it later stops the updates but never deletes the PDB already created, and its owner reference removes it only with the RedisFailover. A Redis instance scaled down to one pod thus keeps a minAvailable 1 PDB on its single Sentinel, which refuses every eviction and blocks node drains. While the PDB is disabled, look it up on reconcile and delete it only when this RedisFailover controls it: a PDB created by someone else under the same name is not the operator's to remove. No delete is sent when there is no PDB, and one that disappears between the lookup and the delete counts as done. The delete carries the UID and resourceVersion it checked, so a PDB replaced or re-owned between the lookup and the delete is left for the next reconcile to judge. Assisted-by: LLM Signed-off-by: Aleksei Sviridkin <f@lex.la> |
||
|
|
40a3b0ba2c |
fix(clickhouse, opensearch): reap finished cleanup Jobs (#5543)
## What this PR does Every deleted ClickHouse or OpenSearch leaves a Completed `<release>-cleanup` Job and its pod in the tenant namespace for good, because the post-delete hooks keep only `before-hook-creation` and have no TTL. The commit adds `ttlSecondsAfterFinished: 86400` to both Jobs, the same value `pre-delete-unpin` in kubernetes-nodes uses, so a succeeded run is reaped and a failed one still keeps its logs for a day. The cleanup tests of both charts gain a case for the TTL; it fails on main and passes here, and the 46 ClickHouse and 153 OpenSearch tests pass. Closes #5542 ### Screenshots Not a UI change. ### 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 fix(clickhouse, opensearch): the post-delete cleanup Job of a deleted ClickHouse or OpenSearch is removed a day after it finishes instead of staying in the tenant namespace for good. ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Improvements** * Completed PVC cleanup jobs and their pods are now eligible for automatic removal after one day in ClickHouse and OpenSearch, helping prevent finished cleanup resources from lingering. * Failed cleanup jobs remain available for troubleshooting during that retention period. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
279efc5a82 |
fix(harbor): keep the trivy volume class of the live StatefulSet (#5541)
## What this PR does
A Harbor with trivy enabled and no `storageClass` cannot be changed
after install: every upgrade of `harbor-<name>-system` is rejected on
the trivy StatefulSet, so the release stays not Ready and no later chart
change reaches it. The chart read the class for the trivy
`volumeClaimTemplate` from the PVC, which the default-StorageClass
admission stamps, instead of from the StatefulSet template, which it
never touches. The commit reads the class from the live StatefulSet
template.
The failure was reproduced on a cluster running v1.7.3 by patching a
Harbor created with `spec: {}`. The new helm-unittest suite mocks the
live StatefulSet and its defaulted PVC; all three cases fail on main and
pass here, and the 77 tests of the chart pass.
Closes #5540
### Screenshots
Not a UI change.
### 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
fix(harbor): a Harbor with trivy enabled and no storageClass can be changed after install again; the chart keeps the volume class of the live trivy StatefulSet instead of copying the class the PVC got from the default StorageClass.
```
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## Summary by CodeRabbit
* **Bug Fixes**
* Trivy storage-class handling now reflects the storage class configured
on its StatefulSet volume template. Existing fallback behavior is
unchanged.
* **Tests**
* Added coverage for Trivy storage-class behavior when the StatefulSet
template has no storage class, when a storage class is configured, and
when the chart’s `storageClass` setting is present.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
|
||
|
|
24122ed3ad |
docs(contributing): hold implementations until their design is accepted
The contributing guide sends architectural changes to a design proposal in cozystack/community, but said nothing about when the code that implements one may merge. A clean implementation could land while its proposal was still under review, and the design then had to follow the code that shipped first. State that such a pull request stays in draft until the proposal is merged, and that opening it early as a proof of concept is welcome. Assisted-by: LLM Signed-off-by: Aleksei Sviridkin <f@lex.la> |
||
|
|
ec576c9369 |
docs(agents): require an upstream reference for downstream patches
A patch carried on top of someone else's code is meant to be temporary: it stays only until the same change lands upstream. Without a link to the upstream submission nobody can tell whether that is underway, when the patch can be dropped, or whether it was ever offered at all. The rule is written once, in CONTRIBUTING.md, so that human contributors read it in the file addressed to them. AGENTS.md points to it and adds that an agent prepares the upstream submission but does not publish it in another project without explicit approval. The agent PR checklist and the PR template point to the same section; the template field is commented out so that PRs without a downstream patch are unaffected. Assisted-by: LLM Signed-off-by: Aleksei Sviridkin <f@lex.la> |
||
|
|
0616d251cd |
docs(contributing): define what counts as a breaking change (#5253)
<!-- 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, security (a fix that comes through a security advisory), 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, a `fix` included. What counts as breaking: https://github.com/cozystack/cozystack/blob/main/docs/agents/contributing.md#what-counts-as-breaking - 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. - Fixes merged to `main` reach the release lines the backport batch runs for automatically, so do not open backport PRs by hand: https://github.com/cozystack/cozystack/blob/main/docs/release/backports.md --> ## What this PR does Contributing guide and PR template say how to mark a breaking change, `!` after type/scope or a `BREAKING CHANGE:` footer, but nothing says what makes a change breaking. This PR adds that to `docs/agents/contributing.md`: after the upgrade an existing install, client or consumer is refused, loses something it used, or has to be edited to keep working. The case that showed the gap is [#4973](https://github.com/cozystack/cozystack/pull/4973). It was a `fix` that made a values shape the previous version ran fail at render time. It merged with a release note about it and without `!`, and no written rule decided it either way. The definition follows what maintainers already mark with `!` on merged fixes, it is not a new policy: [#4847](https://github.com/cozystack/cozystack/pull/4847) (runtime refusal), [#4639](https://github.com/cozystack/cozystack/pull/4639) and [#4796](https://github.com/cozystack/cozystack/pull/4796) (refusal only for new or changed objects, existing ones keep working). Not breaking: a change that only accepts more, makes something broken work, refuses only what never worked even if it rendered or deployed, or changes how a working install runs while it keeps working. Refusing what never worked is how [#4973](https://github.com/cozystack/cozystack/pull/4973) treats its own no-sizing pool, and it is why [#4567](https://github.com/cozystack/cozystack/pull/4567) was a plain `fix`. I walked the text against [#4973](https://github.com/cozystack/cozystack/pull/4973) and [#5083](https://github.com/cozystack/cozystack/pull/5083) (breaking, both merged without `!`) and against [#4220](https://github.com/cozystack/cozystack/pull/4220), [#4974](https://github.com/cozystack/cozystack/pull/4974), [#3935](https://github.com/cozystack/cozystack/pull/3935) (not breaking). One place it differs from a marker: [#4569](https://github.com/cozystack/cozystack/pull/4569) has `!`, but its value rendered and KubeVirt never admitted it, so by this text it is not breaking. The text also says the `fix` type does not exempt a change, and an `Action required` line in the release note does not replace the marker. PR template tip line links to the new section (link works after merge, same as the backports one next to it). A default change that degrades a working install without failing it is not covered. If it should be, please say so here. `contributors/README.md` in [cozystack/community](https://github.com/cozystack/community) repeats the marker syntax and has no definition either. No follow-up there yet, so the downstream boxes stay empty. Not in this PR: `labels.yml`, `pr-labeler.yaml`, the release docs, and a check for `Action required` without the marker. ### Screenshots <!-- REQUIRED for UI changes: attach screenshots or screen recordings demonstrating the visual impact of your changes. PRs with UI changes without screenshots will not be merged. --> ### Downstream repositories <!-- Cozystack is upstream for repositories that are NOT kept in sync with it automatically, and nothing in CI compares the two sides, so a change here can break them silently. Which change forces what, and which file to touch, is the trigger map in docs/agents/contributing.md under "Downstream Repositories". Walk it before you tick anything. IF YOU ARE AN AI AGENT OR AN LLM, THIS IS PART OF THE TASK, NOT A FORM TO FILL IN: 1. Walk the trigger map against the actual diff of this PR, file by file. Do not decide from the PR title or from your memory of what you changed. 2. For every repository you tick, open the follow-up PR there and link it on the same line. A ticked box with no link claims work that does not exist, which is worse than an empty box. Search that repository for an open PR or issue covering it first, and link that instead of filing a duplicate. 3. When the follow-up is out of scope, or needs a decision that is not yours to make, open an issue in that repository instead, link that, and say so in the PR body. Do not push a speculative PR into another repository just to fill a line here. 4. Do not tick "No downstream repository is affected" to make the checklist go away. If you are unsure, leave every box empty and say so in the PR body, so a human decides. --> - [ ] 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 <!-- Write a release note: - Explain what has changed internally and for users. - Start with the same `type(scope):` prefix as in the PR title - Follow the guidelines at https://github.com/kubernetes/community/blob/master/contributors/guide/release-notes.md. --> ```release-note docs(contributing): the contributing guide now defines a breaking change (after the upgrade an existing install, client or consumer is refused, loses something it used, or has to be edited to keep working), says the `fix` type does not exempt a change and an `Action required` line in the release note does not replace the `!` marker. The PR template links to it. ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Documentation** * Added clearer guidance on what qualifies as a breaking change, including examples of changes that are not breaking. * Defined breaking changes by whether an upgrade prevents previously working installs, clients, or consumers from working, or removes something they use. * Linked the pull request template’s breaking-change guidance to the contributing documentation. * Clarified that commit markers and release notes are separate requirements, and that commit type or prior buggy behavior does not determine whether a change is breaking. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
7a94e202ca |
fix(cluster-api): pin the ConfigMap version in every provider selector
capi-operator v0.30 refuses a provider whose fetchConfig.selector matches more than one ConfigMap, and it decides that before it reads spec.version (processProviderConfigMaps). Talos bootstrap, KubeVirt, Kamaji, Proxmox and in-cluster IPAM selected their bundle by a provider-kind label alone, so a version bump left the old and the new ConfigMap matching for the length of the Helm upgrade and failed that reconcile. Core and kubeadm already carry provider.cluster.x-k8s.io/version in both the ConfigMap and the selector; this brings the remaining five packages in line. Each package now defines that version once, in templates/_helpers.tpl, and the ConfigMap name, its version label, the selector and spec.version all include it. Hard-coding the value in four places per provider meant a bump could move the ConfigMap name and leave the label behind, and two bumps in flight in the same package (as #5243 does for capmox and in-cluster IPAM) would then disagree with each other. With one definition a bump is one line and the four references cannot drift. The Talos pair uses its own define because it tracks CABPT, while the kubeadm pair keeps the chart appVersion. The comment in the Proxmox ConfigMap claiming the operator would still pick the right one described the v0.30-or-earlier behaviour and is replaced with what the operator does now. Refs: #5394 Assisted-by: LLM Signed-off-by: Goldloli <39011904+Goldloli@users.noreply.github.com> |
||
|
|
d27f8c950f |
fix(tenant): allow etcd and ingress egress to all ancestors at any depth (#5442)
## What this PR does The `<tenant>-egress` CiliumClusterwideNetworkPolicy builds the list of ancestor namespaces for the etcd and ingress rules by walking dash-prefixes of `.Release.Namespace`. A tenant HelmRelease lives in its parent namespace, so for a tenant at depth >= 2 (e.g. `tenant-acme-nonprod`, released into `tenant-acme`) the walk never reaches `tenant-root`. When an intermediate tenant has no etcd of its own, the child inherits etcd from `tenant-root` (`namespace.cozystack.io/etcd: tenant-root`) but is not allowed to reach it. The Kamaji control plane of a tenant Kubernetes cluster in such a tenant times out on `etcd.tenant-root.svc:2379` and never becomes ready. Ingress has the same gap. The chart already fixed this class of bug for namespace labels (`tenant.ancestorTenantLabels`). This PR adds `tenant.ancestorNamespaces`, which derives the chain from the tenant's own namespace (`tenant-root` plus every dash-prefix except the tenant itself), and uses it for the etcd and ingress rules. The set of allowed destinations only grows: every previously reachable ancestor stays reachable. The vminsert/vlinsert rule is left untouched; #5257 fixes it separately. Found while running a second-level tenant (`tenant-root` → `aepdev` → `nonprod`) with a tenant Kubernetes cluster on v1.7.1. ### Screenshots Not a UI change. ### Downstream repositories - [x] No downstream repository is affected by this change ### Release note ```release-note fix(tenant): tenants nested two or more levels deep can now reach etcd and ingress inherited from tenant-root, so tenant Kubernetes clusters in them start correctly. ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Bug Fixes** * Tenant network policies now correctly allow access to required services in ancestor namespaces, including etcd, ingress, and vminsert. * Ancestor access is handled consistently across tenant hierarchy depths, including root tenants and cases where service ownership details are unavailable. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
65db30265e |
docs(contributing): define what counts as a breaking change
The guide says how to mark a breaking change and never says what one is. A fix that made a values shape the previous version rendered fail at render time was merged with no marker, and review asked for a release note instead, because neither this file nor the PR template gives a test to apply. The test is what an install that already runs gets after the upgrade: refused, stripped of something it used, or made to edit its config. The commit type says what a change is for, not what it does to an install that is already running. Assisted-by: LLM Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com> |
||
|
|
8c1e085c92 |
fix(dashboard): keep re-login working across tabs after logout (#5536)
<!-- 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, security (a fix that comes through a security advisory), 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. - Fixes merged to `main` reach the release lines the backport batch runs for automatically, so do not open backport PRs by hand: https://github.com/cozystack/cozystack/blob/main/docs/release/backports.md --> ## What this PR does With OIDC enabled, signing out of the dashboard and signing back in often lands on the oauth2-proxy `403 Forbidden` page right after Keycloak accepts the password, and the gatekeeper logs `Invalid authentication via OAuth2: CSRF token mismatch, potential attack`. The user has to press "Sign in" again to get in. oauth2-proxy keeps a pending login in a single `kc-access_csrf` cookie. After a logout every other open console tab hits a 401 on its next API call or watch reconnect and starts its own sign-in, overwriting that cookie, so the callback of the tab the user is typing into no longer matches. The gatekeeper now runs with `--cookie-csrf-per-request` so each sign-in gets its own CSRF cookie, and `--cookie-csrf-per-request-limit=10` caps how many abandoned flows can accumulate in the request headers. Both flags exist in the pinned oauth2-proxy v7.12.0. Verified on a test cluster: reproduced the 403 on the current release with two tabs, then ran the chart-rendered oauth2-proxy v7.12.0 config against the same live Keycloak with the dashboard host resolved to it. Without the new flags the tab that submits the password gets the 403 and the proxy logs the CSRF mismatch; with them both sign-ins complete and no auth failure is logged. A helm-unittest case pins both flags. Not covered here: a login page left open for longer than the CSRF cookie lifetime (`--cookie-csrf-expire`, 15 minutes by default) still ends on the same 403, because the cookie for that flow has expired; that needs a separate decision on how the logout should land. `linstor-gui` runs its own oauth2-proxy with a shared CSRF cookie as well; I have not reproduced the problem there, so it is left out of this PR. ### Screenshots No visual change: only the gatekeeper's oauth2-proxy flags change. ### Downstream repositories <!-- Cozystack is upstream for repositories that are NOT kept in sync with it automatically, and nothing in CI compares the two sides, so a change here can break them silently. Which change forces what, and which file to touch, is the trigger map in docs/agents/contributing.md under "Downstream Repositories". Walk it before you tick anything. IF YOU ARE AN AI AGENT OR AN LLM, THIS IS PART OF THE TASK, NOT A FORM TO FILL IN: 1. Walk the trigger map against the actual diff of this PR, file by file. Do not decide from the PR title or from your memory of what you changed. 2. For every repository you tick, open the follow-up PR there and link it on the same line. A ticked box with no link claims work that does not exist, which is worse than an empty box. Search that repository for an open PR or issue covering it first, and link that instead of filing a duplicate. 3. When the follow-up is out of scope, or needs a decision that is not yours to make, open an issue in that repository instead, link that, and say so in the PR body. Do not push a speculative PR into another repository just to fill a line here. 4. Do not tick "No downstream repository is affected" to make the checklist go away. If you are unsure, leave every box empty and say so in the PR body, so a human decides. --> - [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 <!-- Write a release note: - Explain what has changed internally and for users. - Start with the same `type(scope):` prefix as in the PR title - Follow the guidelines at https://github.com/kubernetes/community/blob/master/contributors/guide/release-notes.md. --> ```release-note fix(dashboard): signing back in after a logout no longer fails with a 403 "CSRF token mismatch" when several dashboard tabs are open. ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **New Features** * OIDC sign-in now uses separate CSRF cookies for each request, supporting concurrent sign-in flows. The number of these cookies is capped at 10, limiting buildup when sign-in flows are abandoned. Existing cookie settings remain in place. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
15126f27ca |
feat(clickhouse)!: mint tenant passwords through the credentials API (#5378)
## What this PR does ClickHouse passwords are no longer readable from `<release>-credentials` and can't be set through `users.<name>.password`. Today every `use` member reads them there, and a leaked one can't be taken back. Now an administrator mints a password on the user's `Credential`, sees it once, and the next mint or a revoke kills it. This is the ClickHouse part of the user secrets API design (cozystack/community#137). Stacked on #4922. Review only the top four commits: - `credentials-migrate` gets `--reserved-user`, `--values-path` and `--rotate-key`. - `credentials-migrate` can hold a kind's releases until given Deployments run their new images. - The chart renders a `sha256` CredentialTemplate per user and reads the stored hash through `valuesFrom`, since the ClickHouse operator reads no Secrets. `backup`, `default` and `clickhouse_operator` are refused as user names. - Migration 65 seeds the account Secrets from `<release>-credentials` and suspends the ClickHouse releases before the chart switches. Its finish Job, under its own `cozystack-credentials-migration-65` identity, resumes them only after the new cozystack-controller and cozystack-api run, then removes the tenant keys and rotates `backup` once, because tenants could read it. The hold exists because the old controller strips the `valuesFrom` entries the migration adds: without it the new chart rendered no users, and clients were locked out for 10 minutes on the first upgrade run. Tested on a three-node cluster, fresh install: a minted password logs in after about 60 s (the Helm re-render), the old one dies 2 s after the next mint, revoke works, and removing a user removes everything. Mints restart nothing. Full upgrade from 1.7.1 on the same cluster, all engines at once with a client loop each: migrations 64-71 ran in order and every account was adopted with its old password. The ClickHouse releases were held for 19 minutes and the client loop saw no authentication error. Breaking for users: passwords can't be read any more, and each mint costs a Helm upgrade of about a minute. Pods restart once during the conversion for the `backup` rotation. While the hold lasts (19 minutes on the test cluster) the ClickHouse apps can't be changed or deleted. A release with a user named `backup`, `default` or `clickhouse_operator` is not converted and raises `CredentialsMigrationIncomplete`. Open questions: 1. `users.default` is refused, as the design says. Tenants may be using it today, so should it be a mintable account instead? 2. A Helm upgrade already running during the `backup` rotation can write the old value back. Should finish wait for the release to be idle? ### Screenshots No UI change. ### Downstream repositories - [ ] No downstream repository is affected by this change - [ ] [cozystack/website](https://github.com/cozystack/website) - follow-up: needed, a ClickHouse note for the credentials API docs (cozystack/website#753) and an upgrade note that clients must mint - [ ] [cozystack/terraform-provider-cozystack](https://github.com/cozystack/terraform-provider-cozystack) - follow-up: needed, `cozystack_clickhouse` still sends `users.<name>.password` - [ ] [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 feat(clickhouse)!: ClickHouse passwords are issued through the credentials API and are no longer readable from `<release>-credentials`; `users.<name>.password` is ignored. An administrator mints a password on the user's Credential; it is shown once and applies after the next Helm upgrade of the release, about a minute. Existing passwords keep working through the upgrade, and migration 65 rotates the platform `backup` password, which restarts each ClickHouse instance once. A release with a user named `backup`, `default` or `clickhouse_operator`, or with a name that does not map to a valid account name, is not converted until the user is renamed; renaming a ClickHouse user means changing the apps that log in as it. Switch clients to minted passwords after the upgrade. ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **New Features** * ClickHouse account passwords can now be issued and revoked through the credentials API. Newly issued passwords are available once and can be used to log in after the release is upgraded. * Platform-managed accounts are reserved, and account names are validated for conflicts and supported formats. * Platform upgrades now migrate existing ClickHouse credentials and support backup-password rotation. * **Bug Fixes** * Tenant account passwords are no longer stored in the ClickHouse credentials Secret; only the platform backup password remains there. * The credentials Secret is no longer exposed as a tenant resource. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
a1e938767c |
fix(external-dns): stop enabling the service source on tenant instances (#5470)
## What this PR does Every `ExternalDNS` application crash-loops about a minute after it starts and never publishes a record. It always enables the `service` source, which starts a Node informer, but the instance runs namespaced, so its Role has no `nodes` rule and the informer never syncs (`failed to sync *v1.Node: context deadline exceeded`). Closes #4958 The single commit drops `service` from the hardcoded sources, as agreed on the issue, so the default configuration uses only `ingress`. The rendered Gateway API source list is preserved; its separate cluster-wide informer permissions problem remains outside this fix. It also adds a `test` target and a helm-unittest suite to the package that pins the rendered sources in both cases. Both tests fail on current `main`. Nobody loses records: tenants can't annotate the Services the platform renders, so the `service` source published nothing. The kuberture guide already pairs its annotated Services with the cluster-wide `cozystack.external-dns` package, not this application. ### Screenshots N/A, 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 fix(external-dns): ExternalDNS applications no longer crash-loop on "failed to sync *v1.Node". The tenant instance stops enabling the `service` source, which needs cluster-wide read on Nodes that its namespaced Role cannot grant, and publishes records from Ingresses in the default configuration. ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Configuration** * ExternalDNS monitors ingress resources by default. Service resources are no longer included as a discovery source. * When Gateway API support is enabled, ExternalDNS also monitors Gateway API HTTP and TLS routes. * **Tests** * Added checks confirming the default discovery sources and the sources used when Gateway API support is enabled. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
9227c2e211 |
fix(clickhouse, opensearch): reap finished cleanup Jobs
The post-delete PVC cleanup Jobs of ClickHouse and OpenSearch keep only before-hook-creation, so a failed run stays for post-mortem. Helm drops the hook once the release is gone, and nothing else deletes the Job, so every deleted instance leaves a Completed <release>-cleanup Job and its pod in the tenant namespace for good; on the cluster the oldest had sat there for 85 days. Set ttlSecondsAfterFinished to a day, as pre-delete-unpin in kubernetes-nodes does, so a succeeded run is reaped and a failed one still keeps its logs long enough to read. Assisted-by: LLM Signed-off-by: Yan Bondarenko <202671653+yankawai@users.noreply.github.com> |
||
|
|
1ca2a943cf |
fix(harbor): keep the trivy volume class of the live StatefulSet
A Harbor with trivy enabled and no storageClass could not be changed
after install: the next upgrade of the release failed with
StatefulSet.apps "<release>-trivy" is invalid: spec: Forbidden: updates
to statefulset spec for fields other than 'replicas', 'ordinals',
'template', 'updateStrategy', 'revisionHistoryLimit',
'persistentVolumeClaimRetentionPolicy' and 'minReadySeconds' are
forbidden
The chart took the class for the trivy volumeClaimTemplate from the
data-<release>-trivy-0 PVC. The default-StorageClass admission stamps
the class onto that PVC but never onto the StatefulSet, so the render
put a class into a template created without one. Read the class from
the template of the live StatefulSet instead.
Fixes:
|
||
|
|
5a0ee76edf |
fix(external-dns): stop enabling the service source on tenant instances
An ExternalDNS application crash-loops a minute after every start and publishes no records: level=fatal msg="failed to sync *v1.Node: context deadline exceeded with timeout 1m0s" The instance runs external-dns namespaced, so the vendored chart renders a Role and leaves out the nodes rule, because a Role cannot grant a cluster-scoped resource. The service source still starts a Node informer, which never syncs without that grant. Drop service from the hardcoded sources rather than grant nodes through a ClusterRole. The source only publishes Services that carry the external-dns hostname annotation, and tenants cannot annotate the Services the platform renders in their namespace, so it published nothing here. A ClusterRole would be cluster-scoped RBAC created by a tenant application for a source with no use. Tested with a new helm-unittest suite that pins the rendered sources with and without gatewayAPI. Both cases fail while service is listed. Closes: #4958 Assisted-by: LLM Signed-off-by: AuricX <auricx.business@gmail.com> |
||
|
|
79883fed36 |
feat(platform): convert MongoDB users to minted credentials
Migration 67 seeds the account Secret of every user of every MongoDB release before the chart switches, from the per-user Secret the old chart rendered, so clients keep logging in through the upgrade and the controller adopts the Secrets once the templates exist. The finish Job then strips users.*.password from the values and removes any per-user Secret Helm left behind; <release>-credentials holds only the databaseAdmin platform account and is left alone. The Job's ServiceAccount, ClusterRole and binding carry the migration number: one upgrade can run several conversion migrations in a row, and a shared ServiceAccount deleted by a later hook would cut off an earlier finish Job still running as it. Assisted-by: LLM Signed-off-by: Andrei Kvapil <kvapss@gmail.com> |
||
|
|
0eb96ac872 |
feat(mongodb)!: render a CredentialTemplate per user
Tenant passwords move to the Cozystack credentials API: the chart renders one CredentialTemplate per user and each user of the PerconaServerMongoDB reads its password from the account Secret the controller keeps, so a password is shown once, at mint, instead of being generated at render time. MongoDB computes SCRAM from the plaintext, so the account Secret stores the password itself. The operator re-reads that Secret on every reconcile and runs updateUser when its digest changes, so a mint applies without a restart and the Secret needs no label. The per-user Secrets and users.<name>.password are gone; a password left in values is ignored and draws an admission warning that points at a mint on the user's Credential. <release>-credentials keeps the databaseAdmin system user, a platform account: it is rendered not tenant-visible and the ApplicationDefinition excludes it instead of including it. Users named like a system user, or mapping to one account name or to one longer than 63 characters, are refused. The Percona operator creates and updates the users in spec.users but never drops one that leaves it, so a removed user would lose its CredentialTemplate and account Secret yet keep its last password in MongoDB, with no Credential left to revoke it through. Every declared user therefore also holds a marker role that grants nothing, and only the operator grants it. A post-upgrade hook logs in as the userAdmin platform account and drops the users in admin that hold the marker, are no longer declared, and are not system users. A user without the marker, created by hand or before the marker existed, is never touched. The hook is skipped while restoring from a backup. Assisted-by: LLM Signed-off-by: Andrei Kvapil <kvapss@gmail.com> |
||
|
|
e6a7973185 |
feat(credentials-migrate): read passwords from per-account Secrets
Some charts keep each tenant password in a Secret of its own rather than under the user name in <release>-credentials: MongoDB renders <release>-user-<name> with a password key, which the operator reads. The conversion has to seed account Secrets from there, and finish has to remove those Secrets if Helm leaves one behind, while the platform Secret of such a kind stays untouched. Two flags describe the source, so that a kind keyed by something other than the user name can reuse them: --source-key names the key holding the password (the user name when empty), and --source-per-account reads it from <release><source-suffix><user> rather than from the single source Secret. A per-account Secret is never keyed by user name, so the second requires the first. Assisted-by: LLM Signed-off-by: Andrei Kvapil <kvapss@gmail.com> |
||
|
|
d5c6170892 |
feat(platform): migrate MariaDB accounts to minted credentials
Existing MariaDB releases must keep their clients logging in while the chart switches the Users to account Secrets. The pre-upgrade hook writes those Secrets from the passwords in <release>-credentials, hashed, and marks a fully converted release for seeding; the finish Job then removes the tenant keys from that Secret once the converted chart is Ready, keeping root, the platform's own account. The finish Job and its least-privilege identity get names of their own, so this hook cannot delete the ServiceAccount of migration 64's Job while that one still runs. root is not rotated here: the operator, the server pods' environment and their probes all read it, and an ALTER USER without a coordinated restart fails the probes. Assisted-by: LLM Signed-off-by: Andrei Kvapil <kvapss@gmail.com> |
||
|
|
6c047a473d |
feat(mariadb)!: issue user passwords through the credentials API
Tenant passwords lived in <release>-credentials next to root, which every use-tier member and every ancestor tenant could read, and which had no platform path to rotation. The chart now renders a CredentialTemplate per user and points each User at its account Secret through passwordHashSecretKeyRef, so the database stores only the mysql_native_password hash the API writes, and the watch label makes mariadb-operator apply a mint at once. The reference is there from a User's first reconcile, because a User created without one is locked for good; with the Secret missing the operator only reports the User not ready. root stays chart-generated in <release>-credentials, since rootPasswordSecretKeyRef cannot change once set, and that Secret is now platform-only: the definition excludes it and the chart labels it tenantresource=false. Users mapping to one account name are refused on every path. A users.<name>.password left in values draws an admission warning that points at a mint on the user's Credential instead of <release>-credentials. BREAKING CHANGE: tenants can no longer read MariaDB passwords from <release>-credentials; a password is obtained by a mint on the account's Credential and is shown once. Assisted-by: LLM Signed-off-by: Andrei Kvapil <kvapss@gmail.com> |
||
|
|
170a25617c |
feat(credentials-migrate): skip platform keys in the accounts map
MariaDB keeps its root account in <release>-credentials and ignores a users.root entry, so the converted chart renders no CredentialTemplate for it. Without a way to say so, the conversion would write an account Secret holding root's verifier that no template ever adopts. The new repeatable --skip-account flag drops such keys before the name mapping. Assisted-by: LLM Signed-off-by: Andrei Kvapil <kvapss@gmail.com> |
||
|
|
6d72324818 |
feat(platform): migration 65 converts ClickHouse credentials
Existing ClickHouse releases keep working across the chart switch: the hook writes each tenant account's Secret from the password in <release>-credentials and adds the valuesFrom entries the converted chart reads the verifiers from, so its first render already lets every client in. A release with a user under a reserved name is left out and keeps its previous chart. The hook also holds every ClickHouse release, suspended, until both cozystack-controller and cozystack-api run their new revision. Without the hold the converted chart switched while the old controller was still running; it had already rebuilt each release's valuesFrom without the account entries this migration added, so the first render left every tenant user out of the installation and clients were locked out until the new controller put them back, ten minutes later on a test cluster. The old cozystack-api drops the same entries on any tenant write. The finish Job then resumes the releases with the entries put back, strips leftover users.*.password, keeps only the backup password in <release>-credentials and rotates it once, because tenants could read it before. Its ServiceAccount, ClusterRole and binding are named cozystack-credentials-migration-65 like the Job, so an operator finds them next to it and this hook never deletes the identity migration 64's Job may still run as. The role may read Deployments for the hold. Assisted-by: LLM Signed-off-by: Andrei Kvapil <kvapss@gmail.com> |
||
|
|
2f4f82a36c |
feat(clickhouse)!: render a CredentialTemplate per user
Tenant passwords move to platform-minted credentials. The chart no longer generates, looks up or renders any tenant password and ignores users.<name>.password: it renders one CredentialTemplate per user, and cozystack-controller keeps the account Secret holding the SHA-256 of the password the Cozystack API mints. The operator watches no Secrets, and a hash inline in the ClickHouseInstallation is the only path it applies without a restart, so the template asks for a valuesPath: the HelmRelease pulls each stored hash into _accounts.u<digest of the user name>, the chart renders it as password_sha256_hex, and the Flux watch label upgrades the release when a mint changes the Secret. A user with no verifier in the values is left out of the installation, because the operator would give a passwordless user the password "default". backup stays a platform account in <release>-credentials, which now holds only it, is labelled not tenant visible and is no longer selected by the ApplicationDefinition. The names backup, default and clickhouse_operator are refused for tenant users. A rotation of the backup password restarts the pods once, since the backup sidecar reads it from its environment at start. A user whose account name is longer than 63 characters, does not start and end with a letter or a digit, or is shared with another user is refused at render, as credentials-migrate refuses it, so an install and an upgrade accept the same names. A users.<name>.password left in values draws an admission warning that points at a mint on the user's Credential. Existing clients lose readable passwords; an administrator mints a new one. Assisted-by: LLM Signed-off-by: Andrei Kvapil <kvapss@gmail.com> |
||
|
|
85243d43f1 |
feat(credentials-migrate): hold releases until their deps roll out
Every application chart is copied out of the one cozystack-packages source, so all of them switch the moment the platform chart moves it, while cozystack-controller and the operators roll out on their own schedule. A Package dependsOn does not order that: tenant releases carry no dependsOn, and Flux only asks that a dependency be Ready, which it is on its old revision. On a live upgrade the old controller stripped the ClickHouse valuesFrom entries and the old redis-operator rolled the converted Redis pods its own way, locking clients out for minutes. --hold-until-rollout lets the hook record the images a Deployment runs and suspend every release of the kind; the finish Job resumes them, with their valuesFrom re-seeded, once each Deployment runs other images on all of its pods. Neither the old controller nor the old API touches spec.suspend. A hold that times out keeps the releases suspended and reports them left out, since running on the old chart is safer than a converted one the old components act on. Assisted-by: LLM Signed-off-by: Andrei Kvapil <kvapss@gmail.com> |
||
|
|
e1880c5a00 |
feat(credentials-migrate): reserved users, values path and rotation
ClickHouse is the first kind whose operator reads no Secret and which keeps a platform account next to its tenant ones, and three things it needs are not specific to it. A tenant user under a name the converted chart refuses (the platform backup account, the engine's default user) makes the release unresolvable, so it is left out instead of converted in part. The CredentialTemplate controller adds the valuesFrom entries of a valuesPath kind only after the converted chart has rendered its templates, so that first render would carry no stored value and the chart would drop every tenant account from the engine until the next upgrade. The hook now adds the same entries ahead of the switch; the old chart ignores the values they fill. finish rotates the platform passwords tenants could read once, with the release suspended, then forces an upgrade so the chart applies them, and records the rotation on the source Secret so a rerun does not rotate twice. Assisted-by: LLM Signed-off-by: Andrei Kvapil <kvapss@gmail.com> |
||
|
|
4ad4a44014 |
fix(dashboard): keep re-login working across tabs after logout
With OIDC enabled, signing out of the dashboard and signing back in often ends on the oauth2-proxy 403 page even though Keycloak accepted the password. The gatekeeper log shows Invalid authentication via OAuth2: CSRF token mismatch, potential attack oauth2-proxy keeps the state of a pending login in a single kc-access_csrf cookie. After a logout every other open console tab gets a 401 on its next API call or watch reconnect and starts its own sign-in, which overwrites that cookie, so the callback of the tab the user is typing into no longer matches. Giving each flow its own CSRF cookie keeps concurrent sign-ins independent; the limit caps how many abandoned flows can accumulate in the request headers. Tested by running the chart-rendered oauth2-proxy v7.12.0 config against a live Keycloak with two tabs signing in after a logout: without the flags the first tab gets the 403 above, with them both sign-ins complete. Assisted-by: LLM Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io> |
||
|
|
ce04ec3fb8 |
perf(ci): build release lines from their own cache, in parallel (#5484)
## What this PR does Release-line image builds read only main's build cache. After main moved its builder and base images, release-1.7 Dockerfiles stopped matching that cache, and rc Build step went from 19 to 53 minutes on amd64 and from 10 to 46 on arm64 (https://github.com/cozystack/cozystack/actions/runs/43213142925 for v1.7.1-rc.2, https://github.com/cozystack/cozystack/actions/runs/45853634981 for v1.7.2-rc.2). Each line now keeps own cache. `build-release.yaml` writes `buildcache-release-X.Y` on every push to the line, and rc builds import it together with main's `buildcache` through new `CACHE_FROM_TAGS` (defaults to `CACHE_TAG`, so other builds don't change). Lines have no arm64 push build, so arm64 rc build writes `buildcache-arm64-release-X.Y` itself. Image units now build four at a time (`make build-parallel`, `hack/build-units.sh`), most of their time is registry round trips anyway. Every output line carries its unit and is written as it comes. `objectstorage-controller` waits for the rest because it writes seaweedfs `values.yaml`. Local `make build` stays sequential. rc jobs also set `cleanup: false` on buildx, teardown took up to 11 minutes on arm64 (682s in v1.7.2-rc.2). Known limits: two rc tags of the same line building at the same time write the same arm64 cache ref, last one wins and only cache hits suffer. `capi-providers-cpprovider` keeps its own inline cache, as before. This gets real check only after merge: `build-release.yaml` on next push to a line, `tags.yaml` on next rc. Both run from line's own copy, so lines need ports, I'll open them after this one. Tests: bats for the cache macro (lists every import, writes only `CACHE_TAG`, writes nothing without `WRITE_CACHE=1`), for `hack/build-units.sh` against fake make (the `BUILD_JOBS` limit, ordering, failing unit, failing `objectstorage-controller`, failing unit list, output that shows while a unit still builds) and for the workflow settings. I also ran `hack/build-units.sh` over the real units with `make -n`. ### 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 perf(ci): release lines build images from their own build cache, several units at a time, so rc builds no longer rebuild most images from scratch once main's Dockerfiles move on ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Build Improvements** * Release builds now compile eligible components in parallel, while retaining the required order for dependent components. Build parallelism can be configured. * Release-line builds use line-specific caches alongside shared caches. Release-candidate builds reuse available caches, with arm64 builds writing to an architecture-specific cache. Cache-write errors no longer interrupt builds. * **Documentation** * Build guidance now covers parallel build settings, cache behavior, and release build steps. <!-- end of auto-generated comment: release notes by coderabbit.ai -->v1.8.0-rc.1 |