Skip to content

Commit fa490a0

Browse files
chore: Remove dependency to indoc
1 parent 242ec8b commit fa490a0

7 files changed

Lines changed: 155 additions & 159 deletions

File tree

Cargo.lock

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

Cargo.nix

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

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git",
1515
built = { version = "0.8.0", features = ["chrono", "git2"] }
1616
clap = "4.5"
1717
futures = { version = "0.3", features = ["compat"] }
18-
indoc = "2.0"
1918
json-patch = { version = "4.2", features = ["schemars"] }
2019
pretty_assertions = "1.4"
2120
regex = "1.11"

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: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,5 @@ uuid.workspace = true
2929
built.workspace = true
3030

3131
[dev-dependencies]
32-
indoc.workspace = true
3332
pretty_assertions.workspace = true
3433
rstest.workspace = true

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

Lines changed: 4 additions & 134 deletions
Original file line numberDiff line numberDiff line change
@@ -916,140 +916,10 @@ mod tests {
916916

917917
impl RoundtripTestData for v1alpha1::OpenSearchClusterSpec {
918918
fn roundtrip_test_data() -> Vec<Self> {
919-
stackable_operator::utils::yaml_from_str_singleton_map(indoc::indoc! {r#"
920-
- image:
921-
productVersion: 3.4.0
922-
pullPolicy: IfNotPresent
923-
clusterOperation:
924-
reconciliationPaused: false
925-
stopped: false
926-
clusterConfig:
927-
keystore:
928-
- key: s3.client.default.access_key
929-
secretKeyRef:
930-
name: s3-credentials
931-
key: ACCESS_KEY
932-
- key: s3.client.default.secret_key
933-
secretKeyRef:
934-
name: s3-credentials
935-
key: SECRET_KEY
936-
security:
937-
enabled: true
938-
managingRoleGroup: security-coord
939-
settings:
940-
config:
941-
managedBy: operator
942-
content:
943-
value:
944-
_meta:
945-
type: config
946-
config_version: 2
947-
config:
948-
dynamic:
949-
authc:
950-
basic_internal_auth_domain:
951-
description: Authenticate via HTTP Basic against internal users database
952-
http_enabled: true
953-
transport_enabled: true
954-
order: 1
955-
http_authenticator:
956-
type: basic
957-
challenge: true
958-
authentication_backend:
959-
type: intern
960-
authz: {}
961-
internalUsers:
962-
managedBy: API
963-
content:
964-
valueFrom:
965-
secretKeyRef:
966-
name: opensearch-security-config
967-
key: internal_users.yml
968-
roles:
969-
managedBy: API
970-
content:
971-
valueFrom:
972-
configMapKeyRef:
973-
name: opensearch-security-config
974-
key: roles.yml
975-
rolesMapping:
976-
managedBy: API
977-
content:
978-
value:
979-
_meta:
980-
type: rolesmapping
981-
config_version: 2
982-
all_access:
983-
reserved: false
984-
backend_roles:
985-
- admin
986-
tls:
987-
serverSecretClass: tls
988-
internalSecretClass: tls
989-
vectorAggregatorConfigMapName: vector-aggregator-discovery
990-
nodes:
991-
config:
992-
logging:
993-
enableVectorAgent: true
994-
gracefulShutdownTimeout: 2m
995-
requestedSecretLifetime: 1d
996-
envOverrides:
997-
DISABLE_INSTALL_DEMO_CONFIG: "true"
998-
OPENSEARCH_HOME: /stackable/opensearch
999-
configOverrides:
1000-
opensearch.yml:
1001-
jsonMergePatch:
1002-
node.store.allow_mmap: false
1003-
cluster.routing.allocation.disk.threshold_enabled: false
1004-
roleConfig:
1005-
discoveryServiceListenerClass: external-unstable
1006-
roleGroups:
1007-
cluster-manager:
1008-
config:
1009-
discoveryServiceExposed: true
1010-
nodeRoles:
1011-
- cluster_manager
1012-
resources:
1013-
storage:
1014-
data:
1015-
capacity: 100Mi
1016-
replicas: 3
1017-
data:
1018-
config:
1019-
discoveryServiceExposed: false
1020-
nodeRoles:
1021-
- ingest
1022-
- data
1023-
- remote_cluster_client
1024-
listenerClass: cluster-internal
1025-
resources:
1026-
storage:
1027-
data:
1028-
capacity: 2Gi
1029-
configOverrides:
1030-
opensearch.yml:
1031-
jsonMergePatch:
1032-
node.attr.zone: eu-central-1a
1033-
envOverrides:
1034-
OPENSEARCH_JAVA_OPTS: -Xms1g -Xmx1g
1035-
replicas: 2
1036-
- image:
1037-
custom: oci.example.com/namespace/opensearch:3.4.0-custom
1038-
productVersion: 3.4.0
1039-
pullPolicy: Always
1040-
pullSecrets:
1041-
- name: registry-credentials
1042-
clusterConfig:
1043-
tls:
1044-
serverSecretClass: null
1045-
security:
1046-
enabled: false
1047-
nodes:
1048-
roleGroups:
1049-
default:
1050-
replicas: 1
1051-
"#})
1052-
.expect("Failed to parse OpenSearchClusterSpec YAML")
919+
serde_yaml::Deserializer::from_str(include_str!("roundtrip_test_data.yaml"))
920+
.map(serde_yaml::with::singleton_map_recursive::deserialize)
921+
.collect::<Result<_, _>>()
922+
.expect("roundtrip_test_data.yaml should contain OpenSearchClusterSpec documents")
1053923
}
1054924
}
1055925
}

0 commit comments

Comments
 (0)