Skip to content

Commit 0e90655

Browse files
test: Use ListenerClass external-unstable; Check SSL hostname in opensearchpy
1 parent 2d1699e commit 0e90655

8 files changed

Lines changed: 29 additions & 15 deletions

File tree

tests/templates/kuttl/ldap/30-test-opensearch.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ spec:
2222
# required for pip install
2323
- name: HOME
2424
value: /stackable
25+
- name: NAMESPACE
26+
valueFrom:
27+
fieldRef:
28+
fieldPath: metadata.namespace
2529
volumeMounts:
2630
- name: script
2731
mountPath: /stackable/scripts
@@ -68,9 +72,12 @@ metadata:
6872
name: test-opensearch
6973
data:
7074
test.py: |
75+
import os
7176
from opensearchpy import OpenSearch
7277
73-
host = 'opensearch'
78+
namespace = os.environ['NAMESPACE']
79+
80+
host = f'opensearch.{namespace}.svc.cluster.local'
7481
port = 9200
7582
auth = ('integrationtest', 'integrationtest')
7683
ca_certs_path = '/stackable/tls/ca.crt'
@@ -81,8 +88,6 @@ data:
8188
http_auth = auth,
8289
use_ssl = True,
8390
verify_certs = True,
84-
ssl_assert_hostname = False,
85-
ssl_show_warn = False,
8691
ca_certs = ca_certs_path
8792
)
8893

tests/templates/kuttl/metrics/20-install-opensearch.yaml.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ spec:
2727
storage:
2828
data:
2929
capacity: 100Mi
30-
listenerClass: external-stable
30+
listenerClass: external-unstable
3131
replicas: 3
3232
configOverrides:
3333
opensearch.yml:

tests/templates/kuttl/opensearch-dashboards/10-install-opensearch.yaml.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ spec:
2323
roleGroups:
2424
default:
2525
config:
26-
listenerClass: external-stable
26+
listenerClass: external-unstable
2727
replicas: 1
2828
podOverrides:
2929
spec:

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,7 @@ metadata:
869869
kind: OpenSearchCluster
870870
name: opensearch
871871
spec:
872-
className: external-stable
872+
className: external-unstable
873873
extraPodSelectorLabels: {}
874874
ports:
875875
- name: http

tests/templates/kuttl/smoke/10-install-opensearch.yaml.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ spec:
2929
storage:
3030
data:
3131
capacity: 100Mi
32-
listenerClass: external-stable
32+
listenerClass: external-unstable
3333
replicas: 3
3434
podOverrides:
3535
spec:

tests/templates/kuttl/smoke/20-test-opensearch.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ spec:
2222
# required for pip install
2323
- name: HOME
2424
value: /stackable
25+
- name: NAMESPACE
26+
valueFrom:
27+
fieldRef:
28+
fieldPath: metadata.namespace
2529
volumeMounts:
2630
- name: script
2731
mountPath: /stackable/scripts
@@ -70,9 +74,12 @@ data:
7074
test.py: |
7175
# https://docs.opensearch.org/docs/latest/clients/python-low-level/#sample-program
7276
77+
import os
7378
from opensearchpy import OpenSearch
7479
75-
host = 'opensearch'
80+
namespace = os.environ['NAMESPACE']
81+
82+
host = f'opensearch.{namespace}.svc.cluster.local'
7683
port = 9200
7784
auth = ('admin', 'AJVFsGJBbpT6mChn') # For testing only. Don't store credentials in code.
7885
ca_certs_path = '/stackable/tls/ca.crt'
@@ -84,8 +91,6 @@ data:
8491
http_auth = auth,
8592
use_ssl = True,
8693
verify_certs = True,
87-
ssl_assert_hostname = False,
88-
ssl_show_warn = False,
8994
ca_certs = ca_certs_path
9095
)
9196

tests/templates/kuttl/snapshot-s3/20-install-opensearch.yaml.j2

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ spec:
2020
config:
2121
logging:
2222
enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }}
23-
listenerClass: external-stable
23+
listenerClass: external-unstable
2424
roleGroups:
2525
default:
2626
replicas: 1
@@ -51,7 +51,6 @@ spec:
5151
spec:
5252
initContainers:
5353
- name: init-keystore
54-
# TODO Use somehow the image of the opensearch container
5554
image: oci.stackable.tech/sdp/opensearch:3.1.0-stackable0.0.0-dev
5655
command:
5756
- /bin/bash

tests/templates/kuttl/snapshot-s3/30-test-snapshot.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ spec:
2222
# required for pip install
2323
- name: HOME
2424
value: /stackable
25+
- name: NAMESPACE
26+
valueFrom:
27+
fieldRef:
28+
fieldPath: metadata.namespace
2529
volumeMounts:
2630
- name: script
2731
mountPath: /stackable/scripts
@@ -68,10 +72,13 @@ metadata:
6872
name: test-opensearch
6973
data:
7074
test.py: |
75+
import os
7176
from opensearchpy import OpenSearch
7277
from opensearchpy.exceptions import RequestError
7378
74-
host = 'opensearch'
79+
namespace = os.environ['NAMESPACE']
80+
81+
host = f'opensearch.{namespace}.svc.cluster.local'
7582
port = 9200
7683
auth = ('admin', 'AJVFsGJBbpT6mChn') # For testing only. Don't store credentials in code.
7784
ca_certs_path = '/stackable/tls/ca.crt'
@@ -83,8 +90,6 @@ data:
8390
http_auth = auth,
8491
use_ssl = True,
8592
verify_certs = True,
86-
ssl_assert_hostname = False,
87-
ssl_show_warn = False,
8893
ca_certs = ca_certs_path
8994
)
9095

0 commit comments

Comments
 (0)