Repository navigation
Commit ad99cbc
committed
feat(apps): mark stateful-app storageClass fields as immutable
Annotate storageClass as immutable across every stateful app whose
chart exposes one — clickhouse, foundationdb, harbor, http-cache,
kafka (Kafka + ZooKeeper), kubernetes (top-level + nodeGroups[]),
mariadb, mongodb, nats, openbao, opensearch, postgres, qdrant,
rabbitmq, redis, vm-disk. Without coverage across the catalogue,
the UI would render storageClass read-only on some apps and
editable on others — a worse mental model than uniform behaviour.
The annotation lands at the schema layer (CEL XValidation rule
'self == oldSelf' on values.schema.json / types.go / embedded
openAPISchema in cozyrds/<app>.yaml). The cozystack aggregated
apiserver does not yet evaluate CEL on application-backed
resources; that is tracked at #2657. The UI
(cozystack/cozystack-ui#6) consumes the marker today.
The PVC-pinning argument is identical for every chart: Kubernetes
fixes a PVC's storageClassName at creation time, so editing this
field on an existing resource never migrated data. The schema
annotation makes that contract explicit.
A refactor in pkg/registry/apps/application/rest.go extracts the
inline schema-build path into buildSpecSchema so it can be
unit-tested. Three regression tests in
rest_spec_schema_test.go pin the contract that
x-kubernetes-validations survives the v1→internal→structural
conversion (loaded from the actual MariaDB ApplicationDefinition
fixture on disk, not a hand-edited mock).
Requires cozystack/cozyvalues-gen with @immutable support — bump
the pre-commit pin in .github/workflows/pre-commit.yml once the
release exists.
Assisted-By: Claude <[email protected]>
Signed-off-by: Aleksei Sviridkin <[email protected]>1 parent e4f9a18 commit ad99cbc
67 files changed
Lines changed: 322 additions & 54 deletions
File tree
- api/apps/v1alpha1
- clickhouse
- foundationdb
- harbor
- httpcache
- kafka
- kubernetes
- mariadb
- mongodb
- nats
- openbao
- opensearch
- postgresql
- qdrant
- rabbitmq
- redis
- vmdisk
- packages
- apps
- clickhouse
- foundationdb
- harbor
- http-cache
- kafka
- kubernetes
- mariadb
- mongodb
- nats
- openbao
- opensearch
- postgres
- qdrant
- rabbitmq
- redis
- vm-disk
- system
- clickhouse-rd/cozyrds
- foundationdb-rd/cozyrds
- harbor-rd/cozyrds
- http-cache-rd/cozyrds
- kafka-rd/cozyrds
- kubernetes-rd/cozyrds
- mariadb-rd/cozyrds
- mongodb-rd/cozyrds
- nats-rd/cozyrds
- openbao-rd/cozyrds
- opensearch-rd/cozyrds
- postgres-rd/cozyrds
- qdrant-rd/cozyrds
- rabbitmq-rd/cozyrds
- redis-rd/cozyrds
- vm-disk-rd/cozyrds
- pkg/registry/apps/application
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments