diff --git a/deploy/helm/nifi-operator/crds/crds.yaml b/deploy/helm/nifi-operator/crds/crds.yaml index 5bba05e1..eefaeb80 100644 --- a/deploy/helm/nifi-operator/crds/crds.yaml +++ b/deploy/helm/nifi-operator/crds/crds.yaml @@ -656,24 +656,27 @@ spec: description: '`envOverrides` configure environment variables to be set in the Pods. It is a map from strings to strings - environment variables and the value to set. Read the [environment variable overrides documentation](https://docs.stackable.tech/home/nightly/concepts/overrides#env-overrides) for more information and consult the operator specific usage guide to find out about the product specific environment variables that are available.' type: object jvmArgumentOverrides: - additionalProperties: - oneOf: - - required: - - argument - - required: - - flag - - required: - - remove - properties: - argument: - type: string - flag: - type: object - remove: - type: object - type: object - default: {} + default: + add: [] + remove: [] + removeRegex: [] description: Allows overriding JVM arguments. + properties: + add: + default: [] + items: + type: string + type: array + remove: + default: [] + items: + type: string + type: array + removeRegex: + default: [] + items: + type: string + type: array type: object podOverrides: default: {} @@ -1137,24 +1140,27 @@ spec: description: '`envOverrides` configure environment variables to be set in the Pods. It is a map from strings to strings - environment variables and the value to set. Read the [environment variable overrides documentation](https://docs.stackable.tech/home/nightly/concepts/overrides#env-overrides) for more information and consult the operator specific usage guide to find out about the product specific environment variables that are available.' type: object jvmArgumentOverrides: - additionalProperties: - oneOf: - - required: - - argument - - required: - - flag - - required: - - remove - properties: - argument: - type: string - flag: - type: object - remove: - type: object - type: object - default: {} + default: + add: [] + remove: [] + removeRegex: [] description: Allows overriding JVM arguments. + properties: + add: + default: [] + items: + type: string + type: array + remove: + default: [] + items: + type: string + type: array + removeRegex: + default: [] + items: + type: string + type: array type: object podOverrides: default: {} diff --git a/rust/operator-binary/src/config.rs b/rust/operator-binary/src/config.rs index 685d6964..d92062da 100644 --- a/rust/operator-binary/src/config.rs +++ b/rust/operator-binary/src/config.rs @@ -179,9 +179,8 @@ pub fn build_bootstrap_conf( jvm_argument_overrides: JvmArgumentOverrides::new_with_only_additions(jvm_args), }; - // Please note that merge order is different than we normally do! - // This is not trivial, as the merge operation is not purely additive (as it is with e.g. - // PodTemplateSpec). + // Please note that the merge order is different than we normally do! + // This is not trivial, as the merge operation is not purely additive (as it is with e.g. `PodTemplateSpec). let mut role = role_java_common_config.clone(); role.merge(&operator_generated); let mut role_group = role_group_java_common_config.clone(); @@ -764,21 +763,7 @@ mod tests { default: replicas: 1 "#; - let nifi: NifiCluster = serde_yaml::from_str(input).expect("illegal test input"); - - let role = NifiRole::Node; - let merged_config = nifi.merged_config(&role, "default").unwrap(); - let nodes = nifi.spec.nodes.unwrap(); - let (role_java_common_config, role_group_java_common_config) = nodes - .merged_product_specific_common_configs("default") - .unwrap(); - let bootstrap_conf = build_bootstrap_conf( - &merged_config, - BTreeMap::new(), - role_java_common_config, - role_group_java_common_config, - ) - .unwrap(); + let bootstrap_conf = construct_bootstrap_conf(input); assert_eq!( bootstrap_conf, @@ -846,25 +831,7 @@ mod tests { - -Xmx40000m - -Dhttps.proxyPort=1234 "#; - let nifi: NifiCluster = serde_yaml::from_str(input).expect("illegal test input"); - - let role = NifiRole::Node; - let merged_config = nifi.merged_config(&role, "default").unwrap(); - let nodes = nifi.spec.nodes.unwrap(); - let (role_java_common_config, role_group_java_common_config) = nodes - .merged_product_specific_common_configs("default") - .unwrap(); - - dbg!(&role_java_common_config); - dbg!(&role_group_java_common_config); - - let bootstrap_conf = build_bootstrap_conf( - &merged_config, - BTreeMap::new(), - role_java_common_config, - role_group_java_common_config, - ) - .unwrap(); + let bootstrap_conf = construct_bootstrap_conf(input); assert_eq!( bootstrap_conf, @@ -892,4 +859,23 @@ mod tests { "} ); } + + fn construct_bootstrap_conf(nifi_cluster: &str) -> String { + let nifi: NifiCluster = serde_yaml::from_str(nifi_cluster).expect("illegal test input"); + + let role = NifiRole::Node; + let merged_config = nifi.merged_config(&role, "default").unwrap(); + let nodes = nifi.spec.nodes.unwrap(); + let (role_java_common_config, role_group_java_common_config) = nodes + .merged_product_specific_common_configs("default") + .unwrap(); + + build_bootstrap_conf( + &merged_config, + BTreeMap::new(), + role_java_common_config, + role_group_java_common_config, + ) + .unwrap() + } }