mirror of
https://gitea.com/gitea/helm-chart.git
synced 2024-08-23 15:14:19 +02:00
94 lines
2.7 KiB
YAML
94 lines
2.7 KiB
YAML
|
suite: Statefulset template (signing enabled)
|
||
|
release:
|
||
|
name: gitea-unittests
|
||
|
namespace: testing
|
||
|
templates:
|
||
|
- templates/gitea/statefulset.yaml
|
||
|
- templates/gitea/config.yaml
|
||
|
tests:
|
||
|
- it: adds gpg init container
|
||
|
template: templates/gitea/statefulset.yaml
|
||
|
set:
|
||
|
signing:
|
||
|
enabled: true
|
||
|
existingSecret: "custom-gpg-secret"
|
||
|
asserts:
|
||
|
- equal:
|
||
|
path: spec.template.spec.initContainers[2].name
|
||
|
value: configure-gpg
|
||
|
- equal:
|
||
|
path: spec.template.spec.initContainers[2].command
|
||
|
value: ["/usr/sbin/configure_gpg_environment.sh"]
|
||
|
- equal:
|
||
|
path: spec.template.spec.initContainers[2].securityContext
|
||
|
value:
|
||
|
runAsUser: 1000
|
||
|
- equal:
|
||
|
path: spec.template.spec.initContainers[2].env
|
||
|
value:
|
||
|
- name: GNUPGHOME
|
||
|
value: /data/git/.gnupg
|
||
|
- equal:
|
||
|
path: spec.template.spec.initContainers[2].volumeMounts
|
||
|
value:
|
||
|
- name: init
|
||
|
mountPath: /usr/sbin
|
||
|
- name: data
|
||
|
mountPath: /data
|
||
|
- name: gpg-private-key
|
||
|
mountPath: /raw
|
||
|
readOnly: true
|
||
|
- it: adds gpg env in `init-directories` init container
|
||
|
template: templates/gitea/statefulset.yaml
|
||
|
set:
|
||
|
signing.enabled: true
|
||
|
asserts:
|
||
|
- contains:
|
||
|
path: spec.template.spec.initContainers[0].env
|
||
|
content:
|
||
|
name: GNUPGHOME
|
||
|
value: /data/git/.gnupg
|
||
|
- it: adds gpg env in runtime container
|
||
|
template: templates/gitea/statefulset.yaml
|
||
|
set:
|
||
|
signing.enabled: true
|
||
|
asserts:
|
||
|
- contains:
|
||
|
path: spec.template.spec.containers[0].env
|
||
|
content:
|
||
|
name: GNUPGHOME
|
||
|
value: /data/git/.gnupg
|
||
|
- it: adds gpg volume spec
|
||
|
template: templates/gitea/statefulset.yaml
|
||
|
set:
|
||
|
signing:
|
||
|
enabled: true
|
||
|
asserts:
|
||
|
- contains:
|
||
|
path: spec.template.spec.volumes
|
||
|
content:
|
||
|
name: gpg-private-key
|
||
|
secret:
|
||
|
secretName: gitea-unittests-gpg-key
|
||
|
items:
|
||
|
- key: privateKey
|
||
|
path: private.asc
|
||
|
defaultMode: 0100
|
||
|
- it: supports gpg volume spec with external reference
|
||
|
template: templates/gitea/statefulset.yaml
|
||
|
set:
|
||
|
signing:
|
||
|
enabled: true
|
||
|
existingSecret: custom-gpg-secret
|
||
|
asserts:
|
||
|
- contains:
|
||
|
path: spec.template.spec.volumes
|
||
|
content:
|
||
|
name: gpg-private-key
|
||
|
secret:
|
||
|
secretName: custom-gpg-secret
|
||
|
items:
|
||
|
- key: privateKey
|
||
|
path: private.asc
|
||
|
defaultMode: 0100
|