Files
helm-actions/unittests/helm/01-consistency-checks.yaml
T
James Tatum 5039cb180b feat: support native Kubernetes runner jobs (#194)
### Description of the change

Make DinD optional and add opt-in ServiceAccount/RBAC creation for native Kubernetes jobs. Preserve Docker defaults and compatibility with reused Helm values.

### Benefits

Deploy Kubernetes jobs through the existing chart, with support for mixed backend labels.

### Possible drawbacks

Requires matching runner configuration. Docker container actions remain unsupported by the upstream Kubernetes backend.

### Additional information

Validated with 61 Helm tests, lint, packaging, and kind: six concurrent jobs, checkout/services, artifacts/cache, cleanup, restarts and backend upgrades. Manual validation completed.

### Checklist

- [x] Parameters documented in values.yaml and generated README.md
- [x] Helm templating unit tests added
- [x] New resources render metadata.namespace

Reviewed-on: https://gitea.com/gitea/helm-actions/pulls/194
Reviewed-by: DaanSelen <[email protected]>
Reviewed-by: Lunny Xiao <[email protected]>
Co-authored-by: James Tatum <[email protected]>
2026-11-22 10:08:59 +00:00

58 lines
1.9 KiB
YAML

suite: actions template | consistency checks
release:
name: gitea-actions-unittests
namespace: testing
templates:
- templates/01-consistency-checks.yaml
tests:
- it: fails when provisioning is disabled BUT existingSecret and existingSecretKey are missing
set:
enabled: true
asserts:
- failedTemplate:
errorMessage: "existingSecret and existingSecretKey are required when provisioning is disabled"
- it: fails when provisioning is disabled BUT existingSecretKey is missing
set:
enabled: true
existingSecret: "my-secret"
asserts:
- failedTemplate:
errorMessage: "existingSecret and existingSecretKey are required when provisioning is disabled"
- it: fails when provisioning is disabled BUT existingSecret is missing
set:
enabled: true
existingSecretKey: "my-secret-key"
asserts:
- failedTemplate:
errorMessage: "existingSecret and existingSecretKey are required when provisioning is disabled"
- it: fails when LOCAL_ROOT_URL is missing
set:
enabled: true
existingSecret: "my-secret"
existingSecretKey: "my-secret-key"
asserts:
- failedTemplate:
errorMessage: "giteaRootURL is required"
- it: requires an explicit service account when granting Kubernetes permissions
set:
enabled: true
serviceAccount: null
existingSecret: my-secret
existingSecretKey: token
giteaRootURL: https://gitea.example.com
rbac.create: true
asserts:
- failedTemplate:
errorMessage: "rbac.create requires serviceAccount.create or statefulset.serviceAccountName"
- it: accepts reused legacy values without the new creation maps
set:
enabled: true
existingSecret: my-secret
existingSecretKey: token
giteaRootURL: https://gitea.example.com
serviceAccount: null
rbac: null
asserts:
- hasDocuments:
count: 0