@@ -30,7 +30,7 @@ use validate::validate;
3030use crate :: {
3131 crd:: {
3232 NodeRoles ,
33- v1alpha1:: { self } ,
33+ v1alpha1:: { self , OpenSearchKeystore } ,
3434 } ,
3535 framework:: {
3636 ClusterName , ControllerName , HasName , HasUid , ListenerClassName , NameIsValidLabelValue ,
@@ -166,9 +166,11 @@ pub struct ValidatedCluster {
166166 pub uid : Uid ,
167167 pub role_config : GenericRoleConfig ,
168168 pub role_group_configs : BTreeMap < RoleGroupName , OpenSearchRoleGroupConfig > ,
169+ pub keystores : Vec < OpenSearchKeystore > ,
169170}
170171
171172impl ValidatedCluster {
173+ #[ allow( clippy:: too_many_arguments) ]
172174 pub fn new (
173175 image : ResolvedProductImage ,
174176 product_version : ProductVersion ,
@@ -177,6 +179,7 @@ impl ValidatedCluster {
177179 uid : impl Into < Uid > ,
178180 role_config : GenericRoleConfig ,
179181 role_group_configs : BTreeMap < RoleGroupName , OpenSearchRoleGroupConfig > ,
182+ keystores : Vec < OpenSearchKeystore > ,
180183 ) -> Self {
181184 let uid = uid. into ( ) ;
182185 ValidatedCluster {
@@ -193,6 +196,7 @@ impl ValidatedCluster {
193196 uid,
194197 role_config,
195198 role_group_configs,
199+ keystores,
196200 }
197201 }
198202
@@ -378,10 +382,13 @@ mod tests {
378382 use super :: { Context , OpenSearchRoleGroupConfig , ValidatedCluster , ValidatedLogging } ;
379383 use crate :: {
380384 controller:: { OpenSearchNodeResources , ValidatedOpenSearchConfig } ,
381- crd:: { NodeRoles , v1alpha1} ,
385+ crd:: {
386+ NodeRoles ,
387+ v1alpha1:: { self , OpenSearchKeystore , SecretKeyRef } ,
388+ } ,
382389 framework:: {
383390 ClusterName , ListenerClassName , NamespaceName , OperatorName , ProductVersion ,
384- RoleGroupName , builder:: pod:: container:: EnvVarSet ,
391+ RoleGroupName , SecretKey , SecretName , builder:: pod:: container:: EnvVarSet ,
385392 product_logging:: framework:: ValidatedContainerLogConfigChoice ,
386393 role_utils:: GenericProductSpecificCommonConfig ,
387394 } ,
@@ -494,6 +501,13 @@ mod tests {
494501 ) ,
495502 ]
496503 . into ( ) ,
504+ vec ! [ OpenSearchKeystore {
505+ key: "Keystore1" . to_string( ) ,
506+ secret_key_ref: SecretKeyRef {
507+ name: SecretName :: from_str_unsafe( "my-keystore-secret" ) ,
508+ key: SecretKey :: from_str_unsafe( "my-keystore-file" ) ,
509+ } ,
510+ } ] ,
497511 )
498512 }
499513
0 commit comments