Skip to content

Commit 2a13574

Browse files
chore: Upgrade all dependencies
1 parent f62cbd1 commit 2a13574

14 files changed

Lines changed: 2203 additions & 1393 deletions

File tree

Cargo.lock

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

Cargo.nix

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

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ edition = "2024"
1010
repository = "https://github.com/stackabletech/opensearch-operator"
1111

1212
[workspace.dependencies]
13-
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", features = ["telemetry", "versioned"], tag = "stackable-operator-0.93.2" }
13+
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", features = ["telemetry", "versioned"], tag = "stackable-operator-0.97.0" }
1414

1515
built = { version = "0.8.0", features = ["chrono", "git2"] }
1616
clap = "4.5"
@@ -21,7 +21,7 @@ serde = { version = "1.0", features = ["derive"] }
2121
serde_json = "1.0"
2222
snafu = "0.8"
2323
strum = { version = "0.27", features = ["derive"] }
24-
tokio = { version = "1.45", features = ["full"] }
24+
tokio = { version = "1.47", features = ["full"] }
2525
tracing = "0.1"
2626

2727
#[patch."https://github.com/stackabletech/operator-rs"]

crate-hashes.json

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

deploy/helm/opensearch-operator/templates/roles.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ rules:
1212
verbs:
1313
- list
1414
- watch
15+
# For automatic cluster domain detection
16+
- apiGroups:
17+
- ""
18+
resources:
19+
- nodes/proxy
20+
verbs:
21+
- get
1522
- apiGroups:
1623
- ""
1724
resources:

rust/operator-binary/src/controller.rs

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use build::build;
55
use snafu::{ResultExt, Snafu};
66
use stackable_operator::{
77
cluster_resources::ClusterResourceApplyStrategy,
8-
commons::{affinity::StackableAffinity, product_image_selection::ProductImage},
8+
commons::{affinity::StackableAffinity, product_image_selection::ResolvedProductImage},
99
crd::listener::v1alpha1::Listener,
1010
k8s_openapi::api::{
1111
apps::v1::StatefulSet,
@@ -16,7 +16,7 @@ use stackable_operator::{
1616
kube::{Resource, api::ObjectMeta, core::DeserializeGuard, runtime::controller::Action},
1717
logging::controller::ReconcilerError,
1818
role_utils::GenericRoleConfig,
19-
time::Duration,
19+
shared::time::Duration,
2020
};
2121
use strum::{EnumDiscriminants, IntoStaticStr};
2222
use update_status::update_status;
@@ -128,7 +128,7 @@ pub struct ValidatedOpenSearchConfig {
128128
#[derive(Clone, Debug, PartialEq)]
129129
pub struct ValidatedCluster {
130130
metadata: ObjectMeta,
131-
pub image: ProductImage,
131+
pub image: ResolvedProductImage,
132132
pub product_version: ProductVersion,
133133
pub name: ClusterName,
134134
pub namespace: String,
@@ -140,7 +140,7 @@ pub struct ValidatedCluster {
140140

141141
impl ValidatedCluster {
142142
pub fn new(
143-
image: ProductImage,
143+
image: ResolvedProductImage,
144144
product_version: ProductVersion,
145145
name: ClusterName,
146146
namespace: String,
@@ -318,10 +318,15 @@ struct KubernetesResources<T> {
318318

319319
#[cfg(test)]
320320
mod tests {
321-
use std::collections::{BTreeMap, HashMap};
321+
use std::{
322+
collections::{BTreeMap, HashMap},
323+
str::FromStr,
324+
};
322325

323326
use stackable_operator::{
324-
commons::affinity::StackableAffinity, k8s_openapi::api::core::v1::PodTemplateSpec,
327+
commons::{affinity::StackableAffinity, product_image_selection::ResolvedProductImage},
328+
k8s_openapi::api::core::v1::PodTemplateSpec,
329+
kvp::LabelValue,
325330
role_utils::GenericRoleConfig,
326331
};
327332

@@ -396,8 +401,14 @@ mod tests {
396401

397402
fn validated_cluster() -> ValidatedCluster {
398403
ValidatedCluster::new(
399-
serde_json::from_str(r#"{"productVersion": "3.1.0"}"#)
400-
.expect("should be a valid ProductImage structure"),
404+
ResolvedProductImage {
405+
product_version: "3.1.0".to_owned(),
406+
app_version_label_value: LabelValue::from_str("3.1.0-stackable0.0.0-dev")
407+
.expect("should be a valid label value"),
408+
image: "oci.stackable.tech/sdp/opensearch:3.1.0-stackable0.0.0-dev".to_string(),
409+
image_pull_policy: "Always".to_owned(),
410+
pull_secrets: None,
411+
},
401412
ProductVersion::from_str_unsafe("3.1.0"),
402413
ClusterName::from_str_unsafe("my-opensearch"),
403414
"default".to_owned(),

rust/operator-binary/src/controller/build.rs

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,17 @@ pub fn build(names: &ContextNames, cluster: ValidatedCluster) -> KubernetesResou
4646

4747
#[cfg(test)]
4848
mod tests {
49-
use std::collections::{BTreeMap, HashMap};
49+
use std::{
50+
collections::{BTreeMap, HashMap},
51+
str::FromStr,
52+
};
5053

5154
use stackable_operator::{
52-
commons::affinity::StackableAffinity, k8s_openapi::api::core::v1::PodTemplateSpec,
53-
kube::Resource, role_utils::GenericRoleConfig,
55+
commons::{affinity::StackableAffinity, product_image_selection::ResolvedProductImage},
56+
k8s_openapi::api::core::v1::PodTemplateSpec,
57+
kube::Resource,
58+
kvp::LabelValue,
59+
role_utils::GenericRoleConfig,
5460
};
5561

5662
use super::build;
@@ -137,8 +143,14 @@ mod tests {
137143

138144
fn validated_cluster() -> ValidatedCluster {
139145
ValidatedCluster::new(
140-
serde_json::from_str(r#"{"productVersion": "3.1.0"}"#)
141-
.expect("should be a valid ProductImage structure"),
146+
ResolvedProductImage {
147+
product_version: "3.1.0".to_owned(),
148+
app_version_label_value: LabelValue::from_str("3.1.0-stackable0.0.0-dev")
149+
.expect("should be a valid label value"),
150+
image: "oci.stackable.tech/sdp/opensearch:3.1.0-stackable0.0.0-dev".to_string(),
151+
image_pull_policy: "Always".to_owned(),
152+
pull_secrets: None,
153+
},
142154
ProductVersion::from_str_unsafe("3.1.0"),
143155
ClusterName::from_str_unsafe("my-opensearch"),
144156
"default".to_owned(),

rust/operator-binary/src/controller/build/node_config.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,10 +242,12 @@ mod tests {
242242

243243
use stackable_operator::{
244244
commons::{
245-
affinity::StackableAffinity, product_image_selection::ProductImage,
245+
affinity::StackableAffinity,
246+
product_image_selection::{ProductImage, ResolvedProductImage},
246247
resources::Resources,
247248
},
248249
k8s_openapi::api::core::v1::PodTemplateSpec,
250+
kvp::LabelValue,
249251
role_utils::GenericRoleConfig,
250252
};
251253

@@ -300,7 +302,14 @@ mod tests {
300302
};
301303

302304
let cluster = ValidatedCluster::new(
303-
image.clone(),
305+
ResolvedProductImage {
306+
product_version: "3.1.0".to_owned(),
307+
app_version_label_value: LabelValue::from_str("3.1.0-stackable0.0.0-dev")
308+
.expect("should be a valid label value"),
309+
image: "oci.stackable.tech/sdp/opensearch:3.1.0-stackable0.0.0-dev".to_string(),
310+
image_pull_policy: "Always".to_owned(),
311+
pull_secrets: None,
312+
},
304313
ProductVersion::from_str_unsafe(image.product_version()),
305314
ClusterName::from_str_unsafe("my-opensearch-cluster"),
306315
"default".to_owned(),

rust/operator-binary/src/controller/build/role_builder.rs

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,15 +197,20 @@ impl<'a> RoleBuilder<'a> {
197197

198198
#[cfg(test)]
199199
mod tests {
200-
use std::collections::{BTreeMap, HashMap};
200+
use std::{
201+
collections::{BTreeMap, HashMap},
202+
str::FromStr,
203+
};
201204

202205
use serde_json::json;
203206
use stackable_operator::{
204207
commons::{
205-
affinity::StackableAffinity, product_image_selection::ProductImage,
208+
affinity::StackableAffinity,
209+
product_image_selection::{ProductImage, ResolvedProductImage},
206210
resources::Resources,
207211
},
208212
k8s_openapi::api::core::v1::PodTemplateSpec,
213+
kvp::LabelValue,
209214
role_utils::GenericRoleConfig,
210215
};
211216

@@ -255,7 +260,14 @@ mod tests {
255260
};
256261

257262
let cluster = ValidatedCluster::new(
258-
image.clone(),
263+
ResolvedProductImage {
264+
product_version: "3.1.0".to_owned(),
265+
app_version_label_value: LabelValue::from_str("3.1.0-stackable0.0.0-dev")
266+
.expect("should be a valid label value"),
267+
image: "oci.stackable.tech/sdp/opensearch:3.1.0-stackable0.0.0-dev".to_string(),
268+
image_pull_policy: "Always".to_owned(),
269+
pull_secrets: None,
270+
},
259271
ProductVersion::from_str_unsafe(image.product_version()),
260272
ClusterName::from_str_unsafe("my-opensearch-cluster"),
261273
"default".to_owned(),

rust/operator-binary/src/controller/build/role_group_builder.rs

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -245,11 +245,6 @@ impl<'a> RoleGroupBuilder<'a> {
245245
}
246246

247247
fn build_container(&self, role_group_config: &OpenSearchRoleGroupConfig) -> Container {
248-
let product_image = self
249-
.cluster
250-
.image
251-
.resolve("opensearch", crate::built_info::PKG_VERSION);
252-
253248
// Probe values taken from the official Helm chart
254249
let startup_probe = Probe {
255250
failure_threshold: Some(30),
@@ -289,7 +284,7 @@ impl<'a> RoleGroupBuilder<'a> {
289284

290285
ContainerBuilder::new("opensearch")
291286
.expect("should be a valid container name")
292-
.image_from_product_image(&product_image)
287+
.image_from_product_image(&self.cluster.image)
293288
.command(vec![format!(
294289
"{opensearch_home}/opensearch-docker-entrypoint.sh"
295290
)])
@@ -483,15 +478,19 @@ impl<'a> RoleGroupBuilder<'a> {
483478

484479
#[cfg(test)]
485480
mod tests {
486-
use std::collections::{BTreeMap, HashMap};
481+
use std::{
482+
collections::{BTreeMap, HashMap},
483+
str::FromStr,
484+
};
487485

488486
use serde_json::json;
489487
use stackable_operator::{
490488
commons::{
491-
affinity::StackableAffinity, product_image_selection::ProductImage,
489+
affinity::StackableAffinity, product_image_selection::ResolvedProductImage,
492490
resources::Resources,
493491
},
494492
k8s_openapi::api::core::v1::PodTemplateSpec,
493+
kvp::LabelValue,
495494
role_utils::GenericRoleConfig,
496495
};
497496
use strum::IntoEnumIterator;
@@ -517,8 +516,14 @@ mod tests {
517516
}
518517

519518
fn validated_cluster() -> ValidatedCluster {
520-
let image: ProductImage = serde_json::from_str(r#"{"productVersion": "3.1.0"}"#)
521-
.expect("should be a valid ProductImage");
519+
let image = ResolvedProductImage {
520+
product_version: "3.1.0".to_owned(),
521+
app_version_label_value: LabelValue::from_str("3.1.0-stackable0.0.0-dev")
522+
.expect("should be a valid label value"),
523+
image: "oci.stackable.tech/sdp/opensearch:3.1.0-stackable0.0.0-dev".to_string(),
524+
image_pull_policy: "Always".to_owned(),
525+
pull_secrets: None,
526+
};
522527

523528
let role_group_config = OpenSearchRoleGroupConfig {
524529
replicas: 1,
@@ -543,7 +548,7 @@ mod tests {
543548

544549
ValidatedCluster::new(
545550
image.clone(),
546-
ProductVersion::from_str_unsafe(image.product_version()),
551+
ProductVersion::from_str_unsafe(&image.product_version),
547552
ClusterName::from_str_unsafe("my-opensearch-cluster"),
548553
"default".to_owned(),
549554
"0b1e30e6-326e-4c1a-868d-ad6598b49e8b".to_owned(),

0 commit comments

Comments
 (0)