Skip to content

Commit 5521971

Browse files
authored
fix: correct backendRefs indentation in HTTPRoute Helm template (#590)
* fix: correct backendRefs indentation in HTTPRoute Helm template * chore: bump Helm chart version
1 parent 790a91e commit 5521971

4 files changed

Lines changed: 90 additions & 3 deletions

File tree

‎deployments/kubernetes/chart/forecastle/Chart.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
name: forecastle
33
description: forecastle chart that runs on kubernetes
44
icon: https://github.com/stakater/Forecastle/raw/master/assets/web/forecastle-round-100px.png
5-
version: 2.1.2
5+
version: 2.1.3
66
appVersion: "v2.0.2"
77
keywords:
88
- forecastle

‎deployments/kubernetes/chart/forecastle/templates/httproute.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ spec:
3737
{{- end }}
3838
backendRefs:
3939
{{- if .backendRefs }}
40-
{{- toYaml .backendRefs | nindent 4 }}
40+
{{- toYaml .backendRefs | nindent 8 }}
4141
{{- else }}
4242
- name: {{ $name }}
4343
port: 80
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
suite: HTTPRoute
2+
3+
templates:
4+
- httproute.yaml
5+
6+
tests:
7+
- it: should render nothing if not enabled
8+
asserts:
9+
- hasDocuments:
10+
count: 0
11+
12+
- it: should render an HTTPRoute when enabled
13+
set:
14+
forecastle.httpRoute.enabled: true
15+
asserts:
16+
- containsDocument:
17+
kind: HTTPRoute
18+
apiVersion: gateway.networking.k8s.io/v1
19+
- equal:
20+
path: metadata.name
21+
value: forecastle
22+
23+
- it: should use the default backendRef when none is given
24+
set:
25+
forecastle.httpRoute.enabled: true
26+
asserts:
27+
- equal:
28+
path: spec.rules[0].backendRefs[0].name
29+
value: forecastle
30+
- equal:
31+
path: spec.rules[0].backendRefs[0].port
32+
value: 80
33+
- equal:
34+
path: spec.rules[0].backendRefs[0].weight
35+
value: 1
36+
37+
- it: should render custom backendRefs with correct nesting
38+
set:
39+
forecastle.httpRoute.enabled: true
40+
forecastle.httpRoute.rules:
41+
- matches:
42+
- path:
43+
type: PathPrefix
44+
value: /
45+
backendRefs:
46+
- name: my-service
47+
port: 8080
48+
weight: 5
49+
asserts:
50+
- equal:
51+
path: spec.rules[0].backendRefs[0].name
52+
value: my-service
53+
- equal:
54+
path: spec.rules[0].backendRefs[0].port
55+
value: 8080
56+
- equal:
57+
path: spec.rules[0].backendRefs[0].weight
58+
value: 5
59+
60+
- it: should set parentRefs and hostnames when given
61+
set:
62+
forecastle.httpRoute.enabled: true
63+
forecastle.httpRoute.parentRefs:
64+
- name: my-gateway
65+
forecastle.httpRoute.hostnames:
66+
- forecastle.example.com
67+
asserts:
68+
- equal:
69+
path: spec.parentRefs[0].name
70+
value: my-gateway
71+
- equal:
72+
path: spec.hostnames[0]
73+
value: forecastle.example.com
74+
75+
- it: should set the rule name when given
76+
set:
77+
forecastle.httpRoute.enabled: true
78+
forecastle.httpRoute.rules:
79+
- name: my-rule
80+
matches:
81+
- path:
82+
type: PathPrefix
83+
value: /
84+
asserts:
85+
- equal:
86+
path: spec.rules[0].name
87+
value: my-rule

‎deployments/kubernetes/chart/forecastle/values.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ forecastle:
55
labels:
66
group: com.stakater.platform
77
provider: stakater
8-
version: 2.1.2
8+
version: 2.1.3
99
image:
1010
name: stakater/forecastle
1111
tag: v2.0.2

0 commit comments

Comments
 (0)