-
-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathzk_controller.rs
More file actions
693 lines (618 loc) · 23.1 KB
/
Copy pathzk_controller.rs
File metadata and controls
693 lines (618 loc) · 23.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
//! Ensures that `Pod`s are configured and running for each [`v1alpha1::ZookeeperCluster`]
use std::{hash::Hasher, str::FromStr, sync::Arc};
use const_format::concatcp;
use fnv::FnvHasher;
use snafu::{OptionExt, ResultExt, Snafu};
use stackable_operator::{
cli::OperatorEnvironmentOptions,
cluster_resources::ClusterResourceApplyStrategy,
commons::rbac::build_rbac_resources,
crd::listener::v1alpha1::Listener,
k8s_openapi::api::{
apps::v1::StatefulSet,
core::v1::{ConfigMap, Service},
policy::v1::PodDisruptionBudget,
},
kube::{
api::DynamicObject,
core::{DeserializeGuard, error_boundary},
runtime::controller,
},
kvp::LabelError,
logging::controller::ReconcilerError,
shared::time::Duration,
status::condition::{
compute_conditions, operations::ClusterOperationsConditionBuilder,
statefulset::StatefulSetConditionBuilder,
},
v2::{cluster_resources::cluster_resources_new, types::operator::ControllerName},
};
use strum::{EnumDiscriminants, IntoStaticStr};
use crate::{
APP_NAME, OPERATOR_NAME, ObjectRef,
crd::v1alpha1,
zk_controller::{
build::resource::discovery,
validate::{operator_name, product_name},
},
};
pub(crate) mod build;
mod dereference;
pub(crate) mod validate;
pub const ZK_CONTROLLER_NAME: &str = "zookeepercluster";
pub const ZK_FULL_CONTROLLER_NAME: &str = concatcp!(ZK_CONTROLLER_NAME, '.', OPERATOR_NAME);
pub const LISTENER_VOLUME_NAME: &str = "listener";
pub const LISTENER_VOLUME_DIR: &str = "/stackable/listener";
pub struct Ctx {
pub client: stackable_operator::client::Client,
pub operator_environment: OperatorEnvironmentOptions,
}
type Result<T, E = Error> = std::result::Result<T, E>;
#[derive(Snafu, Debug, EnumDiscriminants)]
#[strum_discriminants(derive(IntoStaticStr))]
pub enum Error {
#[snafu(display("ZookeeperCluster object is invalid"))]
InvalidZookeeperCluster {
source: error_boundary::InvalidObject,
},
#[snafu(display("failed to dereference resources"))]
Dereference { source: dereference::Error },
#[snafu(display("failed to validate cluster"))]
ValidateCluster { source: validate::Error },
#[snafu(display("crd validation failure"))]
CrdValidationFailure { source: crate::crd::Error },
#[snafu(display("internal operator failure"))]
InternalOperatorFailure { source: crate::crd::Error },
#[snafu(display("failed to build the Kubernetes resources"))]
BuildResources { source: build::Error },
#[snafu(display("failed to apply Kubernetes resource"))]
ApplyResource {
source: stackable_operator::cluster_resources::Error,
},
#[snafu(display("object is missing metadata to build owner reference"))]
ObjectMissingMetadataForOwnerRef {
source: stackable_operator::builder::meta::Error,
},
#[snafu(display(
"no role Listener was applied; the discovery ConfigMap is derived from the applied role Listener"
))]
NoRoleListener,
#[snafu(display("failed to build discovery ConfigMap"))]
BuildDiscoveryConfig { source: discovery::Error },
#[snafu(display("failed to apply discovery ConfigMap"))]
ApplyDiscoveryConfig {
source: stackable_operator::cluster_resources::Error,
},
#[snafu(display("failed to update status"))]
ApplyStatus {
source: stackable_operator::client::Error,
},
#[snafu(display("failed to create RBAC service account"))]
ApplyServiceAccount {
source: stackable_operator::cluster_resources::Error,
},
#[snafu(display("failed to create RBAC role binding"))]
ApplyRoleBinding {
source: stackable_operator::cluster_resources::Error,
},
#[snafu(display("failed to build RBAC resources"))]
BuildRbacResources {
source: stackable_operator::commons::rbac::Error,
},
#[snafu(display("failed to delete orphaned resources"))]
DeleteOrphans {
source: stackable_operator::cluster_resources::Error,
},
#[snafu(display("failed to build label"))]
BuildLabel { source: LabelError },
#[snafu(display("failed to build object meta data"))]
ObjectMeta {
source: stackable_operator::builder::meta::Error,
},
}
impl ReconcilerError for Error {
fn category(&self) -> &'static str {
ErrorDiscriminants::from(self).into()
}
fn secondary_object(&self) -> Option<ObjectRef<DynamicObject>> {
match self {
Error::InvalidZookeeperCluster { .. } => None,
Error::Dereference { .. } => None,
Error::ValidateCluster { .. } => None,
Error::CrdValidationFailure { .. } => None,
Error::InternalOperatorFailure { .. } => None,
Error::BuildResources { .. } => None,
Error::ApplyResource { .. } => None,
Error::ObjectMissingMetadataForOwnerRef { .. } => None,
Error::NoRoleListener => None,
Error::BuildDiscoveryConfig { .. } => None,
Error::ApplyDiscoveryConfig { .. } => None,
Error::ApplyStatus { .. } => None,
Error::ApplyServiceAccount { .. } => None,
Error::ApplyRoleBinding { .. } => None,
Error::BuildRbacResources { .. } => None,
Error::DeleteOrphans { .. } => None,
Error::BuildLabel { .. } => None,
Error::ObjectMeta { .. } => None,
}
}
}
/// Every Kubernetes resource produced by the client-free [`build()`](build::build) step.
///
/// The discovery `ConfigMap` is deliberately absent — see [`build()`](build::build).
pub struct KubernetesResources {
pub stateful_sets: Vec<StatefulSet>,
pub services: Vec<Service>,
pub listeners: Vec<Listener>,
pub config_maps: Vec<ConfigMap>,
pub pod_disruption_budgets: Vec<PodDisruptionBudget>,
}
pub async fn reconcile_zk(
zk: Arc<DeserializeGuard<v1alpha1::ZookeeperCluster>>,
ctx: Arc<Ctx>,
) -> Result<controller::Action> {
tracing::info!("Starting reconcile");
let zk =
zk.0.as_ref()
.map_err(error_boundary::InvalidObject::clone)
.context(InvalidZookeeperClusterSnafu)?;
let client = &ctx.client;
// dereference (client required)
let dereferenced_objects = dereference::dereference(client, zk)
.await
.context(DereferenceSnafu)?;
// validate (no client required)
let validated_cluster =
validate::validate(zk, &dereferenced_objects, &ctx.operator_environment)
.context(ValidateClusterSnafu)?;
// Names are derived from compile-time constants.
let mut cluster_resources = cluster_resources_new(
&product_name(),
&operator_name(),
&ControllerName::from_str(ZK_CONTROLLER_NAME)
.expect("ZK_CONTROLLER_NAME should be a valid controller name"),
&validated_cluster.name,
&validated_cluster.namespace,
&validated_cluster.uid,
ClusterResourceApplyStrategy::from(&validated_cluster.cluster_operation),
&validated_cluster.object_overrides,
);
let (rbac_sa, rbac_rolebinding) = build_rbac_resources(
zk,
APP_NAME,
cluster_resources
.get_required_labels()
.context(BuildLabelSnafu)?,
)
.context(BuildRbacResourcesSnafu)?;
cluster_resources
.add(client, rbac_sa)
.await
.context(ApplyServiceAccountSnafu)?;
cluster_resources
.add(client, rbac_rolebinding)
.await
.context(ApplyRoleBindingSnafu)?;
let resources = build::build(&validated_cluster, &client.kubernetes_cluster_info)
.context(BuildResourcesSnafu)?;
let mut ss_cond_builder = StatefulSetConditionBuilder::default();
for service in resources.services {
cluster_resources
.add(client, service)
.await
.context(ApplyResourceSnafu)?;
}
// ZooKeeper has a single role Listener; the applied object feeds the discovery ConfigMap.
let mut applied_role_listener: Option<Listener> = None;
for listener in resources.listeners {
applied_role_listener = Some(
cluster_resources
.add(client, listener)
.await
.context(ApplyResourceSnafu)?,
);
}
let role_listener = applied_role_listener.context(NoRoleListenerSnafu)?;
for config_map in resources.config_maps {
cluster_resources
.add(client, config_map)
.await
.context(ApplyResourceSnafu)?;
}
for pdb in resources.pod_disruption_budgets {
cluster_resources
.add(client, pdb)
.await
.context(ApplyResourceSnafu)?;
}
// Note: The StatefulSet needs to be applied after all ConfigMaps and Secrets it mounts
// to prevent unnecessary Pod restarts.
// See https://github.com/stackabletech/commons-operator/issues/111 for details.
for statefulset in resources.stateful_sets {
ss_cond_builder.add(
cluster_resources
.add(client, statefulset)
.await
.context(ApplyResourceSnafu)?,
);
}
// std's SipHasher is deprecated, and DefaultHasher is unstable across Rust releases.
// We don't /need/ stability, but it's still nice to avoid spurious changes where possible.
let mut discovery_hash = FnvHasher::with_key(0);
let discovery_cm =
discovery::build_discovery_configmap(&validated_cluster, ZK_CONTROLLER_NAME, role_listener)
.context(BuildDiscoveryConfigSnafu)?;
let discovery_cm = cluster_resources
.add(client, discovery_cm)
.await
.context(ApplyDiscoveryConfigSnafu)?;
if let Some(generation) = discovery_cm.metadata.resource_version {
discovery_hash.write(generation.as_bytes())
}
let cluster_operation_cond_builder =
ClusterOperationsConditionBuilder::new(&zk.spec.cluster_operation);
let status = v1alpha1::ZookeeperClusterStatus {
// Serialize as a string to discourage users from trying to parse the value,
// and to keep things flexible if we end up changing the hasher at some point.
discovery_hash: Some(discovery_hash.finish().to_string()),
conditions: compute_conditions(zk, &[&ss_cond_builder, &cluster_operation_cond_builder]),
};
cluster_resources
.delete_orphaned_resources(client)
.await
.context(DeleteOrphansSnafu)?;
client
.apply_patch_status(OPERATOR_NAME, zk, &status)
.await
.context(ApplyStatusSnafu)?;
Ok(controller::Action::await_change())
}
pub fn error_policy(
_obj: Arc<DeserializeGuard<v1alpha1::ZookeeperCluster>>,
error: &Error,
_ctx: Arc<Ctx>,
) -> controller::Action {
match error {
// root object is invalid, will be requeued when modified anyway
Error::InvalidZookeeperCluster { .. } => controller::Action::await_change(),
_ => controller::Action::requeue(*Duration::from_secs(5)),
}
}
/// Shared helpers for building validated test clusters from minimal YAML fixtures.
#[cfg(test)]
pub(crate) mod test_support {
use stackable_operator::{
cli::OperatorEnvironmentOptions, commons::networking::DomainName,
utils::cluster_info::KubernetesClusterInfo,
};
use crate::{
crd::{authentication::DereferencedAuthenticationClasses, v1alpha1},
zk_controller::{
dereference::DereferencedObjects,
validate::{ValidatedCluster, validate},
},
};
/// Parses a minimal `ZookeeperCluster` test fixture, defaulting `namespace`/`uid` so the
/// validate step can build a [`ValidatedCluster`].
pub fn minimal_zk(yaml: &str) -> v1alpha1::ZookeeperCluster {
let mut zk: v1alpha1::ZookeeperCluster =
serde_yaml::from_str(yaml).expect("invalid test ZookeeperCluster YAML");
zk.metadata
.namespace
.get_or_insert_with(|| "default".to_owned());
zk.metadata
.uid
.get_or_insert_with(|| "c27b3971-ca72-42c1-80a4-abdfc1db0ddd".to_owned());
zk
}
pub fn cluster_info() -> KubernetesClusterInfo {
KubernetesClusterInfo {
cluster_domain: DomainName::try_from("cluster.local").expect("valid domain"),
}
}
fn operator_environment() -> OperatorEnvironmentOptions {
OperatorEnvironmentOptions {
operator_namespace: "stackable-operators".to_owned(),
operator_service_name: "zookeeper-operator".to_owned(),
image_repository: "oci.example.org".to_owned(),
}
}
/// Runs the real validate step against a minimal (auth-free) fixture, returning the result so
/// tests can assert on validation errors.
pub fn try_validate(
zk: &v1alpha1::ZookeeperCluster,
) -> Result<ValidatedCluster, super::validate::Error> {
validate(
zk,
&DereferencedObjects {
authentication_classes: DereferencedAuthenticationClasses::new_for_tests(),
},
&operator_environment(),
)
}
/// Runs the real validate step against a minimal (auth-free) fixture.
pub fn validated_cluster(zk: &v1alpha1::ZookeeperCluster) -> ValidatedCluster {
try_validate(zk).expect("validate should succeed for the test fixture")
}
}
#[cfg(test)]
mod tests {
use std::str::FromStr;
use stackable_operator::{
k8s_openapi::api::core::v1::ConfigMap, v2::types::operator::RoleGroupName,
};
use crate::{
crd::ZookeeperRole,
zk_controller::{
build::resource::config_map,
test_support::{cluster_info, minimal_zk, validated_cluster},
},
};
#[test]
fn test_default_config() {
let zookeeper_yaml = r#"
apiVersion: zookeeper.stackable.tech/v1alpha1
kind: ZookeeperCluster
metadata:
name: simple-zookeeper
spec:
image:
productVersion: "3.9.5"
servers:
roleGroups:
default:
replicas: 3
"#;
let cm = build_config_map(zookeeper_yaml).data.unwrap();
let config = cm.get("zoo.cfg").unwrap();
assert!(config.contains(
"authProvider.x509=org.apache.zookeeper.server.auth.X509AuthenticationProvider"
));
assert!(config.contains("ssl.hostnameVerification=true"));
// Default value
assert!(config.contains("ssl.quorum.hostnameVerification=true"));
assert!(cm.contains_key("security.properties"));
}
#[test]
fn test_config_overrides() {
let zookeeper_yaml = r#"
apiVersion: zookeeper.stackable.tech/v1alpha1
kind: ZookeeperCluster
metadata:
name: simple-zookeeper
spec:
image:
productVersion: "3.9.5"
servers:
configOverrides:
zoo.cfg:
foo: bar
level: role
hello-from-role: "true"
roleGroups:
default:
configOverrides:
zoo.cfg:
foo: bar
level: role-group
ssl.quorum.hostnameVerification: "false"
hello-from-role-group: "true"
replicas: 3
"#;
let cm = build_config_map(zookeeper_yaml).data.unwrap();
let config = cm.get("zoo.cfg").unwrap();
assert!(config.contains("foo=bar"));
assert!(config.contains("level=role-group"));
assert!(config.contains("hello-from-role=true"));
assert!(config.contains("hello-from-role-group=true"));
assert!(config.contains(
"authProvider.x509=org.apache.zookeeper.server.auth.X509AuthenticationProvider"
));
assert!(config.contains("ssl.hostnameVerification=true"));
// Overwritten by configOverride
assert!(config.contains("ssl.quorum.hostnameVerification=false"));
assert!(cm.contains_key("security.properties"));
}
#[test]
fn test_seeded_operator_defaults() {
// These values are seeded directly by the ConfigMap builder and must stay
// byte-identical (pinned by the kuttl snapshot
// `tests/templates/kuttl/smoke/14-assert.yaml.j2`).
let zookeeper_yaml = r#"
apiVersion: zookeeper.stackable.tech/v1alpha1
kind: ZookeeperCluster
metadata:
name: simple-zookeeper
spec:
image:
productVersion: "3.9.5"
servers:
roleGroups:
default:
replicas: 3
"#;
let cm = build_config_map(zookeeper_yaml).data.unwrap();
// `security.properties` is fully operator-injected; assert it byte-for-byte.
assert_eq!(
cm.get("security.properties").unwrap(),
"networkaddress.cache.negative.ttl=0\nnetworkaddress.cache.ttl=5\n"
);
let zoo_cfg = cm.get("zoo.cfg").unwrap();
for expected in [
"admin.serverPort=8080",
// new_for_tests() enables server TLS, so the secure client port is used.
"clientPort=2282",
"dataDir=/stackable/data",
"initLimit=5",
"syncLimit=2",
"tickTime=3000",
"metricsProvider.className=org.apache.zookeeper.metrics.prometheus.PrometheusMetricsProvider",
"metricsProvider.httpPort=7000",
] {
assert!(
zoo_cfg.contains(expected),
"missing {expected:?} in:\n{zoo_cfg}"
);
}
}
#[test]
fn test_user_config_overrides_seeded_default() {
// A value set on the typed config must win over the seeded default.
let zookeeper_yaml = r#"
apiVersion: zookeeper.stackable.tech/v1alpha1
kind: ZookeeperCluster
metadata:
name: simple-zookeeper
spec:
image:
productVersion: "3.9.5"
servers:
roleGroups:
default:
replicas: 3
config:
tickTime: 4000
initLimit: 7
"#;
let cm = build_config_map(zookeeper_yaml).data.unwrap();
let zoo_cfg = cm.get("zoo.cfg").unwrap();
assert!(zoo_cfg.contains("tickTime=4000"), "{zoo_cfg}");
assert!(zoo_cfg.contains("initLimit=7"), "{zoo_cfg}");
// Untouched default stays.
assert!(zoo_cfg.contains("syncLimit=2"), "{zoo_cfg}");
}
#[test]
fn test_non_tls_uses_insecure_client_port() {
// With server TLS disabled (`serverSecretClass: null`) the insecure client port is used and
// none of the server-TLS settings (keystore, port unification) are emitted. This exercises
// the non-TLS branch of `ZookeeperSecurity::{client_port, config_settings}`.
let zookeeper_yaml = r#"
apiVersion: zookeeper.stackable.tech/v1alpha1
kind: ZookeeperCluster
metadata:
name: simple-zookeeper
spec:
image:
productVersion: "3.9.5"
clusterConfig:
tls:
serverSecretClass: null
servers:
roleGroups:
default:
replicas: 3
"#;
let cm = build_config_map(zookeeper_yaml).data.unwrap();
let zoo_cfg = cm.get("zoo.cfg").unwrap();
assert!(zoo_cfg.contains("clientPort=2181"), "{zoo_cfg}");
assert!(!zoo_cfg.contains("client.portUnification"), "{zoo_cfg}");
// The server-TLS keystore line (distinct from the always-present quorum keystore).
assert!(!zoo_cfg.contains("ssl.keyStore.location"), "{zoo_cfg}");
}
#[test]
fn test_config_override_wins_over_typed_config() {
// The typed `config` sets `syncLimit`, but a `configOverride` for the same key must win
// (configOverrides are layered last in `zoo.cfg` precedence).
let zookeeper_yaml = r#"
apiVersion: zookeeper.stackable.tech/v1alpha1
kind: ZookeeperCluster
metadata:
name: simple-zookeeper
spec:
image:
productVersion: "3.9.5"
servers:
roleGroups:
default:
replicas: 3
config:
syncLimit: 9
configOverrides:
zoo.cfg:
syncLimit: "15"
"#;
let cm = build_config_map(zookeeper_yaml).data.unwrap();
let zoo_cfg = cm.get("zoo.cfg").unwrap();
assert!(zoo_cfg.contains("syncLimit=15"), "{zoo_cfg}");
}
#[test]
fn test_custom_log_config_omits_logback() {
// Automatic logging renders `logback.xml` into the ConfigMap; a custom log ConfigMap
// suppresses it (the `Custom` arm of `build_logback_config`).
let automatic_yaml = r#"
apiVersion: zookeeper.stackable.tech/v1alpha1
kind: ZookeeperCluster
metadata:
name: simple-zookeeper
spec:
image:
productVersion: "3.9.5"
servers:
roleGroups:
default:
replicas: 3
"#;
let automatic = build_config_map(automatic_yaml).data.unwrap();
assert!(automatic.contains_key("logback.xml"));
let custom_yaml = r#"
apiVersion: zookeeper.stackable.tech/v1alpha1
kind: ZookeeperCluster
metadata:
name: simple-zookeeper
spec:
image:
productVersion: "3.9.5"
servers:
roleGroups:
default:
replicas: 3
config:
logging:
containers:
zookeeper:
custom:
configMap: my-log-config
"#;
let custom = build_config_map(custom_yaml).data.unwrap();
assert!(!custom.contains_key("logback.xml"));
}
#[test]
fn test_vector_agent_adds_vector_config() {
// Enabling the Vector agent (with the required aggregator discovery ConfigMap) adds
// `vector.yaml` to the rolegroup ConfigMap.
let zookeeper_yaml = r#"
apiVersion: zookeeper.stackable.tech/v1alpha1
kind: ZookeeperCluster
metadata:
name: simple-zookeeper
spec:
image:
productVersion: "3.9.5"
clusterConfig:
vectorAggregatorConfigMapName: vector-aggregator-discovery
servers:
roleGroups:
default:
replicas: 3
config:
logging:
enableVectorAgent: true
"#;
let cm = build_config_map(zookeeper_yaml).data.unwrap();
assert!(cm.contains_key("vector.yaml"));
}
fn build_config_map(zookeeper_yaml: &str) -> ConfigMap {
let zookeeper = minimal_zk(zookeeper_yaml);
let validated_cluster = validated_cluster(&zookeeper);
let role_group_name = RoleGroupName::from_str("default").expect("valid role group name");
let rolegroup_config =
&validated_cluster.role_group_configs[&ZookeeperRole::Server][&role_group_name];
config_map::build_server_rolegroup_config_map(
&validated_cluster,
&cluster_info(),
&role_group_name,
rolegroup_config,
)
.unwrap()
}
}