33//! config file; the shared [`stackable_operator::v2::config_file_writer`]
44//! module serializes maps to the Hadoop-XML / Java-properties on-wire format.
55
6+ use crate :: container:: { TLS_STORE_DIR , TLS_STORE_PASSWORD } ;
7+
68pub mod core_site;
79pub mod hadoop_policy;
810pub mod hdfs_site;
@@ -11,6 +13,22 @@ pub mod security_properties;
1113pub mod ssl_client;
1214pub mod ssl_server;
1315
16+ /// The `<prefix>.truststore.*` entries (location, type, password) injected into
17+ /// `ssl-client.xml` / `ssl-server.xml` when HTTPS is enabled.
18+ fn truststore_entries ( prefix : & str ) -> [ ( String , String ) ; 3 ] {
19+ [
20+ (
21+ format ! ( "{prefix}.truststore.location" ) ,
22+ format ! ( "{TLS_STORE_DIR}/truststore.p12" ) ,
23+ ) ,
24+ ( format ! ( "{prefix}.truststore.type" ) , "pkcs12" . to_string ( ) ) ,
25+ (
26+ format ! ( "{prefix}.truststore.password" ) ,
27+ TLS_STORE_PASSWORD . to_string ( ) ,
28+ ) ,
29+ ]
30+ }
31+
1432/// The names of the HDFS config files assembled into the rolegroup `ConfigMap`.
1533#[ derive( Clone , Copy , Debug , strum:: Display ) ]
1634pub enum ConfigFileName {
@@ -53,9 +71,17 @@ pub(crate) mod test_support {
5371 } ;
5472
5573 use crate :: {
56- controller:: validate:: validate_cluster, crd:: v1alpha1, hdfs_controller:: ValidatedCluster ,
74+ controller:: { ValidatedCluster , validate:: validate_cluster} ,
75+ crd:: v1alpha1,
5776 } ;
5877
78+ /// The rendered output of an empty Hadoop-XML configuration (no entries).
79+ pub const EMPTY_HADOOP_XML : & str = concat ! (
80+ "<?xml version=\" 1.0\" ?>\n " ,
81+ "<configuration>\n " ,
82+ "</configuration>"
83+ ) ;
84+
5985 /// A minimal three-role HdfsCluster used to drive the per-file builder tests.
6086 pub const MINIMAL_HDFS_YAML : & str = r#"
6187---
0 commit comments