fix: Improve OpenShift compatibility (#1066)

This commit is contained in:
techknowlogick
2026-04-15 14:46:54 +00:00
parent a02a7feb6e
commit b7663bb95f
9 changed files with 36 additions and 18 deletions
+1 -1
View File
@@ -31,7 +31,7 @@ tests:
path: stringData.cache
value: |-
ADAPTER=redis
HOST=redis://:changeme@gitea-unittests-valkey-headless.testing.svc.cluster.local:6379/0?pool_size=100&idle_timeout=180s&
HOST=redis://:changeme@gitea-unittests-valkey-primary.testing.svc.cluster.local:6379/0?pool_size=100&idle_timeout=180s&
- it: "cache is configured correctly for 'memory' when valkey (or valkey-cluster) is disabled"
template: templates/gitea/config.yaml
+1 -1
View File
@@ -30,7 +30,7 @@ tests:
equal:
path: stringData.queue
value: |-
CONN_STR=redis://:changeme@gitea-unittests-valkey-headless.testing.svc.cluster.local:6379/0?pool_size=100&idle_timeout=180s&
CONN_STR=redis://:changeme@gitea-unittests-valkey-primary.testing.svc.cluster.local:6379/0?pool_size=100&idle_timeout=180s&
TYPE=redis
- it: "queue is configured correctly for 'levelDB' when valkey (and valkey-cluster) is disabled"
+1 -1
View File
@@ -31,7 +31,7 @@ tests:
path: stringData.session
value: |-
PROVIDER=redis
PROVIDER_CONFIG=redis://:changeme@gitea-unittests-valkey-headless.testing.svc.cluster.local:6379/0?pool_size=100&idle_timeout=180s&
PROVIDER_CONFIG=redis://:changeme@gitea-unittests-valkey-primary.testing.svc.cluster.local:6379/0?pool_size=100&idle_timeout=180s&
- it: "session is configured correctly for 'memory' when valkey (and valkey-cluster) is disabled"
template: templates/gitea/config.yaml
@@ -29,18 +29,19 @@ tests:
path: data["valkey-password"]
value: "Z2l0ZWEtcGFzc3dvcmQ="
- it: "[valkey] renders the referenced service"
template: charts/valkey/templates/headless-svc.yaml
template: charts/valkey/templates/primary/service.yaml
asserts:
- containsDocument:
kind: Service
apiVersion: v1
name: gitea-unittests-valkey-headless
name: gitea-unittests-valkey-primary
namespace: testing
- documentIndex: 0
contains:
path: spec.ports
content:
name: tcp-redis
nodePort: null
port: 6379
targetPort: redis
- it: "[gitea] waits for valkey to be up and running"
@@ -49,4 +50,4 @@ tests:
- documentIndex: 0
matchRegex:
path: stringData["configure_gitea.sh"]
pattern: nc -vz -w2 gitea-unittests-valkey-headless.testing.svc.cluster.local 6379
pattern: nc -vz -w2 gitea-unittests-valkey-primary.testing.svc.cluster.local 6379
+12 -2
View File
@@ -11,9 +11,8 @@ tests:
set:
openshift.enabled: true
asserts:
- equal:
- notExists:
path: spec.template.spec.hostUsers
value: false
- notExists:
path: spec.template.spec.securityContext
- equal:
@@ -94,3 +93,14 @@ tests:
- equal:
path: spec.template.spec.containers[0].securityContext.runAsGroup
value: 1000620000
- it: renders an explicit hostUsers=false override on OpenShift
template: templates/gitea/deployment.yaml
set:
openshift:
enabled: true
hostUsers: false
asserts:
- equal:
path: spec.template.spec.hostUsers
value: false
+11 -2
View File
@@ -9,9 +9,8 @@ tests:
set:
openshift.enabled: true
asserts:
- equal:
- notExists:
path: spec.hostUsers
value: false
- equal:
path: spec.containers[0].securityContext
value:
@@ -22,3 +21,13 @@ tests:
runAsNonRoot: true
seccompProfile:
type: RuntimeDefault
- it: renders an explicit hostUsers=false override for the test pod
set:
openshift:
enabled: true
hostUsers: false
asserts:
- equal:
path: spec.hostUsers
value: false