Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 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 CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,13 @@ All notable changes to this project will be documented in this file.
- Add `stackable_webhook` crate which provides utilities to create webhooks with TLS termination ([#730]).
- Add `ConversionReview` re-export in `stackable_webhook` crate ([#749]).

## Fixed

- Fix wrong schema (and thus CRD) for `config.affinity.nodeSelector` ([#752]).

[#730]: https://github.com/stackabletech/operator-rs/pull/730
[#749]: https://github.com/stackabletech/operator-rs/pull/749
[#752]: https://github.com/stackabletech/operator-rs/pull/752

## Changed

Expand Down
10 changes: 10 additions & 0 deletions crates/stackable-operator/src/commons/affinity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,18 @@ pub struct StackableAffinity {
pub node_selector: Option<StackableNodeSelector>,
}

/// We can not simply use [`BTreeMap<String, String>`] in [`StackableAffinity`], as the fields need to be [`Atomic`].
/// We can not mark it as [`Atomic`], as [`crate::config::fragment::FromFragment`] is already implemented for
/// [`BTreeMap<String, String>`].
///
/// We `#[serde(flatten)]` the contained [`BTreeMap<String, String>`], so `serde_yaml` can deserialize everything as
/// expected.
// FIXME: The generated JsonSchema will be wrong, so until https://github.com/GREsau/schemars/issues/259 is fixed, we
// need to use `#[schemars(deny_unknown_fields)]`.
// See https://github.com/stackabletech/operator-rs/pull/752#issuecomment-2017630433 for details.
#[derive(Clone, Debug, Eq, Deserialize, JsonSchema, PartialEq, Serialize)]
#[serde(rename_all = "camelCase")]
#[schemars(deny_unknown_fields)]
pub struct StackableNodeSelector {
#[serde(flatten)]
pub node_selector: BTreeMap<String, String>,
Expand Down