Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions crates/stackable-operator/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,19 @@ All notable changes to this project will be documented in this file.
### Added

- Add generic database connection mechanism ([#1163]).
- Add `config_overrides` module with `KeyValueOverridesProvider` trait, enabling
structured config file formats (e.g. JSON) in addition to key-value overrides ([#1177]).

### Changed

- BREAKING: Change signature of `ContainerBuilder::add_env_vars` from `Vec<EnvVar>` to `IntoIterator<Item = EnvVar>` ([#1163]).
- BREAKING: Remove `EXPERIMENTAL_` prefix in `CONFIG_OVERRIDE_FILE_HEADER_KEY` and `CONFIG_OVERRIDE_FILE_FOOTER_KEY` ([#1191]).
- BREAKING: Bump `kube` from a custom version (`fe69cc486ff8e62a7da61d64ec3ebbd9e64c43b5`, which is between `3.0.1` and `3.1.0` and was needed to pull in schema fixes) to `3.1.0`. This means that the CRD schema generation bugs [#1934](https://github.com/kube-rs/kube/pull/1934) and [#1942](https://github.com/kube-rs/kube/pull/1942) are fixed ([#1192]).
- BREAKING: Add `ConfigOverrides` type parameter to `CommonConfiguration`, `Role` and `RoleGroup`.
The `config_overrides` field is now generic instead of `HashMap<String, HashMap<String, String>>` ([#1177]).

[#1163]: https://github.com/stackabletech/operator-rs/pull/1163
[#1177]: https://github.com/stackabletech/operator-rs/pull/1177
[#1191]: https://github.com/stackabletech/operator-rs/pull/1191
[#1192]: https://github.com/stackabletech/operator-rs/pull/1192

Expand Down
100 changes: 90 additions & 10 deletions crates/stackable-operator/crds/DummyCluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -965,17 +965,57 @@ spec:
type: object
type: object
configOverrides:
additionalProperties:
additionalProperties:
type: string
type: object
default: {}
description: |-
The `configOverrides` can be used to configure properties in product config files
that are not exposed in the CRD. Read the
[config overrides documentation](https://docs.stackable.tech/home/nightly/concepts/overrides#config-overrides)
and consult the operator specific usage guide documentation for details on the
available config files and settings for the specific product.
properties:
config.json:
description: Overrides for the `config.json` file.
nullable: true
oneOf:
- required:
- jsonMergePatch
- required:
- jsonPatches
- required:
- userProvided
properties:
jsonMergePatch:
description: |-
Can be set to arbitrary YAML content, which is converted to JSON and used as
[RFC 7396](https://datatracker.ietf.org/doc/html/rfc7396) JSON merge patch.
type: object
x-kubernetes-preserve-unknown-fields: true
jsonPatches:
description: |-
List of [RFC 6902](https://datatracker.ietf.org/doc/html/rfc6902) JSON patches.

Can be used when more flexibility is needed, e.g. to only modify elements
in a list based on a condition.

A patch looks something like

`{"op": "test", "path": "/0/name", "value": "Andrew"}`

or

`{"op": "add", "path": "/0/happy", "value": true}`
items:
type: string
type: array
userProvided:
description: Override the entire config file with the specified String.
type: string
type: object
dummy.properties:
additionalProperties:
type: string
description: Overrides for the `dummy.properties` file.
nullable: true
type: object
type: object
envOverrides:
additionalProperties:
Expand Down Expand Up @@ -1577,17 +1617,57 @@ spec:
type: object
type: object
configOverrides:
additionalProperties:
additionalProperties:
type: string
type: object
default: {}
description: |-
The `configOverrides` can be used to configure properties in product config files
that are not exposed in the CRD. Read the
[config overrides documentation](https://docs.stackable.tech/home/nightly/concepts/overrides#config-overrides)
and consult the operator specific usage guide documentation for details on the
available config files and settings for the specific product.
properties:
config.json:
description: Overrides for the `config.json` file.
nullable: true
oneOf:
- required:
- jsonMergePatch
- required:
- jsonPatches
- required:
- userProvided
properties:
jsonMergePatch:
description: |-
Can be set to arbitrary YAML content, which is converted to JSON and used as
[RFC 7396](https://datatracker.ietf.org/doc/html/rfc7396) JSON merge patch.
type: object
x-kubernetes-preserve-unknown-fields: true
jsonPatches:
description: |-
List of [RFC 6902](https://datatracker.ietf.org/doc/html/rfc6902) JSON patches.

Can be used when more flexibility is needed, e.g. to only modify elements
in a list based on a condition.

A patch looks something like

`{"op": "test", "path": "/0/name", "value": "Andrew"}`

or

`{"op": "add", "path": "/0/happy", "value": true}`
items:
type: string
type: array
userProvided:
description: Override the entire config file with the specified String.
type: string
type: object
dummy.properties:
additionalProperties:
type: string
description: Overrides for the `dummy.properties` file.
nullable: true
type: object
type: object
envOverrides:
additionalProperties:
Expand Down
5 changes: 4 additions & 1 deletion crates/stackable-operator/src/commons/resources.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
//! role_utils::Role,
//! };
//!
//! #[derive(Clone, Debug, Default, Deserialize, JsonSchema, PartialEq, Serialize)]
//! pub struct ProductConfigOverrides {}
//!
//! #[derive(Clone, CustomResource, Debug, Deserialize, JsonSchema, Serialize)]
//! #[kube(
//! group = "product.stackable.tech",
Expand All @@ -46,7 +49,7 @@
//! #[serde(rename_all = "camelCase")]
//! pub struct ProductSpec {
//! #[serde(default, skip_serializing_if = "Option::is_none")]
//! pub nodes: Option<Role<ProductConfigFragment>>,
//! pub nodes: Option<Role<ProductConfigFragment, ProductConfigOverrides>>,
//! }
//!
//! #[derive(Debug, Default, PartialEq, Fragment, JsonSchema)]
Expand Down
Loading
Loading