chore: add prettier linting

This commit is contained in:
Michael Kriese 2023-12-06 14:32:09 +01:00
parent 9705ad745c
commit 41c51cdb74
No known key found for this signature in database
GPG key ID: B83F553A0724D44E
23 changed files with 801 additions and 78 deletions

View file

@ -3,7 +3,7 @@ release:
name: gitea-unittests
namespace: testing
tests:
- it: "connects to postgresql service"
- it: 'connects to postgresql service'
template: templates/gitea/config.yaml
set:
postgresql:
@ -15,7 +15,7 @@ tests:
matchRegex:
path: stringData.database
pattern: HOST=gitea-unittests-postgresql.testing.svc.cluster.local:5432
- it: "renders the referenced service"
- it: 'renders the referenced service'
template: charts/postgresql/templates/primary/svc.yaml
set:
postgresql:

View file

@ -3,7 +3,7 @@ release:
name: gitea-unittests
namespace: testing
tests:
- it: "[default values] uses ingress host for DOMAIN|SSH_DOMAIN|ROOT_URL"
- it: '[default values] uses ingress host for DOMAIN|SSH_DOMAIN|ROOT_URL'
template: templates/gitea/config.yaml
asserts:
- documentIndex: 0
@ -21,7 +21,7 @@ tests:
################################################
- it: "[no ingress hosts] uses gitea http service for DOMAIN|SSH_DOMAIN|ROOT_URL"
- it: '[no ingress hosts] uses gitea http service for DOMAIN|SSH_DOMAIN|ROOT_URL'
template: templates/gitea/config.yaml
set:
ingress:
@ -42,7 +42,7 @@ tests:
################################################
- it: "[provided via values] uses that for DOMAIN|SSH_DOMAIN|ROOT_URL"
- it: '[provided via values] uses that for DOMAIN|SSH_DOMAIN|ROOT_URL'
template: templates/gitea/config.yaml
set:
gitea.config.server.DOMAIN: provided.example.com

View file

@ -3,7 +3,7 @@ release:
name: gitea-unittests
namespace: testing
tests:
- it: "[postgresql-ha] ensures we detect major image version upgrades"
- it: '[postgresql-ha] ensures we detect major image version upgrades'
template: charts/postgresql-ha/templates/postgresql/statefulset.yaml
set:
postgresql:
@ -16,7 +16,7 @@ tests:
path: spec.template.spec.containers[0].image
# IN CASE OF AN INTENTIONAL MAJOR BUMP, ADJUST THIS TEST
pattern: ^docker.io/bitnami/postgresql-repmgr:16.+$
- it: "[postgresql] ensures we detect major image version upgrades"
- it: '[postgresql] ensures we detect major image version upgrades'
template: charts/postgresql/templates/primary/statefulset.yaml
set:
postgresql:
@ -29,7 +29,7 @@ tests:
path: spec.template.spec.containers[0].image
# IN CASE OF AN INTENTIONAL MAJOR BUMP, ADJUST THIS TEST
pattern: ^docker.io/bitnami/postgresql:16.+$
- it: "[redis-cluster] ensures we detect major image version upgrades"
- it: '[redis-cluster] ensures we detect major image version upgrades'
template: charts/redis-cluster/templates/redis-statefulset.yaml
set:
redis-cluster:

View file

@ -14,15 +14,15 @@ tests:
asserts:
- equal:
path: spec.template.spec.containers[0].image
value: "codeberg.org/forgejo/forgejo:1.19.3-rootless"
value: 'codeberg.org/forgejo/forgejo:1.19.3-rootless'
- it: tag override
template: templates/gitea/deployment.yaml
set:
image.tag: "1.19.4"
image.tag: '1.19.4'
asserts:
- equal:
path: spec.template.spec.containers[0].image
value: "codeberg.org/forgejo/forgejo:1.19.4-rootless"
value: 'codeberg.org/forgejo/forgejo:1.19.4-rootless'
- it: root-based image
template: templates/gitea/deployment.yaml
set:
@ -30,23 +30,23 @@ tests:
asserts:
- equal:
path: spec.template.spec.containers[0].image
value: "codeberg.org/forgejo/forgejo:1.19.3"
value: 'codeberg.org/forgejo/forgejo:1.19.3'
- it: scoped registry
template: templates/gitea/deployment.yaml
set:
image.registry: "example.com"
image.registry: 'example.com'
asserts:
- equal:
path: spec.template.spec.containers[0].image
value: "example.com/forgejo/forgejo:1.19.3-rootless"
value: 'example.com/forgejo/forgejo:1.19.3-rootless'
- it: global registry
template: templates/gitea/deployment.yaml
set:
global.imageRegistry: "global.example.com"
global.imageRegistry: 'global.example.com'
asserts:
- equal:
path: spec.template.spec.containers[0].image
value: "global.example.com/forgejo/forgejo:1.19.3-rootless"
value: 'global.example.com/forgejo/forgejo:1.19.3-rootless'
- it: digest for rootless image
template: templates/gitea/deployment.yaml
set:
@ -56,7 +56,7 @@ tests:
asserts:
- equal:
path: spec.template.spec.containers[0].image
value: "codeberg.org/forgejo/forgejo:1.19.3-rootless@sha256:b28e8f3089b52ebe6693295df142f8c12eff354e9a4a5bfbb5c10f296c3a537a"
value: 'codeberg.org/forgejo/forgejo:1.19.3-rootless@sha256:b28e8f3089b52ebe6693295df142f8c12eff354e9a4a5bfbb5c10f296c3a537a'
- it: image fullOverride (does not append rootless)
template: templates/gitea/deployment.yaml
set:
@ -66,12 +66,12 @@ tests:
rootless: true
registry: example.com
repository: example/image
tag: "1.0.0"
tag: '1.0.0'
digest: sha256:b28e8f3089b52ebe6693295df142f8c12eff354e9a4a5bfbb5c10f296c3a537a
asserts:
- equal:
path: spec.template.spec.containers[0].image
value: "gitea/gitea:1.19.3"
value: 'gitea/gitea:1.19.3'
- it: digest for root-based image
template: templates/gitea/deployment.yaml
set:
@ -81,13 +81,13 @@ tests:
asserts:
- equal:
path: spec.template.spec.containers[0].image
value: "codeberg.org/forgejo/forgejo:1.19.3@sha256:b28e8f3089b52ebe6693295df142f8c12eff354e9a4a5bfbb5c10f296c3a537a"
value: 'codeberg.org/forgejo/forgejo:1.19.3@sha256:b28e8f3089b52ebe6693295df142f8c12eff354e9a4a5bfbb5c10f296c3a537a'
- it: digest and global registry
template: templates/gitea/deployment.yaml
set:
global.imageRegistry: "global.example.com"
image.digest: "sha256:b28e8f3089b52ebe6693295df142f8c12eff354e9a4a5bfbb5c10f296c3a537a"
global.imageRegistry: 'global.example.com'
image.digest: 'sha256:b28e8f3089b52ebe6693295df142f8c12eff354e9a4a5bfbb5c10f296c3a537a'
asserts:
- equal:
path: spec.template.spec.containers[0].image
value: "global.example.com/forgejo/forgejo:1.19.3-rootless@sha256:b28e8f3089b52ebe6693295df142f8c12eff354e9a4a5bfbb5c10f296c3a537a"
value: 'global.example.com/forgejo/forgejo:1.19.3-rootless@sha256:b28e8f3089b52ebe6693295df142f8c12eff354e9a4a5bfbb5c10f296c3a537a'

View file

@ -7,17 +7,17 @@ templates:
tests:
- it: hostname using TPL
set:
global.giteaHostName: "gitea.example.com"
global.giteaHostName: 'gitea.example.com'
ingress.enabled: true
ingress.hosts[0].host: "{{ .Values.global.giteaHostName }}"
ingress.hosts[0].host: '{{ .Values.global.giteaHostName }}'
ingress.tls:
- secretName: gitea-tls
hosts:
- "{{ .Values.global.giteaHostName }}"
- '{{ .Values.global.giteaHostName }}'
asserts:
- equal:
path: spec.tls[0].hosts[0]
value: "gitea.example.com"
value: 'gitea.example.com'
- equal:
path: spec.rules[0].host
value: "gitea.example.com"
value: 'gitea.example.com'

View file

@ -7,13 +7,13 @@ templates:
tests:
- it: inline config stringData.server using TPL
set:
global.giteaHostName: "gitea.example.com"
global.giteaHostName: 'gitea.example.com'
ingress.enabled: true
ingress.hosts[0].host: "{{ .Values.global.giteaHostName }}"
ingress.hosts[0].host: '{{ .Values.global.giteaHostName }}'
ingress.tls:
- secretName: gitea-tls
hosts:
- "{{ .Values.global.giteaHostName }}"
- '{{ .Values.global.giteaHostName }}'
asserts:
- documentIndex: 0
matchRegex:

View file

@ -11,14 +11,14 @@ tests:
set:
signing:
enabled: true
existingSecret: "custom-gpg-secret"
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"]
value: ['/usr/sbin/configure_gpg_environment.sh']
- equal:
path: spec.template.spec.initContainers[2].securityContext
value:
@ -42,7 +42,7 @@ tests:
template: templates/gitea/deployment.yaml
set:
signing.enabled: true
signing.existingSecret: "custom-gpg-secret"
signing.existingSecret: 'custom-gpg-secret'
asserts:
- contains:
path: spec.template.spec.initContainers[0].env
@ -53,7 +53,7 @@ tests:
template: templates/gitea/deployment.yaml
set:
signing.enabled: true
signing.existingSecret: "custom-gpg-secret"
signing.existingSecret: 'custom-gpg-secret'
asserts:
- contains:
path: spec.template.spec.containers[0].env
@ -65,7 +65,7 @@ tests:
set:
signing:
enabled: true
existingSecret: "forgejo-unittests-gpg-key"
existingSecret: 'forgejo-unittests-gpg-key'
asserts:
- contains:
path: spec.template.spec.volumes

View file

@ -15,35 +15,35 @@ tests:
path: spec.template.spec.containers[0].env
content:
name: SSH_LOG_LEVEL
value: "INFO"
value: 'INFO'
- it: supports overriding SSH log level
template: templates/gitea/deployment.yaml
set:
image.rootless: false
gitea.ssh.logLevel: "DEBUG"
gitea.ssh.logLevel: 'DEBUG'
asserts:
- contains:
path: spec.template.spec.containers[0].env
content:
name: SSH_LOG_LEVEL
value: "DEBUG"
value: 'DEBUG'
- it: supports overriding SSH log level (even when image.fullOverride set)
template: templates/gitea/deployment.yaml
set:
image.fullOverride: gitea/gitea:1.19.3
image.rootless: false
gitea.ssh.logLevel: "DEBUG"
gitea.ssh.logLevel: 'DEBUG'
asserts:
- contains:
path: spec.template.spec.containers[0].env
content:
name: SSH_LOG_LEVEL
value: "DEBUG"
value: 'DEBUG'
- it: skips SSH_LOG_LEVEL for rootless image
template: templates/gitea/deployment.yaml
set:
image.rootless: true
gitea.ssh.logLevel: "DEBUG" # explicitly defining a non-standard level here
gitea.ssh.logLevel: 'DEBUG' # explicitly defining a non-standard level here
asserts:
- notContains:
path: spec.template.spec.containers[0].env
@ -55,7 +55,7 @@ tests:
set:
image.fullOverride: gitea/gitea:1.19.3
image.rootless: true
gitea.ssh.logLevel: "DEBUG" # explicitly defining a non-standard level here
gitea.ssh.logLevel: 'DEBUG' # explicitly defining a non-standard level here
asserts:
- notContains:
path: spec.template.spec.containers[0].env

View file

@ -16,7 +16,7 @@ tests:
set:
signing:
enabled: true
existingSecret: "external-secret-reference"
existingSecret: 'external-secret-reference'
asserts:
- hasDocuments:
count: 0
@ -24,7 +24,7 @@ tests:
set:
signing:
enabled: true
privateKey: "gpg-key-placeholder"
privateKey: 'gpg-key-placeholder'
asserts:
- hasDocuments:
count: 1
@ -37,4 +37,4 @@ tests:
path: metadata.labels
- equal:
path: data.privateKey
value: "Z3BnLWtleS1wbGFjZWhvbGRlcg=="
value: 'Z3BnLWtleS1wbGFjZWhvbGRlcg=='

View file

@ -25,7 +25,7 @@ tests:
set:
serviceAccount:
create: false # explicitly set to define rendering behavior
name: "externally-existing-serviceaccount"
name: 'externally-existing-serviceaccount'
asserts:
- equal:
path: spec.template.spec.serviceAccountName