Skip to content

Commit 3cd3cc7

Browse files
chore: Upgrade to stackable-operator 0.98.0
1 parent 2a13574 commit 3cd3cc7

8 files changed

Lines changed: 463 additions & 798 deletions

File tree

Cargo.lock

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

Cargo.nix

Lines changed: 305 additions & 555 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,13 +10,13 @@ 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.97.0" }
13+
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", features = ["telemetry", "versioned"], tag = "stackable-operator-0.98.0" }
1414

1515
built = { version = "0.8.0", features = ["chrono", "git2"] }
1616
clap = "4.5"
1717
futures = { version = "0.3", features = ["compat"] }
1818
rstest = "0.26"
19-
schemars = { version = "0.8.21" } # same as in operator-rs
19+
schemars = { version = "1.0.0", features = ["url2"] } # same as in operator-rs
2020
serde = { version = "1.0", features = ["derive"] }
2121
serde_json = "1.0"
2222
snafu = "0.8"

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.

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ pub fn validate(
8686
.resolve(DEFAULT_IMAGE_BASE_NAME, crate::built_info::PKG_VERSION)
8787
.context(ResolveProductImageSnafu)?;
8888

89+
// Cannot fail because `ProductImage::resolve` already validated it and would have thrown a
90+
// `ResolveProductImage` error if it were not valid.
8991
let product_version = ProductVersion::from_str(&product_image.product_version)
9092
.context(ParseProductVersionSnafu)?;
9193

@@ -403,7 +405,7 @@ mod tests {
403405
serde_json::from_str(r#"{"productVersion": "invalid product version"}"#)
404406
.expect("should be a valid ProductImage structure")
405407
},
406-
ErrorDiscriminants::ParseProductVersion,
408+
ErrorDiscriminants::ResolveProductImage,
407409
);
408410
}
409411

rust/operator-binary/src/framework.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,6 @@ pub enum Error {
3333
},
3434
}
3535

36-
/// Maximum length of a DNS subdomain name as defined in RFC 1123.
37-
/// The object names of most types, e.g. ConfigMap and StatefulSet, must not exceed this limit.
38-
/// However, there are kinds that allow longer object names, e.g. ClusterRole.
39-
#[allow(dead_code)]
40-
pub const MAX_OBJECT_NAME_LENGTH: usize = 253;
41-
4236
/// Has a name that can be used as a DNS subdomain name as defined in RFC 1123.
4337
/// Most resource types, e.g. a Pod, require such a compliant name.
4438
pub trait HasObjectName {
@@ -110,7 +104,7 @@ macro_rules! attributed_string_type {
110104
);
111105
};
112106
(@from_str $name:ident, $s:expr, is_object_name) => {
113-
stackable_operator::validation::is_rfc_1123_subdomain($s).context(InvalidObjectNameSnafu)?;
107+
stackable_operator::validation::is_lowercase_rfc_1123_subdomain($s).context(InvalidObjectNameSnafu)?;
114108
};
115109
(@from_str $name:ident, $s:expr, is_valid_label_value) => {
116110
LabelValue::from_str($s).context(InvalidLabelValueSnafu)?;

rust/operator-binary/src/framework/role_group_utils.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
use stackable_operator::validation::RFC_1123_SUBDOMAIN_MAX_LENGTH;
2+
13
use super::{ClusterName, RoleGroupName, RoleName};
2-
use crate::framework::{HasObjectName, MAX_OBJECT_NAME_LENGTH, kvp::label::MAX_LABEL_VALUE_LENGTH};
4+
use crate::framework::{HasObjectName, kvp::label::MAX_LABEL_VALUE_LENGTH};
35

46
pub struct ResourceNames {
57
pub cluster_name: ClusterName,
@@ -32,7 +34,7 @@ impl ResourceNames {
3234
pub fn role_group_config_map(&self) -> String {
3335
// Compile-time check
3436
const _: () = assert!(
35-
ResourceNames::MAX_QUALIFIED_ROLE_GROUP_NAME_LENGTH <= MAX_OBJECT_NAME_LENGTH,
37+
ResourceNames::MAX_QUALIFIED_ROLE_GROUP_NAME_LENGTH <= RFC_1123_SUBDOMAIN_MAX_LENGTH,
3638
"The ConfigMap name `<cluster_name>-<role_name>-<role_group_name>` must not exceed 253 characters."
3739
);
3840

@@ -69,7 +71,7 @@ impl ResourceNames {
6971
pub fn listener_service_name(&self) -> String {
7072
// Compile-time check
7173
const _: () = assert!(
72-
ResourceNames::MAX_QUALIFIED_ROLE_GROUP_NAME_LENGTH <= MAX_OBJECT_NAME_LENGTH,
74+
ResourceNames::MAX_QUALIFIED_ROLE_GROUP_NAME_LENGTH <= RFC_1123_SUBDOMAIN_MAX_LENGTH,
7375
"The listener name `<cluster_name>-<role_name>-<role_group_name>` must not exceed 253 characters."
7476
);
7577

rust/operator-binary/src/framework/role_utils.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@ use stackable_operator::{
99
k8s_openapi::{DeepMerge, api::core::v1::PodTemplateSpec},
1010
role_utils::{CommonConfiguration, Role, RoleGroup},
1111
schemars::JsonSchema,
12+
validation::RFC_1123_SUBDOMAIN_MAX_LENGTH,
1213
};
1314

1415
use super::{ProductName, builder::pod::container::EnvVarSet};
15-
use crate::framework::{ClusterName, MAX_OBJECT_NAME_LENGTH, kvp::label::MAX_LABEL_VALUE_LENGTH};
16+
use crate::framework::{ClusterName, kvp::label::MAX_LABEL_VALUE_LENGTH};
1617

1718
#[derive(Clone, Debug, Default, Deserialize, JsonSchema, PartialEq, Serialize)]
1819
pub struct GenericProductSpecificCommonConfig {}
@@ -166,7 +167,7 @@ impl ResourceNames {
166167

167168
// Compile-time check
168169
const _: () = assert!(
169-
ClusterName::MAX_LENGTH + SUFFIX.len() <= MAX_OBJECT_NAME_LENGTH,
170+
ClusterName::MAX_LENGTH + SUFFIX.len() <= RFC_1123_SUBDOMAIN_MAX_LENGTH,
170171
"The ServiceAccount name `<cluster_name>-serviceaccount` must not exceed 253 characters."
171172
);
172173

0 commit comments

Comments
 (0)