Skip to content

Commit 1f0719d

Browse files
committed
chore: Replace serde_yaml with yaml_serde
1 parent 2f08dc2 commit 1f0719d

11 files changed

Lines changed: 896 additions & 684 deletions

File tree

‎Cargo.lock‎

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

‎Cargo.nix‎

Lines changed: 546 additions & 383 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/hbase-operator"
1111

1212
[workspace.dependencies]
13-
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.119.0", features = ["crds", "webhook"] }
13+
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.121.0", features = ["crds", "webhook"] }
1414

1515
anyhow = "1.0"
1616
built = { version = "0.8", features = ["chrono", "git2"] }
@@ -23,12 +23,12 @@ rstest = "0.26"
2323
semver = "1.0"
2424
serde = { version = "1.0", features = ["derive"] }
2525
serde_json = "1.0"
26-
serde_yaml = "0.9"
2726
shell-escape = "0.1"
2827
snafu = "0.9"
2928
strum = { version = "0.28", features = ["derive"] }
3029
tokio = { version = "1.53", features = ["full"] }
3130
tracing = "0.1"
31+
yaml_serde = "0.10"
3232

3333
[patch."https://github.com/stackabletech/operator-rs.git"]
3434
# stackable-operator = { git = "https://github.com/stackabletech//operator-rs.git", branch = "main" }

‎crate-hashes.json‎

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

‎rust/operator-binary/Cargo.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ built.workspace = true
3131

3232
[dev-dependencies]
3333
rstest.workspace = true
34-
serde_yaml.workspace = true
34+
yaml_serde.workspace = true

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,9 +357,8 @@ spec:
357357
replicas: 1
358358
"#};
359359

360-
let deserializer = serde_yaml::Deserializer::from_str(input);
361360
let hbase: v1alpha1::HbaseCluster =
362-
serde_yaml::with::singleton_map_recursive::deserialize(deserializer).unwrap();
361+
stackable_operator::utils::yaml_from_str_singleton_map(input).unwrap();
363362

364363
let role = hbase.spec.masters.as_ref().unwrap();
365364
let role_group = role.role_groups.get("default").unwrap();

‎rust/operator-binary/src/crd/affinity.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ mod tests {
155155
replicas: 1
156156
"#;
157157
let hbase: v1alpha1::HbaseCluster =
158-
serde_yaml::from_str(input).expect("illegal test input");
158+
yaml_serde::from_str(input).expect("illegal test input");
159159
let validated_cluster = crate::test_utils::validated_cluster_from(&hbase);
160160
let affinity = crate::test_utils::merged_config(&validated_cluster, &role)
161161
.affinity()

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -674,9 +674,8 @@ spec:
674674
additionalMoverOptions: ["--some", "extra"]
675675
"#};
676676

677-
let deserializer = serde_yaml::Deserializer::from_str(input);
678677
let hbase: v1alpha1::HbaseCluster =
679-
serde_yaml::with::singleton_map_recursive::deserialize(deserializer).unwrap();
678+
stackable_operator::utils::yaml_from_str_singleton_map(input).unwrap();
680679

681680
let validated_cluster = crate::test_utils::validated_cluster_from(&hbase);
682681
let merged_config = crate::test_utils::merged_config_for(

‎rust/operator-binary/src/crd/security.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ mod tests {
4545
#[test]
4646
fn authorization_without_opa_is_valid() {
4747
// `opa` is optional (matching the hive template), so an empty `authorization` deserializes.
48-
let config: AuthorizationConfig = serde_yaml::from_str("{}").expect("empty authorization");
48+
let config: AuthorizationConfig = yaml_serde::from_str("{}").expect("empty authorization");
4949
assert!(config.opa.is_none());
5050
}
5151

@@ -57,7 +57,7 @@ mod tests {
5757
package: hbase
5858
"};
5959
let config: AuthorizationConfig =
60-
serde_yaml::from_str(yaml).expect("authorization with opa");
60+
yaml_serde::from_str(yaml).expect("authorization with opa");
6161
assert!(config.opa.is_some());
6262
}
6363
}

‎rust/operator-binary/src/hbase_controller.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ mod tests {
148148
/// API, and because the spec is invalid, before the [`DeserializeGuard`] is unwrapped.
149149
#[tokio::test]
150150
async fn reconcile_exits_early_for_deleted_cluster() {
151-
let hbase = serde_yaml::from_str(indoc! {r#"
151+
let hbase = yaml_serde::from_str(indoc! {r#"
152152
---
153153
apiVersion: hbase.stackable.tech/v1alpha1
154154
kind: HbaseCluster

0 commit comments

Comments
 (0)