|
| 1 | +suite: seaweedfs s3 TLS on main port + COSI provisioner SA name |
| 2 | + |
| 3 | +# Pins two regressions introduced by the 4.31 chart bump: |
| 4 | +# |
| 5 | +# 1. S3 TLS. Until 4.05 the `-cert.file`/`-key.file` args were rendered whenever |
| 6 | +# enableSecurity was on, so `weed s3` served TLS on the main port (8333) and |
| 7 | +# our HTTPS readiness/liveness probes (and the ingress backend-protocol=HTTPS |
| 8 | +# and the COSI sidecar's https:// endpoint) worked. 4.31 nested those args |
| 9 | +# inside `if .Values.s3.httpsPort`, and we ship httpsPort=0, so s3 served |
| 10 | +# plaintext and every probe failed with "server gave HTTP response to HTTPS |
| 11 | +# client". The s3-tls-main-port.patch restores the 4.05 behaviour. |
| 12 | +# |
| 13 | +# 2. COSI provisioner ServiceAccount. cosi-service-account.yaml and the |
| 14 | +# ClusterRoleBinding both name the SA <serviceAccountName>-objectstorage-provisioner, |
| 15 | +# but the Deployment referenced componentName (<release>-objectstorage-provisioner). |
| 16 | +# Whenever serviceAccountName != release name the Deployment could not create |
| 17 | +# pods ("serviceaccount not found"). The cosi-provisioner-sa-name.patch aligns |
| 18 | +# the Deployment with the SA + binding. |
| 19 | + |
| 20 | +templates: |
| 21 | + - charts/seaweedfs/templates/s3/s3-deployment.yaml |
| 22 | + - charts/seaweedfs/templates/cosi/cosi-deployment.yaml |
| 23 | + |
| 24 | +release: |
| 25 | + name: seaweedfs |
| 26 | + namespace: cozy-seaweedfs |
| 27 | + |
| 28 | +tests: |
| 29 | + - it: renders s3 TLS cert/key args under enableSecurity even when httpsPort is 0 |
| 30 | + template: charts/seaweedfs/templates/s3/s3-deployment.yaml |
| 31 | + set: |
| 32 | + global.seaweedfs.enableSecurity: true |
| 33 | + seaweedfs.s3.enabled: true |
| 34 | + seaweedfs.s3.httpsPort: 0 |
| 35 | + asserts: |
| 36 | + - matchRegex: |
| 37 | + path: spec.template.spec.containers[0].command[2] |
| 38 | + pattern: "-cert\\.file=/usr/local/share/ca-certificates/client/tls\\.crt" |
| 39 | + - matchRegex: |
| 40 | + path: spec.template.spec.containers[0].command[2] |
| 41 | + pattern: "-key\\.file=/usr/local/share/ca-certificates/client/tls\\.key" |
| 42 | + - notMatchRegex: |
| 43 | + path: spec.template.spec.containers[0].command[2] |
| 44 | + pattern: "-port\\.https" |
| 45 | + |
| 46 | + - it: still gates the cert args on enableSecurity |
| 47 | + template: charts/seaweedfs/templates/s3/s3-deployment.yaml |
| 48 | + set: |
| 49 | + global.seaweedfs.enableSecurity: false |
| 50 | + seaweedfs.s3.enabled: true |
| 51 | + asserts: |
| 52 | + - notMatchRegex: |
| 53 | + path: spec.template.spec.containers[0].command[2] |
| 54 | + pattern: "-cert\\.file" |
| 55 | + |
| 56 | + - it: renders -port.https alongside the cert args when httpsPort is set |
| 57 | + template: charts/seaweedfs/templates/s3/s3-deployment.yaml |
| 58 | + set: |
| 59 | + global.seaweedfs.enableSecurity: true |
| 60 | + seaweedfs.s3.enabled: true |
| 61 | + seaweedfs.s3.httpsPort: 8334 |
| 62 | + asserts: |
| 63 | + - matchRegex: |
| 64 | + path: spec.template.spec.containers[0].command[2] |
| 65 | + pattern: "-port\\.https=8334" |
| 66 | + - matchRegex: |
| 67 | + path: spec.template.spec.containers[0].command[2] |
| 68 | + pattern: "-cert\\.file=/usr/local/share/ca-certificates/client/tls\\.crt" |
| 69 | + |
| 70 | + - it: COSI provisioner Deployment uses the serviceAccountName-based SA, not componentName |
| 71 | + template: charts/seaweedfs/templates/cosi/cosi-deployment.yaml |
| 72 | + set: |
| 73 | + seaweedfs.cosi.enabled: true |
| 74 | + global.seaweedfs.serviceAccountName: custom-sa |
| 75 | + asserts: |
| 76 | + - equal: |
| 77 | + path: spec.template.spec.serviceAccountName |
| 78 | + value: custom-sa-objectstorage-provisioner |
0 commit comments