Skip to content
Draft
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
16 changes: 8 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 22 additions & 22 deletions Cargo.nix

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ tokio-zookeeper = "0.4"
tracing = "0.1"

[patch."https://github.com/stackabletech/operator-rs"]
# stackable-operator = { git = "https://github.com/stackabletech//operator-rs.git", branch = "main" }
stackable-operator = { git = "https://github.com/stackabletech//operator-rs.git", branch = "feat/object-overrides" }
# stackable-operator = { path = "../operator-rs/crates/stackable-operator" }

[patch.crates-io]
Expand Down
14 changes: 7 additions & 7 deletions crate-hashes.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions deploy/helm/zookeeper-operator/crds/crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,13 @@ spec:
nullable: true
type: string
type: object
objectOverrides:
default: []
description: TODO docs
items:
type: object
x-kubernetes-preserve-unknown-fields: true
type: array
servers:
description: |-
This struct represents a role - e.g. HDFS datanodes or Trino workers. It has a key-value-map containing
Expand Down Expand Up @@ -1029,6 +1036,13 @@ spec:
nullable: true
type: string
type: object
objectOverrides:
default: []
description: TODO docs
items:
type: object
x-kubernetes-preserve-unknown-fields: true
type: array
type: object
status:
nullable: true
Expand Down
11 changes: 9 additions & 2 deletions rust/operator-binary/src/crd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ use stackable_operator::{
},
kube::{CustomResource, ResourceExt, runtime::reflector::ObjectRef},
memory::{BinaryMultiple, MemoryQuantity},
patchinator::ObjectOverrides,
product_config_utils::{self, Configuration},
product_logging::{self, spec::Logging},
role_utils::{GenericRoleConfig, JavaCommonConfig, Role, RoleGroup, RoleGroupRef},
Expand Down Expand Up @@ -128,7 +129,7 @@ pub mod versioned {
/// A ZooKeeper cluster stacklet. This resource is managed by the Stackable operator for Apache ZooKeeper.
/// Find more information on how to use it and the resources that the operator generates in the
/// [operator documentation](DOCS_BASE_URL_PLACEHOLDER/zookeeper/).
#[derive(Clone, CustomResource, Debug, Deserialize, JsonSchema, PartialEq, Serialize)]
#[derive(Clone, CustomResource, Debug, Deserialize, JsonSchema, Serialize)]
#[versioned(crd(
group = "zookeeper.stackable.tech",
plural = "zookeeperclusters",
Expand All @@ -154,6 +155,9 @@ pub mod versioned {
#[serde(skip_serializing_if = "Option::is_none")]
pub servers:
Option<Role<ZookeeperConfigFragment, ZookeeperServerRoleConfig, JavaCommonConfig>>,

#[serde(flatten)]
pub object_overrides: ObjectOverrides,
}

#[derive(Clone, Debug, Deserialize, JsonSchema, PartialEq, Serialize)]
Expand Down Expand Up @@ -290,7 +294,7 @@ pub mod versioned {
///
/// You can learn more about this in the
/// [Isolating clients with ZNodes usage guide](DOCS_BASE_URL_PLACEHOLDER/zookeeper/usage_guide/isolating_clients_with_znodes).
#[derive(Clone, CustomResource, Debug, Deserialize, JsonSchema, PartialEq, Serialize)]
#[derive(Clone, CustomResource, Debug, Deserialize, JsonSchema, Serialize)]
#[versioned(crd(
group = "zookeeper.stackable.tech",
plural = "zookeeperznodes",
Expand All @@ -304,6 +308,9 @@ pub mod versioned {
/// The reference to the ZookeeperCluster that this ZNode belongs to.
#[serde(default)]
pub cluster_ref: ClusterRef<ZookeeperCluster>,

#[serde(flatten)]
pub object_overrides: ObjectOverrides,
}

#[derive(Clone, Default, Debug, Deserialize, Eq, JsonSchema, PartialEq, Serialize)]
Expand Down
2 changes: 1 addition & 1 deletion rust/operator-binary/src/operations/pdb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub async fn add_pdbs(
zookeeper: &v1alpha1::ZookeeperCluster,
role: &ZookeeperRole,
client: &Client,
cluster_resources: &mut ClusterResources,
cluster_resources: &mut ClusterResources<'_>,
) -> Result<(), Error> {
if !pdb.enabled {
return Ok(());
Expand Down
1 change: 1 addition & 0 deletions rust/operator-binary/src/zk_controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@ pub async fn reconcile_zk(
ZK_CONTROLLER_NAME,
&zk.object_ref(&()),
ClusterResourceApplyStrategy::from(&zk.spec.cluster_operation),
&zk.spec.object_overrides,
)
.context(CreateClusterResourcesSnafu)?;

Expand Down
1 change: 1 addition & 0 deletions rust/operator-binary/src/znode_controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ async fn reconcile_apply(
ZNODE_CONTROLLER_NAME,
&znode.object_ref(&()),
ClusterResourceApplyStrategy::from(&zk.spec.cluster_operation),
&znode.spec.object_overrides,
)
.context(ZnodeMissingExpectedKeysSnafu { znode })?;

Expand Down