Skip to content

Commit d78c25a

Browse files
committed
Fixed services_test.yaml and services.yaml
1 parent c9a6976 commit d78c25a

File tree

3 files changed

+38
-9
lines changed

3 files changed

+38
-9
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* New feature: Add `extra_volumes` to all python-based st2 deployments. This can facilitate changing log levels by loading logging conf file(s) from a custom ConfigMap. (#276) (by @cognifloyd)
77
* Initialize basic unittest infrastructure using `helm-unittest`. Added tests for labels, custom annotations, SecurityContext, pullSecrets, pullPolicy, Resources, nodeSelector, tolerations, affinity, dnsPolicy, dnsConfig, ServiceAccount attach, postStartScript, and both sensor-modes. (#284, #288)
88
* Allow partitioning sensors using the hash_range strategy instead of one sensor per pod. (#218) (by @cognifloyd)
9-
* New feature to include possibility for external services in st2api, st2stream and st2auth, setting default value for this services as `ClusterIP` and `hostname: ""`. (by @sandesvitor)
9+
* New feature to include possibility for external services in st2api, st2stream and st2auth, setting default value for this services as `ClusterIP` and `hostname: ""`. Also, added new entry for custom_annotations_test.yaml and created new unit test services_test.yaml. (by @sandesvitor)
1010

1111
## v0.80.0
1212
* Switch st2 to `v3.6` as a new default stable version (#274)

templates/services.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ metadata:
3939
name: {{ .Release.Name }}-st2api
4040
annotations:
4141
description: StackStorm st2api - service hosts the REST API endpoints that serve requests from WebUI, CLI, ChatOps and other st2 services.
42-
{{- if .Values.st2web.service.hostname }}
42+
{{- if .Values.st2api.service.hostname }}
4343
external-dns.alpha.kubernetes.io/hostname: {{ .Values.st2api.service.hostname | quote }}
4444
{{- end }}
4545
{{- if .Values.st2api.service.annotations }}

tests/unit/services_test.yaml

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,49 @@
11
---
2-
suite: Services hostname and type
2+
suite: Services
33
templates:
44
# primary template files
55
- services.yaml
66

77
tests:
8-
- it: st2web, st2auth, st2api, st2stream should work without hostname
8+
- it: st2web, st2auth, st2api, st2stream should work without externalName
9+
set:
10+
st2chatops:
11+
enabled: false
12+
asserts:
13+
- hasDocuments:
14+
count: 4
15+
- isNull:
16+
path: spec.externalName
17+
value: some-host-name
18+
19+
20+
- it: st2web, st2auth, st2api, st2stream should work with externalName if type is ExternalName
921
set:
1022
st2web:
1123
service:
1224
hostname: some-host-name
13-
type: LoadBalancer
25+
type: ExternalName
26+
st2auth:
27+
service:
28+
hostname: some-host-name
29+
type: ExternalName
30+
st2api:
31+
service:
32+
hostname: some-host-name
33+
type: ExternalName
34+
st2stream:
35+
service:
36+
hostname: some-host-name
37+
type: ExternalName
38+
st2chatops:
39+
enabled: false
1440
asserts:
41+
- hasDocuments:
42+
count: 4
1543
- equal:
16-
path: spec.type
17-
value: LoadBalancer
44+
path: spec.type
45+
value: ExternalName
1846
- equal:
19-
path: spec.externalName
20-
value: some-host-name
47+
path: spec.externalName
48+
value: some-host-name
49+

0 commit comments

Comments
 (0)