Skip to content

Commit 528a559

Browse files
committed
address more feedback on PR
1 parent 9fae7fa commit 528a559

8 files changed

Lines changed: 28 additions & 60 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
version: 0.1.0
3+
spec:
4+
units: []
5+
properties: []

docs/modules/opensearch/pages/usage-guide/keystore.adoc

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,7 @@ spec:
2222
secretKeyRef:
2323
name: s3-credentials
2424
key: secretKey
25-
nodes:
26-
roleGroups:
27-
default:
28-
replicas: 1
25+
...
2926
---
3027
apiVersion: v1
3128
kind: Secret

rust/operator-binary/src/controller.rs

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -385,16 +385,13 @@ mod tests {
385385
use super::{Context, OpenSearchRoleGroupConfig, ValidatedCluster, ValidatedLogging};
386386
use crate::{
387387
controller::{OpenSearchNodeResources, ValidatedOpenSearchConfig},
388-
crd::{
389-
NodeRoles, OpenSearchKeystoreKey,
390-
v1alpha1::{self, OpenSearchKeystore, SecretKeyRef},
391-
},
388+
crd::{NodeRoles, v1alpha1},
392389
framework::{
393390
builder::pod::container::EnvVarSet,
394391
product_logging::framework::ValidatedContainerLogConfigChoice,
395392
role_utils::GenericProductSpecificCommonConfig,
396393
types::{
397-
kubernetes::{ListenerClassName, NamespaceName, SecretKey, SecretName},
394+
kubernetes::{ListenerClassName, NamespaceName},
398395
operator::{ClusterName, OperatorName, ProductVersion, RoleGroupName},
399396
},
400397
},
@@ -507,13 +504,7 @@ mod tests {
507504
),
508505
]
509506
.into(),
510-
vec![OpenSearchKeystore {
511-
key: OpenSearchKeystoreKey::from_str_unsafe("Keystore1"),
512-
secret_key_ref: SecretKeyRef {
513-
name: SecretName::from_str_unsafe("my-keystore-secret"),
514-
key: SecretKey::from_str_unsafe("my-keystore-file"),
515-
},
516-
}],
507+
vec![],
517508
)
518509
}
519510

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

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,12 @@ mod tests {
7777
ContextNames, OpenSearchNodeResources, OpenSearchRoleGroupConfig, ValidatedCluster,
7878
ValidatedContainerLogConfigChoice, ValidatedLogging, ValidatedOpenSearchConfig,
7979
},
80-
crd::{NodeRoles, OpenSearchKeystoreKey, v1alpha1},
80+
crd::{NodeRoles, v1alpha1},
8181
framework::{
8282
builder::pod::container::EnvVarSet,
8383
role_utils::GenericProductSpecificCommonConfig,
8484
types::{
85-
kubernetes::{ListenerClassName, NamespaceName, SecretKey, SecretName},
85+
kubernetes::{ListenerClassName, NamespaceName},
8686
operator::{
8787
ClusterName, ControllerName, OperatorName, ProductName, ProductVersion,
8888
RoleGroupName,
@@ -197,13 +197,7 @@ mod tests {
197197
),
198198
]
199199
.into(),
200-
vec![v1alpha1::OpenSearchKeystore {
201-
key: OpenSearchKeystoreKey::from_str_unsafe("Keystore1"),
202-
secret_key_ref: v1alpha1::SecretKeyRef {
203-
name: SecretName::from_str_unsafe("my-keystore-secret"),
204-
key: SecretKey::from_str_unsafe("my-keystore-file"),
205-
},
206-
}],
200+
vec![],
207201
)
208202
}
209203

tests/templates/kuttl/backup-restore/11_minio-values.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ provisioning:
3636
extraCommands:
3737
- >-
3838
mc admin user svcacct add
39-
--access-key "$(cat /tmp/s3-credentials/s3.client.default.access_key)"
40-
--secret-key "$(cat /tmp/s3-credentials/s3.client.default.secret_key)"
39+
--access-key "$(cat /tmp/s3-credentials/ACCESS_KEY)"
40+
--secret-key "$(cat /tmp/s3-credentials/SECRET_KEY)"
4141
provisioning integrationtest
4242
extraVolumeMounts:
4343
- name: s3-credentials

tests/templates/kuttl/backup-restore/31-backup-security-indices.yaml.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@ spec:
5353
valueFrom:
5454
secretKeyRef:
5555
name: s3-credentials
56-
key: s3.client.default.access_key
56+
key: ACCESS_KEY
5757
- name: S3_SECRET_KEY
5858
valueFrom:
5959
secretKeyRef:
6060
name: s3-credentials
61-
key: s3.client.default.secret_key
61+
key: SECRET_KEY
6262
volumeMounts:
6363
- name: scripts
6464
mountPath: /root/scripts

tests/templates/kuttl/backup-restore/51-install-opensearch-2.yaml.j2

Lines changed: 10 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,17 @@ spec:
1010
{% endif %}
1111
productVersion: "{{ test_scenario['values']['opensearch'].split(',')[0] }}"
1212
pullPolicy: IfNotPresent
13-
{% if lookup('env', 'VECTOR_AGGREGATOR') %}
1413
clusterConfig:
14+
keystore:
15+
- key: s3.client.default.access_key
16+
secretKeyRef:
17+
name: s3-credentials
18+
key: ACCESS_KEY
19+
- key: s3.client.default.secret_key
20+
secretKeyRef:
21+
name: s3-credentials
22+
key: SECRET_KEY
23+
{% if lookup('env', 'VECTOR_AGGREGATOR') %}
1524
vectorAggregatorConfigMapName: vector-aggregator-discovery
1625
{% endif %}
1726
nodes:
@@ -50,34 +59,6 @@ spec:
5059
podOverrides:
5160
spec:
5261
initContainers:
53-
- name: init-keystore
54-
{% if test_scenario['values']['opensearch'].find(",") > 0 %}
55-
image: "{{ test_scenario['values']['opensearch'].split(',')[1] }}"
56-
{% else %}
57-
image: oci.stackable.tech/sdp/opensearch:{{ test_scenario['values']['opensearch'].split(',')[0] }}-stackable{{ test_scenario['values']['release'] }}
58-
{% endif %}
59-
command:
60-
- /bin/bash
61-
- -euxo
62-
- pipefail
63-
- -c
64-
args:
65-
- |
66-
bin/opensearch-keystore create
67-
68-
for i in keystore-secrets/*; do
69-
key=$(basename $i)
70-
bin/opensearch-keystore add-file "$key" "$i"
71-
done
72-
73-
cp --archive config/opensearch.keystore initialized-keystore
74-
volumeMounts:
75-
- name: keystore
76-
mountPath: /stackable/opensearch/initialized-keystore
77-
readOnly: false
78-
- name: keystore-secrets
79-
mountPath: /stackable/opensearch/keystore-secrets
80-
readOnly: true
8162
- name: init-system-keystore
8263
{% if test_scenario['values']['opensearch'].find(",") > 0 %}
8364
image: "{{ test_scenario['values']['opensearch'].split(',')[1] }}"

tests/templates/kuttl/backup-restore/60-restore-security-indices.yaml.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ spec:
1616
valueFrom:
1717
secretKeyRef:
1818
name: s3-credentials
19-
key: s3.client.default.access_key
19+
key: ACCESS_KEY
2020
- name: S3_SECRET_KEY
2121
valueFrom:
2222
secretKeyRef:
2323
name: s3-credentials
24-
key: s3.client.default.secret_key
24+
key: SECRET_KEY
2525
volumeMounts:
2626
- name: scripts
2727
mountPath: /root/scripts

0 commit comments

Comments
 (0)