Skip to content

Commit 1742f57

Browse files
Rename ValidatedSecurity::config to settings
1 parent 62548be commit 1742f57

5 files changed

Lines changed: 12 additions & 12 deletions

File tree

rust/operator-binary/src/controller.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ impl ValidatedLogging {
184184
#[derive(Clone, Debug, PartialEq)]
185185
pub struct ValidatedSecurity {
186186
pub managing_role_group: Option<RoleGroupName>,
187-
pub config: v1alpha1::SecurityConfig,
187+
pub settings: v1alpha1::SecurityConfig,
188188
pub tls: v1alpha1::OpenSearchTls,
189189
}
190190

@@ -577,7 +577,7 @@ mod tests {
577577
.into(),
578578
Some(ValidatedSecurity {
579579
managing_role_group: None,
580-
config: v1alpha1::SecurityConfig::default(),
580+
settings: v1alpha1::SecurityConfig::default(),
581581
tls: v1alpha1::OpenSearchTls::default(),
582582
}),
583583
vec![],

rust/operator-binary/src/controller/build/node_config.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,9 +242,9 @@ impl NodeConfig {
242242
if let Some(security) = &self.cluster.security {
243243
config.insert(
244244
CONFIG_OPTION_PLUGINS_SECURITY_ALLOW_DEFAULT_INIT_SECURITYINDEX.to_owned(),
245-
json!(security.config.is_only_managed_by_api()),
245+
json!(security.settings.is_only_managed_by_api()),
246246
);
247-
if !security.config.is_only_managed_by_api() {
247+
if !security.settings.is_only_managed_by_api() {
248248
config.insert(
249249
CONFIG_OPTION_PLUGINS_SECURITY_AUTHCZ_ADMIN_DN.to_owned(),
250250
json!(self.super_admin_dn()),
@@ -628,7 +628,7 @@ mod tests {
628628
.into(),
629629
Some(ValidatedSecurity {
630630
managing_role_group: Some(RoleGroupName::from_str_unsafe("default")),
631-
config: v1alpha1::SecurityConfig {
631+
settings: v1alpha1::SecurityConfig {
632632
config: v1alpha1::SecurityConfigFileType {
633633
managed_by: v1alpha1::SecurityConfigFileTypeManagedBy::Operator,
634634
content: v1alpha1::SecurityConfigFileTypeContent::ValueFrom(

rust/operator-binary/src/controller/build/role_builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ mod tests {
429429
.into(),
430430
Some(ValidatedSecurity {
431431
managing_role_group: None,
432-
config: v1alpha1::SecurityConfig::default(),
432+
settings: v1alpha1::SecurityConfig::default(),
433433
tls: v1alpha1::OpenSearchTls::default(),
434434
}),
435435
vec![],

rust/operator-binary/src/controller/build/role_group_builder.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ impl<'a> RoleGroupBuilder<'a> {
211211
&& self.security_managing_container(security).is_some()
212212
{
213213
for file_type in SecurityConfigFileType::iter() {
214-
if let Some(value) = security.config.value(file_type) {
214+
if let Some(value) = security.settings.value(file_type) {
215215
data.insert(file_type.filename(), value.to_string());
216216
}
217217
}
@@ -442,7 +442,7 @@ impl<'a> RoleGroupBuilder<'a> {
442442

443443
if self.security_managing_container(security).is_some() {
444444
volumes.extend(RoleGroupBuilder::security_config_volumes(
445-
&security.config,
445+
&security.settings,
446446
self.resource_names.role_group_config_map(),
447447
));
448448
}
@@ -737,7 +737,7 @@ cp --archive config/opensearch.keystore {OPENSEARCH_INITIALIZED_KEYSTORE_DIRECTO
737737
);
738738

739739
for file_type in SecurityConfigFileType::iter() {
740-
let managed_by_operator = security.config.security_config(file_type).managed_by
740+
let managed_by_operator = security.settings.security_config(file_type).managed_by
741741
== v1alpha1::SecurityConfigFileTypeManagedBy::Operator;
742742

743743
env_vars = env_vars.with_value(
@@ -1332,7 +1332,7 @@ mod tests {
13321332
.into(),
13331333
Some(ValidatedSecurity {
13341334
managing_role_group: None,
1335-
config: v1alpha1::SecurityConfig::default(),
1335+
settings: v1alpha1::SecurityConfig::default(),
13361336
tls: v1alpha1::OpenSearchTls::default(),
13371337
}),
13381338
vec![v1alpha1::OpenSearchKeystore {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ fn validate_security_config(
313313

314314
Some(ValidatedSecurity {
315315
managing_role_group,
316-
config: spec.cluster_config.security.settings.clone(),
316+
settings: spec.cluster_config.security.settings.clone(),
317317
tls: spec.cluster_config.tls.clone(),
318318
})
319319
} else {
@@ -659,7 +659,7 @@ mod tests {
659659
.into(),
660660
Some(ValidatedSecurity {
661661
managing_role_group: Some(RoleGroupName::from_str_unsafe("default")),
662-
config: v1alpha1::SecurityConfig {
662+
settings: v1alpha1::SecurityConfig {
663663
config: v1alpha1::SecurityConfigFileType {
664664
managed_by: v1alpha1::SecurityConfigFileTypeManagedBy::Operator,
665665
content: v1alpha1::SecurityConfigFileTypeContent::ValueFrom(

0 commit comments

Comments
 (0)