Skip to content

docs(bucket): document Object Lock without a default retention - #821

Draft
mattia-eleuteri wants to merge 1 commit into
cozystack:mainfrom
mattia-eleuteri:docs/bucket-lock-noretention
Draft

mattia-eleuteri wants to merge 1 commit into
cozystack:mainfrom
mattia-eleuteri:docs/bucket-lock-noretention

Conversation

@mattia-eleuteri

Copy link
Copy Markdown

Documents the lockingDefaultRetention field added to the bucket app in cozystack/cozystack#5050: a locked bucket can be provisioned from the new -lock-noretention BucketClass, with Object Lock enabled and no default retention, so the retention is chosen afterwards through the S3 API. The page previously said lock-enabled classes always configure a default COMPLIANCE retention and listed only the -lock suffix.

Only content/en/docs/next/ is changed, since the field ships with the next release. Kept as a draft until the cozystack PR merges.

The Buckets guide described lock-enabled classes as always carrying a
default COMPLIANCE retention and listed only the -lock suffix, while
the bucket app gains lockingDefaultRetention to provision from a
-lock-noretention class instead, so the retention can be chosen
through the S3 API.

Assisted-by: LLM
Signed-off-by: Mattia Eleuteri <mattia@hidora.io>
@netlify

netlify Bot commented Nov 23, 2026

Copy link
Copy Markdown

👷 Deploy request for cozystack pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 09d923c

@coderabbitai

coderabbitai Bot commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Aleksei Sviridkin (lexfrei) added a commit to cozystack/cozystack that referenced this pull request Nov 23, 2026
## What this PR does

A locked bucket can only be provisioned from the `-lock` BucketClass,
whose default retention is COMPLIANCE for 365 days. Backup tools such as
Veeam, restic and Kopia set the retention of each object themselves, and
other users want a shorter default or GOVERNANCE, which a bucket owner
can already set through the S3 API once the bucket exists. Nothing let
them start from a locked bucket without that year-long default, so users
left Object Lock off.

This adds a `-lock-noretention` BucketClass next to every `-lock` class:
in the COSI chart patch, for the Client topology, and for each storage
pool. It enables Object Lock and sets no default rule. The bucket app
gets a `lockingDefaultRetention` flag that selects it together with
`locking`. The flag defaults to `true`, so existing buckets and values
keep `-lock`, and it is read at creation only.

The new class keeps `deletionPolicy: Retain` like `-lock`. The driver
deletes a bucket through the filer without checking retention
([seaweedfs/seaweedfs-cosi-driver#17](seaweedfs/seaweedfs-cosi-driver#17)):
on a lab cluster (SeaweedFS 4.31, driver v0.3.1), a BucketClass with
`objectLockEnabled` and `Delete` removed a bucket holding an object
still under COMPLIANCE retention, which S3 itself had refused to delete.
A pool named `x-lock-noretention` renders the same class name as the
`-lock-noretention` class of a pool `x`. That suffix is not reserved,
since such pools already exist and must keep upgrading; the template
instead checks every BucketClass and BucketAccessClass name the pools
render, across `volume.pools` and every zone's pools, against each other
and against the base classes, and fails only on an actual duplicate. The
same check catches pools named exactly `lock`, `readonly` or
`lock-noretention`.

Tested with helm-unittest in the three charts, each new suite checked to
fail with the template change reverted. On the same lab cluster, a
bucket from a class with only `objectLockEnabled` accepted a default
retention set afterwards with `PutObjectLockConfiguration`, per-object
`PutObjectRetention`, and Legal Hold. The class itself has not run on a
SeaweedFS 4.48 backend yet.

### Screenshots

No template change in the dashboard. The new field reaches the bucket
form through the schema, like `locking`.

### Downstream repositories

- [ ] No downstream repository is affected by this change
- [x] [cozystack/website](https://github.com/cozystack/website) -
follow-up: cozystack/website#821
- [x]
[cozystack/terraform-provider-cozystack](https://github.com/cozystack/terraform-provider-cozystack)
- follow-up:
cozystack/terraform-provider-cozystack#73
(issue)
- [ ]
[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:

The bucket app gains a field in its `values.schema.json`, so
`terraform-provider-cozystack` needs it in its bucket resource with a
default of `true`; filed as an issue there rather than a PR, since
whether the attribute should force a replacement is the provider
maintainers' call. The website's Buckets guide is hand-written and
described only the `-lock` class with its default retention, so it is
updated in cozystack/website#821. No other repository in the trigger map
is reached by this diff.

### Release note

```release-note
feat(bucket): add `lockingDefaultRetention` to provision a locked bucket with Object Lock enabled and no default retention, from the new `-lock-noretention` BucketClass, so the retention can be chosen through the S3 API.
```


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **New Features**
* When bucket locking is enabled, choose whether newly created buckets
receive the default COMPLIANCE retention period of 365 days. Default
retention remains enabled by default.
* Turn off default retention to enable Object Lock without a preset
retention period. Retention can then be configured for the bucket or
individual objects through the S3 API.
* This setting is applied only when a bucket is created; changing it
later does not alter existing buckets.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant