Skip to content

Commit 83b43ad

Browse files
committed
feat: Support objectOverrides
1 parent 2e4cd29 commit 83b43ad

File tree

7 files changed

+80
-19
lines changed

7 files changed

+80
-19
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
44

55
## [Unreleased]
66

7+
### Added
8+
9+
- Support objectOverrides using `.spec.objectOverrides`.
10+
See [objectOverrides concepts page](https://docs.stackable.tech/home/nightly/concepts/overrides/#object-overrides) for details ([#XXX]).
11+
12+
[#XXX]: https://github.com/stackabletech/druid-operator/pull/XXX
13+
714
### Changed
815

916
- Bump testing-tools to `0.3.0-stackable0.0.0-dev` ([#780]).

Cargo.lock

Lines changed: 51 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ repository = "https://github.com/stackabletech/druid-operator"
1111

1212
[workspace.dependencies]
1313
product-config = { git = "https://github.com/stackabletech/product-config.git", tag = "0.8.0" }
14-
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", features = ["telemetry", "versioned"], tag = "stackable-operator-0.100.1" }
14+
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.101.2", features = ["telemetry", "versioned"] }
1515

1616
anyhow = "1.0"
1717
built = { version = "0.8", features = ["chrono", "git2"] }

deploy/helm/druid-operator/crds/crds.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3127,6 +3127,20 @@ spec:
31273127
required:
31283128
- roleGroups
31293129
type: object
3130+
objectOverrides:
3131+
default: []
3132+
description: |-
3133+
A list of generic Kubernetes objects, which are merged into the objects that the operator
3134+
creates.
3135+
3136+
List entries are arbitrary YAML objects, which need to be valid Kubernetes objects.
3137+
3138+
Read the [Object overrides documentation](https://docs.stackable.tech/home/nightly/concepts/overrides#object-overrides)
3139+
for more information.
3140+
items:
3141+
type: object
3142+
x-kubernetes-preserve-unknown-fields: true
3143+
type: array
31303144
routers:
31313145
description: |-
31323146
This struct represents a role - e.g. HDFS datanodes or Trino workers. It has a key-value-map containing

rust/operator-binary/src/crd/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ use stackable_operator::{
1919
merge::Merge,
2020
},
2121
crd::{authentication::core, s3},
22+
deep_merger::ObjectOverrides,
2223
k8s_openapi::api::core::v1::{PodTemplateSpec, Volume},
2324
kube::{CustomResource, ResourceExt},
2425
kvp::ObjectLabels,
@@ -244,6 +245,10 @@ pub mod versioned {
244245
// no doc - docs provided by the struct.
245246
#[serde(default)]
246247
pub cluster_operation: ClusterOperation,
248+
249+
// no doc - docs provided by the struct.
250+
#[serde(default)]
251+
pub object_overrides: ObjectOverrides,
247252
}
248253

249254
#[derive(Clone, Debug, Deserialize, JsonSchema, Serialize)]

rust/operator-binary/src/druid_controller.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,7 @@ pub async fn reconcile_druid(
491491
DRUID_CONTROLLER_NAME,
492492
&druid.object_ref(&()),
493493
ClusterResourceApplyStrategy::from(&druid.spec.cluster_operation),
494+
&druid.spec.object_overrides,
494495
)
495496
.context(CreateClusterResourcesSnafu)?;
496497

rust/operator-binary/src/operations/pdb.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pub async fn add_pdbs(
2828
druid: &v1alpha1::DruidCluster,
2929
role: &DruidRole,
3030
client: &Client,
31-
cluster_resources: &mut ClusterResources,
31+
cluster_resources: &mut ClusterResources<'_>,
3232
) -> Result<(), Error> {
3333
if !pdb.enabled {
3434
return Ok(());

0 commit comments

Comments
 (0)