Skip to content

Commit f4dedcf

Browse files
authored
Remove support for networking.k8s.io/v1beta1 removed in k8s v1.22 (already EOL) (#353)
* drop unsupported api for Ingress networking.k8s.io/v1 was added in kubernetes 1.19 networking.k8s.io/v1beta1 was removed in kubernetes 1.22 kubernetes 1.19 EOL was 2021-10-28 kubernetes 1.22 EOL was 2022-10-28 Our readme says we only support "supported" kubernetes releases which currently includes 1.23, 1.24, 1.25, and 1.26. https://kubernetes.io/releases/patch-releases/ * add changelog entry
1 parent ca33b2a commit f4dedcf

File tree

3 files changed

+9
-87
lines changed

3 files changed

+9
-87
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Changelog
22

33
## In Development
4+
* Drop support for `networking.k8s.io/v1beta1` which was removed in kubernetes v1.22 (EOL 2022-10-28) (#353) (by @cognifloyd)
45

56
## v0.110.0
67
* Switch st2 to `v3.8` as a new default stable version (#347)

templates/ingress.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
{{- if .Values.ingress.enabled }}
22
---
3-
{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1" }}
43
apiVersion: networking.k8s.io/v1
5-
{{- else }}
6-
apiVersion: networking.k8s.io/v1beta1
7-
{{- end }}
84
kind: Ingress
95
metadata:
106
name: {{ .Release.Name }}-st2web-ingress

tests/unit/ingress_test.yaml

Lines changed: 8 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@ tests:
1313
- hasDocuments:
1414
count: 0
1515

16-
- it: Ingress is present when enabled without hosts (older k8s)
17-
capabilities: &cap_older
16+
- it: Ingress is present when enabled without hosts
17+
capabilities: &cap_newer
1818
majorVersion: 1
19-
minorVersion: 18
19+
minorVersion: 19
2020
apiVersions:
21+
- networking.k8s.io/v1 # introduced in 1.19, stable in 1.22
2122
- networking.k8s.io/v1beta1
2223
set:
2324
ingress:
@@ -39,42 +40,6 @@ tests:
3940
- equal: &st2web_rules_host
4041
path: spec.rules[0].host
4142
value: *st2web_hostname
42-
- contains:
43-
path: spec.rules[0].http.paths
44-
count: 1
45-
content:
46-
path: "/"
47-
backend:
48-
serviceName: st2ha-st2web
49-
servicePort: 80
50-
- isNull:
51-
path: spec.rules[0].http.paths[0].pathType
52-
53-
- it: Ingress is present when enabled without hosts (newer k8s)
54-
capabilities: &cap_newer
55-
majorVersion: 1
56-
minorVersion: 19
57-
apiVersions:
58-
- networking.k8s.io/v1 # introduced in 1.19, stable in 1.22
59-
- networking.k8s.io/v1beta1
60-
set:
61-
ingress:
62-
enabled: true
63-
hosts: []
64-
tls: []
65-
st2web:
66-
service:
67-
hostname: *st2web_hostname
68-
release:
69-
name: st2ha
70-
asserts:
71-
- hasDocuments:
72-
count: 1
73-
- equal:
74-
path: kind
75-
value: Ingress
76-
# no ingress.hosts, so only st2web.hostname
77-
- equal: *st2web_rules_host
7843
- contains:
7944
path: spec.rules[0].http.paths
8045
count: 1
@@ -87,12 +52,12 @@ tests:
8752
port:
8853
number: 80
8954

90-
- it: Ingress is present when enabled with hosts (older k8s)
91-
capabilities: *cap_older
55+
- it: Ingress is present when enabled with hosts
56+
capabilities: *cap_newer
9257
set:
9358
ingress:
9459
enabled: true
95-
hosts: &hosts
60+
hosts:
9661
- host: *st2web_hostname
9762
paths:
9863
- serviceName: st2ha-st2web
@@ -114,49 +79,9 @@ tests:
11479
value: Ingress
11580
# no ingress.hosts, so only st2web.hostname
11681
- equal: *st2web_rules_host
117-
- equal: &host_path_is_root_glob
82+
- equal:
11883
path: spec.rules[0].http.paths[0].path
11984
value: "/*"
120-
- isNull:
121-
path: spec.rules[0].http.paths[0].pathType
122-
- equal:
123-
path: spec.rules[0].http.paths[0].backend
124-
value:
125-
serviceName: st2ha-st2web
126-
servicePort: 80
127-
128-
- equal:
129-
path: spec.rules[0].http.paths[1].path
130-
value: "/fancy-sensor"
131-
- isNull:
132-
path: spec.rules[0].http.paths[1].pathType
133-
- equal:
134-
path: spec.rules[0].http.paths[1].backend
135-
value:
136-
serviceName: fancy-sensor
137-
servicePort: 8080
138-
139-
- it: Ingress is present when enabled with hosts (newer k8s)
140-
capabilities: *cap_newer
141-
set:
142-
ingress:
143-
enabled: true
144-
hosts: *hosts
145-
tls: []
146-
st2web:
147-
service:
148-
hostname: *st2web_hostname
149-
release:
150-
name: st2ha
151-
asserts:
152-
- hasDocuments:
153-
count: 1
154-
- equal:
155-
path: kind
156-
value: Ingress
157-
# no ingress.hosts, so only st2web.hostname
158-
- equal: *st2web_rules_host
159-
- equal: *host_path_is_root_glob
16085
- equal:
16186
path: spec.rules[0].http.paths[0].pathType
16287
value: Prefix

0 commit comments

Comments
 (0)