Skip to content

Commit 56cc063

Browse files
committed
Merge remote-tracking branch 'origin/main' into fix/make-client-authentication-method-opt-in
2 parents 85e35bc + 8904f2a commit 56cc063

8 files changed

Lines changed: 583 additions & 123 deletions

File tree

crates/stackable-operator/CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,18 @@ All notable changes to this project will be documented in this file.
77
### Added
88

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

1113
### Changed
1214

1315
- BREAKING: Change signature of `ContainerBuilder::add_env_vars` from `Vec<EnvVar>` to `IntoIterator<Item = EnvVar>` ([#1163]).
1416
- BREAKING: Remove `EXPERIMENTAL_` prefix in `CONFIG_OVERRIDE_FILE_HEADER_KEY` and `CONFIG_OVERRIDE_FILE_FOOTER_KEY` ([#1191]).
1517
- BREAKING: Bump `kube` from a custom version (`fe69cc486ff8e62a7da61d64ec3ebbd9e64c43b5`, which is between `3.0.1` and `3.1.0`
16-
and was needed to pull in schema fixes) to `3.1.0`. This means that the CRD schema generation bugs
18+
and was needed to pull in schema fixes) to `3.1.0`. This means that the CRD schema generation bugs
1719
[#1934](https://github.com/kube-rs/kube/pull/1934) and [#1942](https://github.com/kube-rs/kube/pull/1942) are fixed ([#1192]).
20+
- BREAKING: Add `ConfigOverrides` type parameter to `CommonConfiguration`, `Role` and `RoleGroup`.
21+
The `config_overrides` field is now generic instead of `HashMap<String, HashMap<String, String>>` ([#1177]).
1822
- BREAKING: In [#1178] the `clientAuthenticationMethod` was added to the `ClientAuthenticationOptions` struct,
1923
resulting it to show up in all product CRDs. even those that don't support configuring the client authentication method.
2024
With this change, operators need to opt-in to the `clientAuthenticationMethod` field by using the new
@@ -23,6 +27,7 @@ All notable changes to this project will be documented in this file.
2327
but operators can decide if they want to offer support for this field or not ([#1194]).
2428

2529
[#1163]: https://github.com/stackabletech/operator-rs/pull/1163
30+
[#1177]: https://github.com/stackabletech/operator-rs/pull/1177
2631
[#1191]: https://github.com/stackabletech/operator-rs/pull/1191
2732
[#1192]: https://github.com/stackabletech/operator-rs/pull/1192
2833
[#1194]: https://github.com/stackabletech/operator-rs/pull/1194

crates/stackable-operator/crds/DummyCluster.yaml

Lines changed: 90 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -965,17 +965,57 @@ spec:
965965
type: object
966966
type: object
967967
configOverrides:
968-
additionalProperties:
969-
additionalProperties:
970-
type: string
971-
type: object
972-
default: {}
973968
description: |-
974969
The `configOverrides` can be used to configure properties in product config files
975970
that are not exposed in the CRD. Read the
976971
[config overrides documentation](https://docs.stackable.tech/home/nightly/concepts/overrides#config-overrides)
977972
and consult the operator specific usage guide documentation for details on the
978973
available config files and settings for the specific product.
974+
properties:
975+
config.json:
976+
description: Overrides for the `config.json` file.
977+
nullable: true
978+
oneOf:
979+
- required:
980+
- jsonMergePatch
981+
- required:
982+
- jsonPatches
983+
- required:
984+
- userProvided
985+
properties:
986+
jsonMergePatch:
987+
description: |-
988+
Can be set to arbitrary YAML content, which is converted to JSON and used as
989+
[RFC 7396](https://datatracker.ietf.org/doc/html/rfc7396) JSON merge patch.
990+
type: object
991+
x-kubernetes-preserve-unknown-fields: true
992+
jsonPatches:
993+
description: |-
994+
List of [RFC 6902](https://datatracker.ietf.org/doc/html/rfc6902) JSON patches.
995+
996+
Can be used when more flexibility is needed, e.g. to only modify elements
997+
in a list based on a condition.
998+
999+
A patch looks something like
1000+
1001+
`{"op": "test", "path": "/0/name", "value": "Andrew"}`
1002+
1003+
or
1004+
1005+
`{"op": "add", "path": "/0/happy", "value": true}`
1006+
items:
1007+
type: string
1008+
type: array
1009+
userProvided:
1010+
description: Override the entire config file with the specified String.
1011+
type: string
1012+
type: object
1013+
dummy.properties:
1014+
additionalProperties:
1015+
type: string
1016+
description: Overrides for the `dummy.properties` file.
1017+
nullable: true
1018+
type: object
9791019
type: object
9801020
envOverrides:
9811021
additionalProperties:
@@ -1577,17 +1617,57 @@ spec:
15771617
type: object
15781618
type: object
15791619
configOverrides:
1580-
additionalProperties:
1581-
additionalProperties:
1582-
type: string
1583-
type: object
1584-
default: {}
15851620
description: |-
15861621
The `configOverrides` can be used to configure properties in product config files
15871622
that are not exposed in the CRD. Read the
15881623
[config overrides documentation](https://docs.stackable.tech/home/nightly/concepts/overrides#config-overrides)
15891624
and consult the operator specific usage guide documentation for details on the
15901625
available config files and settings for the specific product.
1626+
properties:
1627+
config.json:
1628+
description: Overrides for the `config.json` file.
1629+
nullable: true
1630+
oneOf:
1631+
- required:
1632+
- jsonMergePatch
1633+
- required:
1634+
- jsonPatches
1635+
- required:
1636+
- userProvided
1637+
properties:
1638+
jsonMergePatch:
1639+
description: |-
1640+
Can be set to arbitrary YAML content, which is converted to JSON and used as
1641+
[RFC 7396](https://datatracker.ietf.org/doc/html/rfc7396) JSON merge patch.
1642+
type: object
1643+
x-kubernetes-preserve-unknown-fields: true
1644+
jsonPatches:
1645+
description: |-
1646+
List of [RFC 6902](https://datatracker.ietf.org/doc/html/rfc6902) JSON patches.
1647+
1648+
Can be used when more flexibility is needed, e.g. to only modify elements
1649+
in a list based on a condition.
1650+
1651+
A patch looks something like
1652+
1653+
`{"op": "test", "path": "/0/name", "value": "Andrew"}`
1654+
1655+
or
1656+
1657+
`{"op": "add", "path": "/0/happy", "value": true}`
1658+
items:
1659+
type: string
1660+
type: array
1661+
userProvided:
1662+
description: Override the entire config file with the specified String.
1663+
type: string
1664+
type: object
1665+
dummy.properties:
1666+
additionalProperties:
1667+
type: string
1668+
description: Overrides for the `dummy.properties` file.
1669+
nullable: true
1670+
type: object
15911671
type: object
15921672
envOverrides:
15931673
additionalProperties:

crates/stackable-operator/src/commons/resources.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@
3030
//! role_utils::Role,
3131
//! };
3232
//!
33+
//! #[derive(Clone, Debug, Default, Deserialize, JsonSchema, PartialEq, Serialize)]
34+
//! pub struct ProductConfigOverrides {}
35+
//!
3336
//! #[derive(Clone, CustomResource, Debug, Deserialize, JsonSchema, Serialize)]
3437
//! #[kube(
3538
//! group = "product.stackable.tech",
@@ -46,7 +49,7 @@
4649
//! #[serde(rename_all = "camelCase")]
4750
//! pub struct ProductSpec {
4851
//! #[serde(default, skip_serializing_if = "Option::is_none")]
49-
//! pub nodes: Option<Role<ProductConfigFragment>>,
52+
//! pub nodes: Option<Role<ProductConfigFragment, ProductConfigOverrides>>,
5053
//! }
5154
//!
5255
//! #[derive(Debug, Default, PartialEq, Fragment, JsonSchema)]

0 commit comments

Comments
 (0)