Skip to content

Commit b083d8e

Browse files
committed
test(platform): pin the opensearch-operator DNS base wiring
Two ends of the same path. The platform suite pins that the shared values Secret carries networking.clusterDomain to the operator under the subchart key, and the package suite pins that a domain set on that key reaches the manager container as DNS_BASE, with the upstream cluster.local default intact when nothing sets it. Every pattern in the platform suite anchors dnsBase to its opensearch-operator and manager parents rather than matching the key anywhere in the payload. An unanchored pattern is satisfied by any sibling block that happens to carry the same domain, which leaves the assertion green after the block it is meant to pin has been deleted. Assisted-by: LLM Signed-off-by: Aleksei Sviridkin <[email protected]>
1 parent 857ad4a commit b083d8e

2 files changed

Lines changed: 73 additions & 0 deletions

File tree

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
suite: apps.yaml networking.clusterDomain reaches the opensearch-operator DNS base
2+
3+
templates:
4+
- templates/apps.yaml
5+
6+
release:
7+
name: cozy-platform
8+
namespace: cozy-system
9+
10+
# The operator builds every in-cluster name it needs from DNS_BASE, which the
11+
# vendored subchart reads from manager.dnsBase and defaults to cluster.local.
12+
# The platform carries the authoritative domain to it under the subchart key in
13+
# the shared values Secret. Every pattern here anchors dnsBase to its
14+
# opensearch-operator and manager parents, so a sibling block carrying the same
15+
# domain cannot satisfy the assertion on its own.
16+
17+
tests:
18+
- it: carries the cozy.local default under the subchart key
19+
asserts:
20+
- matchRegex:
21+
path: stringData["values.yaml"]
22+
pattern: '(?m)^opensearch-operator:\n manager:\n dnsBase: "cozy\.local"$'
23+
24+
- it: tracks a non-default networking.clusterDomain
25+
set:
26+
networking.clusterDomain: example.test
27+
asserts:
28+
- matchRegex:
29+
path: stringData["values.yaml"]
30+
pattern: '(?m)^opensearch-operator:\n manager:\n dnsBase: "example\.test"$'
31+
- notMatchRegex:
32+
path: stringData["values.yaml"]
33+
pattern: '(?m)^opensearch-operator:\n manager:\n dnsBase: "cozy\.local"$'
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
suite: opensearch-operator DNS base follows the value set on the umbrella key
2+
3+
release:
4+
name: opensearch-operator
5+
namespace: cozy-opensearch-operator
6+
7+
# The platform carries the cluster domain to this package under the subchart key
8+
# in the shared values Secret (packages/core/platform/templates/apps.yaml). The
9+
# vendored chart reads it as manager.dnsBase and hands it to the manager as
10+
# DNS_BASE, from which the operator builds the securityconfig job target, its own
11+
# OpenSearch API client URL, the Dashboards host and the SANs it writes into node
12+
# certificates. Rendered without the Secret the package stays on the upstream
13+
# cluster.local default.
14+
15+
tests:
16+
- it: passes the domain set on the umbrella key through to the manager env
17+
set:
18+
opensearch-operator.manager.dnsBase: example.test
19+
template: charts/opensearch-operator/templates/opensearch-operator-controller-manager-deployment.yaml
20+
documentSelector:
21+
path: kind
22+
value: Deployment
23+
asserts:
24+
- contains:
25+
path: spec.template.spec.containers[1].env
26+
content:
27+
name: DNS_BASE
28+
value: example.test
29+
30+
- it: keeps the upstream default when the platform sets nothing
31+
template: charts/opensearch-operator/templates/opensearch-operator-controller-manager-deployment.yaml
32+
documentSelector:
33+
path: kind
34+
value: Deployment
35+
asserts:
36+
- contains:
37+
path: spec.template.spec.containers[1].env
38+
content:
39+
name: DNS_BASE
40+
value: cluster.local

0 commit comments

Comments
 (0)