Skip to content

Commit 815d243

Browse files
committed
mount tls volume in default directory of official image
1 parent 97681a3 commit 815d243

3 files changed

Lines changed: 22 additions & 22 deletions

File tree

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -183,15 +183,15 @@ impl NodeConfig {
183183
);
184184
config.insert(
185185
CONFIG_OPTION_PLUGINS_SECURITY_SSL_HTTP_PEMCERT_FILEPATH.to_owned(),
186-
json!("/stackable/tls/tls.crt".to_string()),
186+
json!("${OPENSEARCH_HOME}/config/tls/tls.crt".to_string()),
187187
);
188188
config.insert(
189189
CONFIG_OPTION_PLUGINS_SECURITY_SSL_HTTP_PEMKEY_FILEPATH.to_owned(),
190-
json!("/stackable/tls/tls.key".to_string()),
190+
json!("${OPENSEARCH_HOME}/config/tls/tls.key".to_string()),
191191
);
192192
config.insert(
193193
CONFIG_OPTION_PLUGINS_SECURITY_SSL_HTTP_PEMTRUSTEDCAS_FILEPATH.to_owned(),
194-
json!("/stackable/tls/ca.crt".to_string()),
194+
json!("${OPENSEARCH_HOME}/config/tls/ca.crt".to_string()),
195195
);
196196
// TLS config for TRANSPORT port
197197
config.insert(
@@ -200,15 +200,15 @@ impl NodeConfig {
200200
);
201201
config.insert(
202202
CONFIG_OPTION_PLUGINS_SECURITY_SSL_TRANSPORT_PEMCERT_FILEPATH.to_owned(),
203-
json!("/stackable/tls/tls.crt".to_string()),
203+
json!("${OPENSEARCH_HOME}/config/tls/tls.crt".to_string()),
204204
);
205205
config.insert(
206206
CONFIG_OPTION_PLUGINS_SECURITY_SSL_TRANSPORT_PEMKEY_FILEPATH.to_owned(),
207-
json!("/stackable/tls/tls.key".to_string()),
207+
json!("${OPENSEARCH_HOME}/config/tls/tls.key".to_string()),
208208
);
209209
config.insert(
210210
CONFIG_OPTION_PLUGINS_SECURITY_SSL_TRANSPORT_PEMTRUSTEDCAS_FILEPATH.to_owned(),
211-
json!("/stackable/tls/ca.crt".to_string()),
211+
json!("${OPENSEARCH_HOME}/config/tls/ca.crt".to_string()),
212212
);
213213

214214
config

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ constant!(DATA_VOLUME_NAME: VolumeName = "data");
7171

7272
constant!(LISTENER_VOLUME_NAME: PersistentVolumeClaimName = "listener");
7373
const LISTENER_VOLUME_DIR: &str = "/stackable/listener";
74+
7475
constant!(TLS_VOLUME_NAME: VolumeName = "tls");
75-
const TLS_VOLUME_DIR: &str = "/stackable/tls";
7676

7777
constant!(LOG_VOLUME_NAME: VolumeName = "log");
7878
const LOG_VOLUME_DIR: &str = "/stackable/log";
@@ -461,7 +461,7 @@ impl<'a> RoleGroupBuilder<'a> {
461461

462462
if self.cluster.cluster_config.tls.secret_class.is_some() {
463463
volume_mounts.push(VolumeMount {
464-
mount_path: TLS_VOLUME_DIR.to_owned(),
464+
mount_path: format!("{opensearch_home}/config/tls"),
465465
name: TLS_VOLUME_NAME.to_string(),
466466
..VolumeMount::default()
467467
})

tests/templates/kuttl/smoke/10-assert.yaml.j2

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ spec:
169169
name: listener
170170
- mountPath: /stackable/log
171171
name: log
172-
- mountPath: /stackable/tls
172+
- mountPath: {{ test_scenario['values']['opensearch_home'] }}/config/tls
173173
name: tls
174174
- mountPath: {{ test_scenario['values']['opensearch_home'] }}/config/opensearch-security
175175
name: security-config
@@ -480,7 +480,7 @@ spec:
480480
name: listener
481481
- mountPath: /stackable/log
482482
name: log
483-
- mountPath: /stackable/tls
483+
- mountPath: {{ test_scenario['values']['opensearch_home'] }}/config/tls
484484
name: tls
485485
- mountPath: {{ test_scenario['values']['opensearch_home'] }}/config/opensearch-security
486486
name: security-config
@@ -654,13 +654,13 @@ data:
654654
plugins.security.allow_default_init_securityindex: "true"
655655
plugins.security.nodes_dn: ["CN=generated certificate for pod"]
656656
plugins.security.ssl.http.enabled: "true"
657-
plugins.security.ssl.http.pemcert_filepath: "/stackable/tls/tls.crt"
658-
plugins.security.ssl.http.pemkey_filepath: "/stackable/tls/tls.key"
659-
plugins.security.ssl.http.pemtrustedcas_filepath: "/stackable/tls/ca.crt"
657+
plugins.security.ssl.http.pemcert_filepath: "${OPENSEARCH_HOME}/config/tls/tls.crt"
658+
plugins.security.ssl.http.pemkey_filepath: "${OPENSEARCH_HOME}/config/tls/tls.key"
659+
plugins.security.ssl.http.pemtrustedcas_filepath: "${OPENSEARCH_HOME}/config/tls/ca.crt"
660660
plugins.security.ssl.transport.enabled: "true"
661-
plugins.security.ssl.transport.pemcert_filepath: "/stackable/tls/tls.crt"
662-
plugins.security.ssl.transport.pemkey_filepath: "/stackable/tls/tls.key"
663-
plugins.security.ssl.transport.pemtrustedcas_filepath: "/stackable/tls/ca.crt"
661+
plugins.security.ssl.transport.pemcert_filepath: "${OPENSEARCH_HOME}/config/tls/tls.crt"
662+
plugins.security.ssl.transport.pemkey_filepath: "${OPENSEARCH_HOME}/config/tls/tls.key"
663+
plugins.security.ssl.transport.pemtrustedcas_filepath: "${OPENSEARCH_HOME}/config/tls/ca.crt"
664664
---
665665
apiVersion: v1
666666
kind: ConfigMap
@@ -689,13 +689,13 @@ data:
689689
plugins.security.allow_default_init_securityindex: "true"
690690
plugins.security.nodes_dn: ["CN=generated certificate for pod"]
691691
plugins.security.ssl.http.enabled: "true"
692-
plugins.security.ssl.http.pemcert_filepath: "/stackable/tls/tls.crt"
693-
plugins.security.ssl.http.pemkey_filepath: "/stackable/tls/tls.key"
694-
plugins.security.ssl.http.pemtrustedcas_filepath: "/stackable/tls/ca.crt"
692+
plugins.security.ssl.http.pemcert_filepath: "${OPENSEARCH_HOME}/config/tls/tls.crt"
693+
plugins.security.ssl.http.pemkey_filepath: "${OPENSEARCH_HOME}/config/tls/tls.key"
694+
plugins.security.ssl.http.pemtrustedcas_filepath: "${OPENSEARCH_HOME}/config/tls/ca.crt"
695695
plugins.security.ssl.transport.enabled: "true"
696-
plugins.security.ssl.transport.pemcert_filepath: "/stackable/tls/tls.crt"
697-
plugins.security.ssl.transport.pemkey_filepath: "/stackable/tls/tls.key"
698-
plugins.security.ssl.transport.pemtrustedcas_filepath: "/stackable/tls/ca.crt"
696+
plugins.security.ssl.transport.pemcert_filepath: "${OPENSEARCH_HOME}/config/tls/tls.crt"
697+
plugins.security.ssl.transport.pemkey_filepath: "${OPENSEARCH_HOME}/config/tls/tls.key"
698+
plugins.security.ssl.transport.pemtrustedcas_filepath: "${OPENSEARCH_HOME}/config/tls/ca.crt"
699699
---
700700
apiVersion: v1
701701
kind: Service

0 commit comments

Comments
 (0)