diff --git a/crates/stackable-operator/src/commons/affinity.rs b/crates/stackable-operator/src/commons/affinity.rs index 818ae36b7..32fde9024 100644 --- a/crates/stackable-operator/src/commons/affinity.rs +++ b/crates/stackable-operator/src/commons/affinity.rs @@ -39,8 +39,8 @@ pub struct StackableAffinity { pub pod_affinity: Option, pub pod_anti_affinity: Option, pub node_affinity: Option, - #[schemars(schema_with = "stackable_node_selector_schema")] - #[fragment_attrs(schemars(schema_with = "stackable_node_selector_schema"))] + #[schemars(schema_with = "optional_stackable_node_selector_schema")] + #[fragment_attrs(schemars(schema_with = "optional_stackable_node_selector_schema"))] pub node_selector: Option, } @@ -61,7 +61,7 @@ pub struct StackableNodeSelector { impl Atomic for StackableNodeSelector {} /// We need a custom JsonSchema for [`StackableNodeSelector`], please have a look at the documentation there. -pub fn stackable_node_selector_schema(gen: &mut schemars::gen::SchemaGenerator) -> Schema { +pub fn optional_stackable_node_selector_schema(gen: &mut schemars::gen::SchemaGenerator) -> Schema { Option::>::json_schema(gen) }