Skip to content

Commit 4a1d6ff

Browse files
committed
test(packages/system/seaweedfs): cover s3.trafficDistribution version gating
Pin the native s3.trafficDistribution behaviour that replaced the dropped s3-traffic-distribution.patch: PreferClose is kept on Kubernetes 1.33, auto-converts to PreferSameZone on 1.35, and the field is omitted below the 1.31 gate. Adds the helm-unittest harness (test target + suite) the package previously lacked. Assisted-By: Claude <[email protected]> Signed-off-by: Aleksei Sviridkin <[email protected]>
1 parent a3cb8c6 commit 4a1d6ff

2 files changed

Lines changed: 46 additions & 0 deletions

File tree

‎packages/system/seaweedfs/Makefile‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ export NAME=seaweedfs-system
33
include ../../../hack/common-envs.mk
44
include ../../../hack/package.mk
55

6+
test:
7+
helm unittest .
8+
69
update:
710
rm -rf charts
811
mkdir -p charts
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
suite: seaweedfs s3 trafficDistribution
2+
3+
# Pins the s3.trafficDistribution behaviour that replaced the former
4+
# s3-traffic-distribution.patch (dropped in the 4.31 bump). The native chart
5+
# field gates on Kubernetes >=1.31 and auto-converts PreferClose to
6+
# PreferSameZone on >=1.35, so this guards both the value the package sets and
7+
# the version-gating now relied on instead of the hardcoded patch.
8+
9+
templates:
10+
- charts/seaweedfs/templates/s3/s3-service.yaml
11+
12+
release:
13+
name: seaweedfs
14+
namespace: cozy-seaweedfs
15+
16+
tests:
17+
- it: keeps PreferClose on Kubernetes 1.33
18+
capabilities:
19+
majorVersion: 1
20+
minorVersion: 33
21+
asserts:
22+
- isKind:
23+
of: Service
24+
- equal:
25+
path: spec.trafficDistribution
26+
value: PreferClose
27+
28+
- it: auto-converts to PreferSameZone on Kubernetes 1.35
29+
capabilities:
30+
majorVersion: 1
31+
minorVersion: 35
32+
asserts:
33+
- equal:
34+
path: spec.trafficDistribution
35+
value: PreferSameZone
36+
37+
- it: omits the field on Kubernetes 1.30 (below the 1.31 gate)
38+
capabilities:
39+
majorVersion: 1
40+
minorVersion: 30
41+
asserts:
42+
- notExists:
43+
path: spec.trafficDistribution

0 commit comments

Comments
 (0)