Skip to content

Commit 268cd4c

Browse files
fix: Support the old subject DN
1 parent 3b1db97 commit 268cd4c

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
//! Configuration of an OpenSearch node
22
3+
use std::iter;
4+
35
use serde_json::json;
46
use stackable_operator::{
57
builder::pod::container::FieldPathEnvVar, commons::networking::DomainName,
@@ -238,6 +240,10 @@ impl NodeConfig {
238240
/// The list looks similar to:
239241
/// - DC=local,DC=cluster,DC=svc,DC=my-namespace,DC=opensearch-nodes-cluster-manager-headless,DC=opensearch-nodes-cluster-manager-*
240242
/// - DC=local,DC=cluster,DC=svc,DC=my-namespace,DC=opensearch-nodes-data-headless,DC=opensearch-nodes-data-*
243+
/// - CN=generated certificate for pod
244+
///
245+
/// The entry "CN=generated certificate for pod" is still added to make the transition from
246+
/// SDP 26.3 to 26.7 possible.
241247
fn nodes_dn(&self) -> Vec<String> {
242248
self.cluster
243249
.role_group_configs
@@ -265,6 +271,11 @@ impl NodeConfig {
265271
.collect::<Vec<_>>()
266272
.join(",")
267273
})
274+
// TODO Remove "CN=generated certificate for pod" after the release of SDP 26.7 and
275+
// adapt the comment of the function and the tests.
276+
//
277+
// tracked in https://github.com/stackabletech/opensearch-operator/issues/145
278+
.chain(iter::once("CN=generated certificate for pod".to_owned()))
268279
.collect()
269280
}
270281

@@ -691,6 +702,7 @@ mod tests {
691702
"plugins.security.authcz.admin_dn: CN=update-security-config.0b1e30e6-326e-4c1a-868d-ad6598b49e8b\n",
692703
"plugins.security.nodes_dn:\n",
693704
"- DC=local,DC=cluster,DC=svc,DC=default,DC=my-opensearch-cluster-nodes-default-headless,DC=my-opensearch-cluster-nodes-default-*\n",
705+
"- CN=generated certificate for pod\n",
694706
"plugins.security.ssl.http.enabled: true\n",
695707
"plugins.security.ssl.http.pemcert_filepath: /stackable/opensearch/config/tls/server/tls.crt\n",
696708
"plugins.security.ssl.http.pemkey_filepath: /stackable/opensearch/config/tls/server/tls.key\n",

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,6 +1060,7 @@ data:
10601060
plugins.security.nodes_dn:
10611061
- DC=local,DC=cluster,DC=svc,DC=test,DC=opensearch-nodes-cluster-manager-headless,DC=opensearch-nodes-cluster-manager-*
10621062
- DC=local,DC=cluster,DC=svc,DC=test,DC=opensearch-nodes-data-headless,DC=opensearch-nodes-data-*
1063+
- CN=generated certificate for pod
10631064
{% if test_scenario['values']['server-use-tls'] == 'true' %}
10641065
plugins.security.ssl.http.enabled: true
10651066
plugins.security.ssl.http.pemcert_filepath: {{ test_scenario['values']['opensearch_home'] }}/config/tls/server/tls.crt
@@ -1103,6 +1104,7 @@ data:
11031104
plugins.security.nodes_dn:
11041105
- DC=local,DC=cluster,DC=svc,DC=test,DC=opensearch-nodes-cluster-manager-headless,DC=opensearch-nodes-cluster-manager-*
11051106
- DC=local,DC=cluster,DC=svc,DC=test,DC=opensearch-nodes-data-headless,DC=opensearch-nodes-data-*
1107+
- CN=generated certificate for pod
11061108
{% if test_scenario['values']['server-use-tls'] == 'true' %}
11071109
plugins.security.ssl.http.enabled: true
11081110
plugins.security.ssl.http.pemcert_filepath: {{ test_scenario['values']['opensearch_home'] }}/config/tls/server/tls.crt

0 commit comments

Comments
 (0)