Compare commits
56
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bbfcd377c1
|
||
|
|
a512d64db0
|
||
|
|
7dfd1bbf82
|
||
|
|
dfce04cab1
|
||
|
|
6cc089ba9c
|
||
|
|
a5579c167e
|
||
|
|
ccb53fca3f
|
||
|
|
be7e739f67
|
||
|
|
ffd2ba1d77
|
||
|
|
1779e3b525
|
||
|
|
3e0d8ac8ee
|
||
|
|
46767730c4
|
||
|
|
778bdc949d
|
||
|
|
37ab116b3e
|
||
|
|
c7279364d1
|
||
|
|
721e17bdb8
|
||
|
|
ea95db78e4
|
||
|
|
39d5e628f7
|
||
|
|
27b0110ef2
|
||
|
|
fbcc3f9cf1
|
||
|
|
797542da41
|
||
|
|
ddd0290b55 | ||
|
|
304f50981d
|
||
|
|
bc23031bd8 | ||
|
|
c623890d6f | ||
|
|
bc875056bd | ||
|
|
79178a18d0 | ||
|
|
b43d59ba88 | ||
|
|
e067bccd57 | ||
|
|
2b5edb77cf | ||
|
|
deedb0f1b3 | ||
|
|
0031a20a40 | ||
|
|
6d68d44894
|
||
|
|
27db0d26b0
|
||
|
|
1b82a15b7f
|
||
|
|
eeacda2a25
|
||
|
|
fef4190a74
|
||
|
|
bb3b59f1ee
|
||
|
|
7c18b18a47
|
||
|
|
6821e792b2
|
||
|
|
9f7064724e
|
||
|
|
49a221008a
|
||
|
|
93a576ca11
|
||
|
|
c96e5d4132
|
||
|
|
ccd470557f
|
||
|
|
c93a96c23d
|
||
|
|
61d04282c8
|
||
|
|
4d1440331d
|
||
|
|
64c2f1a9cc
|
||
|
|
6025d82333
|
||
|
|
4631d42156 | ||
|
|
92c761c9ba | ||
|
|
ccea2082c3
|
||
|
|
4016c5396d
|
||
|
|
d35177ec71
|
||
|
|
e97f3b3bba
|
No files matched your search
@@ -0,0 +1,29 @@
|
||||
name: Bash
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [ "opened", "reopened", "synchronize" ]
|
||||
push:
|
||||
branches:
|
||||
- '**'
|
||||
tags-ignore:
|
||||
- '**'
|
||||
workflow_dispatch: {}
|
||||
|
||||
jobs:
|
||||
bash-unittest:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
submodules: true
|
||||
- env:
|
||||
TERM: xterm
|
||||
name: Run bash unittests
|
||||
run: make bash/unittest
|
||||
|
||||
shellcheck:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- uses: ludeeus/action-shellcheck@00cae500b08a931fb5698e11e79bfbd38e612a38 # 2.0.0
|
||||
@@ -13,7 +13,7 @@ jobs:
|
||||
- name: install tools
|
||||
run: |
|
||||
apk add -q --update --no-cache nodejs curl jq sed
|
||||
- uses: actions/checkout@v7.0.0
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Generate upcoming changelog
|
||||
|
||||
@@ -8,9 +8,9 @@ on:
|
||||
jobs:
|
||||
check-and-test:
|
||||
runs-on: ubuntu-latest
|
||||
container: docker.io/commitlint/commitlint:21.2.1
|
||||
container: docker.io/commitlint/commitlint:21.2.3
|
||||
steps:
|
||||
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- name: Verify PR title
|
||||
run: |
|
||||
echo "${{ gitea.event.pull_request.title }}" | commitlint --config .commitlintrc.json
|
||||
+11
-11
@@ -14,12 +14,12 @@ jobs:
|
||||
helm-lint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
|
||||
- uses: azure/setup-helm@9bc31f4ebc9c6b171d7bfbaa5d006ae7abdb4310 # v5.0.1
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- uses: azure/setup-helm@2f5e7bc67f1f9972ab16657bb795f36d8f04de0e # v5.1.0
|
||||
with:
|
||||
version: v4.3.0 # renovate: datasource=github-releases depName=helm/helm
|
||||
- name: Build helm dependencies
|
||||
run: helm dependency build
|
||||
version: v4.3.2 # renovate: datasource=github-releases depName=helm/helm
|
||||
- name: Update helm dependencies
|
||||
run: helm dependency update
|
||||
- name: Lint helm files
|
||||
run: |
|
||||
helm lint --values values.yaml .
|
||||
@@ -27,15 +27,15 @@ jobs:
|
||||
helm-unittest:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
|
||||
- uses: azure/setup-helm@9bc31f4ebc9c6b171d7bfbaa5d006ae7abdb4310 # v5.0.1
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- uses: azure/setup-helm@2f5e7bc67f1f9972ab16657bb795f36d8f04de0e # v5.1.0
|
||||
with:
|
||||
version: v4.3.0 # renovate: datasource=github-releases depName=helm/helm
|
||||
version: v4.3.2 # renovate: datasource=github-releases depName=helm/helm
|
||||
- env:
|
||||
HELM_UNITTEST_VERSION: v1.0.0 #renovate: datasource=github-releases depName=helm-unittest/helm-unittest
|
||||
HELM_UNITTEST_VERSION: v1.2.1 # renovate: datasource=github-releases depName=helm-unittest/helm-unittest
|
||||
name: Install helm-unittest
|
||||
run: helm plugin install --verify=false --version "${HELM_UNITTEST_VERSION}" https://github.com/helm-unittest/helm-unittest
|
||||
- name: Build helm dependencies
|
||||
run: helm dependency build
|
||||
- name: Update helm dependencies
|
||||
run: helm dependency update
|
||||
- name: Execute helm unittests
|
||||
run: helm unittest --strict --file 'unittests/**/*.yaml' .
|
||||
@@ -15,14 +15,14 @@ on:
|
||||
jobs:
|
||||
markdown-link-checker:
|
||||
container:
|
||||
image: docker.io/library/node:26.8.2-alpine
|
||||
image: docker.io/library/node:26.13.1-alpine
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Install tooling
|
||||
run: |
|
||||
apk update
|
||||
apk add git npm
|
||||
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- name: Verify links in markdown files
|
||||
run: |
|
||||
npm install
|
||||
@@ -30,14 +30,14 @@ jobs:
|
||||
|
||||
markdown-lint:
|
||||
container:
|
||||
image: docker.io/library/node:26.8.2-alpine
|
||||
image: docker.io/library/node:26.13.1-alpine
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Install tooling
|
||||
run: |
|
||||
apk update
|
||||
apk add git
|
||||
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- name: Lint markdown files
|
||||
run: |
|
||||
npm install
|
||||
|
||||
@@ -1,107 +0,0 @@
|
||||
name: generate-chart
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "*"
|
||||
|
||||
jobs:
|
||||
generate-chart-publish:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v7.0.0
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Install packages via apt
|
||||
run: |
|
||||
apt update --yes
|
||||
apt install --yes curl ca-certificates curl gnupg jq
|
||||
|
||||
- name: Install helm
|
||||
env:
|
||||
# renovate: datasource=docker depName=alpine/helm
|
||||
HELM_VERSION: "3.21.3"
|
||||
run: |
|
||||
curl --fail --location --output /dev/stdout --silent --show-error https://get.helm.sh/helm-v${HELM_VERSION}-linux-$(dpkg --print-architecture).tar.gz | tar --extract --gzip --file /dev/stdin
|
||||
mv linux-$(dpkg --print-architecture)/helm /usr/local/bin/
|
||||
rm --force --recursive linux-$(dpkg --print-architecture) helm-v${HELM_VERSION}-linux-$(dpkg --print-architecture).tar.gz
|
||||
helm version
|
||||
|
||||
- name: Install docker-ce via apt
|
||||
run: |
|
||||
install -m 0755 -d /etc/apt/keyrings
|
||||
curl --fail --location --silent --show-error https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
|
||||
chmod a+r /etc/apt/keyrings/docker.gpg
|
||||
echo "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
|
||||
apt update --yes
|
||||
apt install --yes python3 python3-pip apt-transport-https docker-ce-cli
|
||||
|
||||
- name: Install awscli
|
||||
run: |
|
||||
pip install awscli --break-system-packages
|
||||
aws --version
|
||||
|
||||
- name: Import GPG key
|
||||
id: import_gpg
|
||||
uses: https://github.com/crazy-max/ghaction-import-gpg@v7
|
||||
with:
|
||||
gpg_private_key: ${{ secrets.GPGSIGN_KEY }}
|
||||
passphrase: ${{ secrets.GPGSIGN_PASSPHRASE }}
|
||||
fingerprint: CC64B1DB67ABBEECAB24B6455FC346329753F4B0
|
||||
|
||||
- name: Add Artifacthub.io annotations
|
||||
uses: volker-raschek/ah-annotations@v0.2.0
|
||||
|
||||
# Using helm gpg plugin as 'helm package --sign' has issues with gpg2: https://github.com/helm/helm/issues/2843
|
||||
- name: package chart
|
||||
run: |
|
||||
echo ${{ secrets.DOCKER_CHARTS_PASSWORD }} | docker login -u ${{ secrets.DOCKER_CHARTS_USERNAME }} --password-stdin
|
||||
# FIXME: use upstream after https://github.com/technosophos/helm-gpg/issues/1 is solved
|
||||
helm plugin install https://github.com/pat-s/helm-gpg
|
||||
helm dependency build
|
||||
helm package --version "${GITHUB_REF#refs/tags/v}" ./
|
||||
mkdir gitea
|
||||
mv gitea*.tgz gitea/
|
||||
curl --fail --location --output gitea/index.yaml --silent --show-error https://dl.gitea.com/charts/index.yaml
|
||||
helm repo index gitea/ --url https://dl.gitea.com/charts --merge gitea/index.yaml
|
||||
# push to dockerhub
|
||||
echo ${{ secrets.DOCKER_CHARTS_PASSWORD }} | helm registry login -u ${{ secrets.DOCKER_CHARTS_USERNAME }} registry-1.docker.io --password-stdin
|
||||
helm push gitea/gitea-${GITHUB_REF#refs/tags/v}.tgz oci://registry-1.docker.io/giteacharts
|
||||
helm registry logout registry-1.docker.io
|
||||
|
||||
- name: Copy files to Cloudflare R2
|
||||
env:
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.CLOUDFLARE_R2_ACCESS_KEY_ID }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.CLOUDFLARE_R2_SECRET_ACCESS_KEY }}
|
||||
AWS_DEFAULT_REGION: auto
|
||||
CLOUDFLARE_R2_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_R2_ACCOUNT_ID }}
|
||||
CLOUDFLARE_R2_BUCKET: ${{ secrets.CLOUDFLARE_R2_BUCKET }}
|
||||
run: |
|
||||
aws s3 sync gitea/ s3://${CLOUDFLARE_R2_BUCKET}/charts/ --endpoint-url https://${CLOUDFLARE_R2_ACCOUNT_ID}.r2.cloudflarestorage.com
|
||||
|
||||
release-gitea:
|
||||
needs: generate-chart-publish
|
||||
runs-on: ubuntu-latest
|
||||
container: docker.io/thegeeklab/git-sv:2.1.3
|
||||
steps:
|
||||
- name: install tools
|
||||
run: |
|
||||
apk add -q --update --no-cache nodejs
|
||||
- uses: actions/checkout@v7.0.0
|
||||
with:
|
||||
fetch-tags: true
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Create changelog
|
||||
run: |
|
||||
git sv current-version
|
||||
git sv release-notes -t ${GITHUB_REF#refs/tags/} -o CHANGELOG.md
|
||||
sed -i '1,2d' CHANGELOG.md # remove version
|
||||
cat CHANGELOG.md
|
||||
|
||||
- name: Release
|
||||
uses: https://github.com/akkuman/gitea-release-action@v1
|
||||
with:
|
||||
body_path: CHANGELOG.md
|
||||
token: "${{ secrets.RELEASE_TOKEN }}"
|
||||
@@ -0,0 +1,222 @@
|
||||
name: Release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "**"
|
||||
|
||||
jobs:
|
||||
publish-chart:
|
||||
env:
|
||||
GPG_PRIVATE_KEY_FINGERPRINT: "CC64B1DB67ABBEECAB24B6455FC346329753F4B0"
|
||||
GPG_PRIVATE_KEY_PASSPHRASE_FILE: ${{ runner.temp }}/passphrase.txt
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
# NOTE:
|
||||
# Install Docker because the Gitea ubuntu-latest runner does not include it.
|
||||
# The action docker/setup-docker-action can not be used, because of internal Firewall rules of the Gitea runner.
|
||||
# For this reason will be installed docker directly from distribution packages.
|
||||
- name: Install Docker
|
||||
run: |
|
||||
apt update --yes
|
||||
apt install --yes curl ca-certificates gnupg
|
||||
|
||||
install -m 0755 -d /etc/apt/keyrings
|
||||
curl \
|
||||
--fail \
|
||||
--location \
|
||||
--silent \
|
||||
--show-error \
|
||||
https://download.docker.com/linux/ubuntu/gpg | gpg --batch --yes --dearmor -o /etc/apt/keyrings/docker.gpg
|
||||
chmod a+r /etc/apt/keyrings/docker.gpg
|
||||
|
||||
# Add APT-List for docker-ce
|
||||
. /etc/os-release
|
||||
cat > /etc/apt/sources.list.d/docker.list <<EOF
|
||||
deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu ${VERSION_CODENAME} stable
|
||||
EOF
|
||||
|
||||
apt update --yes
|
||||
apt install --yes apt-transport-https docker-ce-cli
|
||||
|
||||
# NOTE:
|
||||
# Use volker-raschek/cosign-installer, because envsubst is currently not supported.
|
||||
# The maintainers of cosign-installer have not yet merged the PR. Further information under the following URL:
|
||||
# https://github.com/sigstore/cosign-installer/pull/236
|
||||
- uses: volker-raschek/cosign-installer@7643eed6736a199595ed2a31e9979ec353a88adb # v4.1.3-rc3
|
||||
with:
|
||||
cosign-release: "v3.1.3" # renovate: datasource=github-tags depName=sigstore/cosign
|
||||
|
||||
- name: Install Python
|
||||
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
|
||||
with:
|
||||
python-version: "3.12"
|
||||
|
||||
- name: Install awscli via pip
|
||||
run: |
|
||||
pip install --break-system-packages awscli
|
||||
aws --version
|
||||
|
||||
- uses: azure/setup-helm@9bc31f4ebc9c6b171d7bfbaa5d006ae7abdb4310 # v5.0.1
|
||||
with:
|
||||
version: "v4.3.2" # renovate: datasource=github-tags depName=helm/helm
|
||||
|
||||
- name: Install helm plugins
|
||||
env:
|
||||
HELM_SIGSTORE_VERSION: "0.3.0" # renovate: datasource=github-tags depName=sigstore/helm-sigstore extractVersion='^v(?<version>\d+\.\d+\.\d+)$'
|
||||
HELM_SCHEMA_VALUES_VERSION: "2.6.0" # renovate: datasource=github-tags depName=losisin/helm-values-schema-json extractVersion='^v(?<version>\d+\.\d+\.\d+)$'
|
||||
HELM_UNITTEST_VERSION: "1.2.1" # renovate: datasource=github-tags depName=helm-unittest/helm-unittest extractVersion='^v(?<version>\d+\.\d+\.\d+)$'
|
||||
run: |
|
||||
helm plugin install --verify=false https://github.com/sigstore/helm-sigstore.git --version "${HELM_SIGSTORE_VERSION}" 1> /dev/null
|
||||
helm plugin install --verify=false https://github.com/losisin/helm-values-schema-json.git --version "${HELM_SCHEMA_VALUES_VERSION}" 1> /dev/null
|
||||
helm plugin install --verify=false https://github.com/helm-unittest/helm-unittest.git --version "${HELM_UNITTEST_VERSION}" 1> /dev/null
|
||||
helm plugin list
|
||||
|
||||
- name: GPG configuration
|
||||
env:
|
||||
GPG_PRIVATE_KEY_FILE: ${{ runner.temp }}/private.key
|
||||
GPG_PRIVATE_KEY_PASSPHRASE: ${{ secrets.GPGSIGN_PASSPHRASE }}
|
||||
GPG_PRIVATE_KEY: ${{ secrets.GPGSIGN_KEY }}
|
||||
run: |
|
||||
# Configure GPG and GPG Agent
|
||||
mkdir --parents "${HOME}/.gnupg"
|
||||
chmod 0700 "${HOME}/.gnupg"
|
||||
|
||||
cat > "${HOME}/.gnupg/gpg.conf" <<EOF
|
||||
use-agent
|
||||
pinentry-mode loopback
|
||||
EOF
|
||||
|
||||
cat > "${HOME}/.gnupg/gpg-agent.conf" <<EOF
|
||||
allow-loopback-pinentry
|
||||
max-cache-ttl 86400
|
||||
default-cache-ttl 86400
|
||||
EOF
|
||||
|
||||
gpgconf --kill gpg-agent
|
||||
gpgconf --launch gpg-agent
|
||||
|
||||
# Import GPG private key
|
||||
cat 1> "${GPG_PRIVATE_KEY_PASSPHRASE_FILE}" <<< "${GPG_PRIVATE_KEY_PASSPHRASE}"
|
||||
cat 1> "${GPG_PRIVATE_KEY_FILE}" <<< "${GPG_PRIVATE_KEY}"
|
||||
gpg --batch --yes --passphrase-fd 0 --import "${GPG_PRIVATE_KEY_FILE}" <<< "${GPG_PRIVATE_KEY_PASSPHRASE}"
|
||||
|
||||
# Export GPG keyring
|
||||
gpg --batch --yes --export "${GPG_PRIVATE_KEY_FINGERPRINT}" 1> "${HOME}/.gnupg/pubring.gpg"
|
||||
gpg --batch --yes --passphrase-fd 0 --export-secret-keys "${GPG_PRIVATE_KEY_FINGERPRINT}" 1> "${HOME}/.gnupg/secring.gpg" <<< "${GPG_PRIVATE_KEY_PASSPHRASE}"
|
||||
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- uses: volker-raschek/ah-annotations@5b4361f7865c1e71a9ce2263df1c780871e0fee8 # v0.2.5
|
||||
|
||||
- name: Extract meta information
|
||||
run: |
|
||||
echo "GITEA_SERVER_HOSTNAME=$(echo "${GITHUB_SERVER_URL}" | cut --delimiter '/' --fields 3)" >> $GITHUB_ENV
|
||||
echo "PACKAGE_NAME=gitea" >> $GITHUB_ENV
|
||||
echo "PACKAGE_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
|
||||
echo "REPOSITORY_NAME==$(echo ${GITHUB_REPOSITORY} | cut --delimiter '/' --fields 2)" >> $GITHUB_ENV
|
||||
echo "REPOSITORY_OWNER=$(echo ${GITHUB_REPOSITORY} | cut --delimiter '/' --fields 1)" >> $GITHUB_ENV
|
||||
|
||||
# Packaging
|
||||
- name: Update Helm Chart version in README.md
|
||||
run: sed -i -E "s/^CHART_VERSION=.*/CHART_VERSION=${PACKAGE_VERSION}/g" README.md
|
||||
|
||||
- name: Package chart
|
||||
run: |
|
||||
helm repo add valkey https://valkey.io/valkey-helm
|
||||
helm dependency build
|
||||
helm package \
|
||||
--sign \
|
||||
--key "$(gpg --with-colons --list-keys "${GPG_PRIVATE_KEY_FINGERPRINT}" | grep uid | cut --delimiter ':' --fields 10)" \
|
||||
--keyring "${HOME}/.gnupg/secring.gpg" \
|
||||
--passphrase-file "${GPG_PRIVATE_KEY_PASSPHRASE_FILE}" \
|
||||
--version "${PACKAGE_VERSION}" ./
|
||||
|
||||
mkdir --parents gitea
|
||||
mv "${PACKAGE_NAME}-${PACKAGE_VERSION}.tgz" gitea/
|
||||
if [ -f "${PACKAGE_NAME}-${PACKAGE_VERSION}.tgz.prov" ]; then
|
||||
mv "${PACKAGE_NAME}-${PACKAGE_VERSION}.tgz.prov" gitea/
|
||||
fi
|
||||
|
||||
curl \
|
||||
--fail \
|
||||
--location \
|
||||
--silent \
|
||||
--show-error \
|
||||
--output gitea/index.yaml \
|
||||
https://dl.gitea.com/charts/index.yaml
|
||||
|
||||
helm repo index gitea/ --url https://dl.gitea.com/charts --merge gitea/index.yaml
|
||||
|
||||
- uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0
|
||||
with:
|
||||
registry: registry-1.docker.io
|
||||
username: ${{ secrets.DOCKER_CHARTS_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_CHARTS_PASSWORD }}
|
||||
|
||||
# Uploads
|
||||
- name: Upload Chart to docker.io (OCI)
|
||||
env:
|
||||
COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSPHRASE }}
|
||||
COSIGN_PRIVATE_KEY: ${{ secrets.COSIGN_KEY }}
|
||||
DOCKER_CHARTS_PASSWORD: ${{ secrets.DOCKER_CHARTS_PASSWORD }}
|
||||
DOCKER_CHARTS_USERNAME: ${{ secrets.DOCKER_CHARTS_USERNAME }}
|
||||
run: |
|
||||
# Helm is not able to reuse the login credentials of the docker-login action. The docker-login action can also
|
||||
# not removed, because cosign requires the docker auth.json for uploading the signature. For this reason, we
|
||||
# need to login manually.
|
||||
printf '%s' "${DOCKER_CHARTS_PASSWORD}" | helm registry login -u "${DOCKER_CHARTS_USERNAME}" registry-1.docker.io --password-stdin
|
||||
|
||||
helm push gitea/${PACKAGE_NAME}-${PACKAGE_VERSION}.tgz oci://registry-1.docker.io/giteacharts
|
||||
cosign sign --yes --upload=true --key=env://COSIGN_PRIVATE_KEY registry-1.docker.io/giteacharts/${PACKAGE_NAME}:${PACKAGE_VERSION}
|
||||
|
||||
helm registry logout registry-1.docker.io
|
||||
|
||||
- name: Upload Chart to Cloudflare R2 (Helm)
|
||||
env:
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.CLOUDFLARE_R2_ACCESS_KEY_ID }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.CLOUDFLARE_R2_SECRET_ACCESS_KEY }}
|
||||
AWS_DEFAULT_REGION: auto
|
||||
CLOUDFLARE_R2_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_R2_ACCOUNT_ID }}
|
||||
CLOUDFLARE_R2_BUCKET: ${{ secrets.CLOUDFLARE_R2_BUCKET }}
|
||||
run: |
|
||||
aws s3 sync gitea/ s3://${CLOUDFLARE_R2_BUCKET}/charts/ \
|
||||
--endpoint-url https://${CLOUDFLARE_R2_ACCOUNT_ID}.r2.cloudflarestorage.com
|
||||
|
||||
release-gitea:
|
||||
needs: publish-chart
|
||||
runs-on: ubuntu-latest
|
||||
container: docker.io/thegeeklab/git-sv:2.1.3
|
||||
steps:
|
||||
- name: install tools
|
||||
run: |
|
||||
apk add -q --update --no-cache nodejs
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
fetch-tags: true
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Create changelog
|
||||
run: |
|
||||
git sv current-version
|
||||
git sv release-notes -t ${GITHUB_REF#refs/tags/} -o CHANGELOG.md
|
||||
sed -i '1,2d' CHANGELOG.md # remove version
|
||||
cat CHANGELOG.md
|
||||
|
||||
- name: Detect prerelease
|
||||
id: prerelease
|
||||
run: |
|
||||
if printf '%s\n' "${GITHUB_REF#refs/tags/}" | grep -Eq -- '-[a-zA-Z0-9]+([-.][a-zA-Z0-9]+)*$'; then
|
||||
echo 'prerelease=true' >> "${GITHUB_OUTPUT}"
|
||||
else
|
||||
echo 'prerelease=false' >> "${GITHUB_OUTPUT}"
|
||||
fi
|
||||
|
||||
- name: Release
|
||||
uses: https://github.com/akkuman/gitea-release-action@v1
|
||||
with:
|
||||
body_path: CHANGELOG.md
|
||||
prerelease: ${{ steps.prerelease.outputs.prerelease }}
|
||||
token: "${{ secrets.RELEASE_TOKEN }}"
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
## Project Overview
|
||||
|
||||
Kubernetes Helm chart for deploying [Gitea](https://gitea.com). Uses Go/Helm templating (`templates/`), YAML values (`values.yaml`), and includes sub-charts for PostgreSQL, PostgreSQL-HA, Valkey, and Valkey-cluster.
|
||||
Kubernetes Helm chart for deploying [Gitea](https://gitea.com). Uses Go/Helm templating (`templates/`), YAML values (`values.yaml`), and includes a sub-chart for Valkey. The database is provisioned as a CloudNativePG `Cluster` resource, the operator itself is not part of the chart.
|
||||
|
||||
## Build & Test
|
||||
|
||||
@@ -43,15 +43,24 @@ image:
|
||||
- Use plural for `*.tpl` files, because they may contain functions for multiple resources of the same kind (e.g. `_services.tpl` for `httpService.yaml` or `sshService.yaml`, `_backendTLSPolicies.tpl` for `backendTLSPolicy.yaml`).
|
||||
- Use as prefix of YAML files the resource kind (e.g., `deployment.yaml` for `Deployment` resources). If there are multiple resources of the same kind, use a descriptive suffix (e.g., `deployment_metrics.yaml` for a `Deployment` related to metrics).
|
||||
- Short names like `pvc` for Persistent Volume Claims or `svc` for Services are not allowed in file names or key names.
|
||||
- Render `Secret` payloads as base64 `data` and never as `stringData`. The API server drops `stringData` and persists everything under `data`, so Helm's three-way merge cannot prune a key that was removed from the values — the stale key survives every upgrade. For example:
|
||||
|
||||
```yaml
|
||||
data:
|
||||
app.ini: {{ $config | b64enc }}
|
||||
```
|
||||
|
||||
### Unit Tests
|
||||
|
||||
- Helm unit tests live in `unittests/helm/` mirroring the template structure.
|
||||
- Helm unit tests live in `unittests/helm/` mirroring the template structure. A suite belongs into the directory of the template it asserts on, never into the directory of a template it only renders as a side effect.
|
||||
- Test files are YAML using the [helm-unittest](https://github.com/helm-unittest/helm-unittest) format.
|
||||
- Name test files in camelCase after the scenario they cover (e.g. `signingEnabled.yaml`), use `basics.yaml` for the default scenario and do not repeat the directory name in the file name. The `make helm/unittest` glob only matches one directory level, so every suite must live in a subdirectory.
|
||||
- Each test must set all required values explicitly — do not rely on cross-test state.
|
||||
- The `values.yaml` file must pass `yamllint`. The configuration is in `.yamllint.yaml`. Use `make yamllint` to run the linter.
|
||||
- The title of the unit test should clearly describe the scenario being tested. As title must be use a short sentence starting with a capital letter and ending without a period.
|
||||
- The `suite` title follows the pattern `Test <subject> <scenario>` (e.g. `Test deployment probes`). It must be unique across all suites, because `helm unittest` identifies a failing suite by this title.
|
||||
- Each unit test must explicitly set a custom namespace and release name, rather than relying on defaults.
|
||||
- Assert `Secret` content via `data.*` with `decodeBase64: true` and add a `notExists` assertion for `stringData`.
|
||||
|
||||
### Commits & PRs
|
||||
|
||||
|
||||
+1
-1
@@ -36,6 +36,6 @@ unittests/
|
||||
.prettierignore
|
||||
.yamllint
|
||||
CODEOWNERS
|
||||
renovate.json5
|
||||
renovate.json
|
||||
.commitlintrc.json
|
||||
.gitsv/
|
||||
Vendored
+2
-3
@@ -1,11 +1,10 @@
|
||||
{
|
||||
"yaml.schemas": {
|
||||
"https://raw.githubusercontent.com/helm-unittest/helm-unittest/v1.1.1/schema/helm-testsuite.json": [
|
||||
"https://raw.githubusercontent.com/helm-unittest/helm-unittest/v1.2.1/schema/helm-testsuite.json": [
|
||||
"/unittests/**/*.yaml"
|
||||
],
|
||||
"https://docs.renovatebot.com/renovate-schema.json":[
|
||||
"renovate.json",
|
||||
"renovate.json5"
|
||||
"renovate.json"
|
||||
]
|
||||
},
|
||||
"yaml.schemaStore.enable": true,
|
||||
|
||||
+3
-9
@@ -1,12 +1,6 @@
|
||||
dependencies:
|
||||
- name: postgresql
|
||||
repository: oci://registry-1.docker.io/bitnamicharts
|
||||
version: 16.7.27
|
||||
- name: postgresql-ha
|
||||
repository: oci://registry-1.docker.io/bitnamicharts
|
||||
version: 16.3.2
|
||||
- name: valkey
|
||||
repository: https://valkey.io/valkey-helm
|
||||
version: 0.10.0
|
||||
digest: sha256:1afecbf0d4fc9f48e31417573d4bed7e0ac7848040b9e0c5f3989ada9d1f944f
|
||||
generated: "2026-07-20T19:52:11.548874634+02:00"
|
||||
version: 0.12.1
|
||||
digest: sha256:dc282754229a0125cdabc537ba42b26abf4cba2931d1dd68ae507cb2e16dc13a
|
||||
generated: "2026-11-07T00:04:26.620539138Z"
|
||||
+2
-12
@@ -3,7 +3,7 @@ name: gitea
|
||||
description: Gitea Helm chart for Kubernetes
|
||||
type: application
|
||||
version: 0.0.0
|
||||
appVersion: 1.27.3
|
||||
appVersion: 28.0.0
|
||||
icon: https://gitea.com/assets/img/logo.svg
|
||||
|
||||
annotations:
|
||||
@@ -36,18 +36,8 @@ maintainers:
|
||||
email: christopher.homberger@web.de
|
||||
|
||||
dependencies:
|
||||
# https://github.com/bitnami/charts/blob/main/bitnami/postgresql
|
||||
- name: postgresql
|
||||
repository: oci://registry-1.docker.io/bitnamicharts
|
||||
version: 16.7.27
|
||||
condition: postgresql.enabled
|
||||
# https://github.com/bitnami/charts/blob/main/bitnami/postgresql-ha/Chart.yaml
|
||||
- name: postgresql-ha
|
||||
repository: oci://registry-1.docker.io/bitnamicharts
|
||||
version: 16.3.2
|
||||
condition: postgresql-ha.enabled
|
||||
# https://github.com/bitnami/charts/blob/main/bitnami/valkey/Chart.yaml
|
||||
- name: valkey
|
||||
repository: https://valkey.io/valkey-helm
|
||||
version: 0.10.0
|
||||
version: 0.12.1
|
||||
condition: valkey.enabled
|
||||
@@ -39,7 +39,14 @@ helm/dependency-update:
|
||||
# ==============================================================================
|
||||
PHONY+=helm/unittest
|
||||
helm/unittest:
|
||||
helm unittest --strict --file 'unittests/helm/**/*.yaml' --file 'unittests/helm/values-conflicting-checks.yaml' ./
|
||||
helm unittest --strict --file 'unittests/helm/**/*.yaml' ./
|
||||
|
||||
# BASH PREPARE
|
||||
# ==============================================================================
|
||||
PHONY+=bash/prepare
|
||||
bash/prepare:
|
||||
git submodule init
|
||||
git submodule update
|
||||
|
||||
# BASH UNITTESTS
|
||||
# ==============================================================================
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
- [Update and versioning policy](#update-and-versioning-policy)
|
||||
- [Dependencies](#dependencies)
|
||||
- [HA Dependencies](#ha-dependencies)
|
||||
- [Non-HA Dependencies](#non-ha-dependencies)
|
||||
- [Dependency Versioning](#dependency-versioning)
|
||||
- [Installing](#installing)
|
||||
- [High Availability](#high-availability)
|
||||
- [Limit resources](#limit-resources)
|
||||
- [Configuration](#configuration)
|
||||
- [Default Configuration](#default-configuration)
|
||||
- [Rebuilding app.ini](#rebuilding-appini)
|
||||
- [Database defaults](#database-defaults)
|
||||
- [Server defaults](#server-defaults)
|
||||
- [Metrics defaults](#metrics-defaults)
|
||||
@@ -19,6 +19,7 @@
|
||||
- [Gateway API](#gateway-api)
|
||||
- [Session, Cache and Queue](#session-cache-and-queue)
|
||||
- [Single-Pod Configurations](#single-pod-configurations)
|
||||
- [Additional app.ini settings](#additional-appini-settings)
|
||||
- [User defined environment variables in app.ini](#user-defined-environment-variables-in-appini)
|
||||
- [External Database](#external-database)
|
||||
- [Ports and external url](#ports-and-external-url)
|
||||
@@ -56,9 +57,8 @@
|
||||
- [LivenessProbe](#livenessprobe)
|
||||
- [ReadinessProbe](#readinessprobe)
|
||||
- [StartupProbe](#startupprobe)
|
||||
- [CloudNativePG](#cloudnativepg)
|
||||
- [valkey](#valkey)
|
||||
- [PostgreSQL HA](#postgresql-ha)
|
||||
- [PostgreSQL](#postgresql)
|
||||
- [Advanced](#advanced)
|
||||
- [Contributing](#contributing)
|
||||
- [Upgrading](#upgrading)
|
||||
@@ -96,24 +96,21 @@ Users can also configure their own external providers via the configuration.
|
||||
|
||||
### HA Dependencies
|
||||
|
||||
These dependencies are enabled by default:
|
||||
- PostgreSQL ([CloudNativePG](https://cloudnative-pg.io/)), disabled by default
|
||||
- Valkey ([Official Valkey Helm Chart](https://github.com/valkey-io/valkey-helm)), enabled by default
|
||||
|
||||
- PostgreSQL HA ([Bitnami PostgreSQL-HA](https://github.com/bitnami/charts/blob/main/bitnami/postgresql-ha/Chart.yaml))
|
||||
- Valkey ([Official Valkey Helm Chart](https://github.com/valkey-io/valkey-helm))
|
||||
|
||||
### Non-HA Dependencies
|
||||
|
||||
Alternatively, the following non-HA replacements are available:
|
||||
|
||||
- PostgreSQL ([Bitnami PostgreSQL](https://github.com/bitnami/charts/blob/main/bitnami/postgresql/Chart.yaml))
|
||||
CloudNativePG is **not** bundled as a sub-chart.
|
||||
Only the `Cluster` resource is rendered by this chart, the [CloudNativePG operator](https://cloudnative-pg.io/documentation/current/installation_upgrade/) must already be installed cluster-wide.
|
||||
Because that operator cannot be assumed to be present, `cloudnativePG.enabled` defaults to `false`.
|
||||
Set it to `true` once the operator is installed, or use an external database instead.
|
||||
|
||||
### Dependency Versioning
|
||||
|
||||
Updates of sub-charts will be incorporated into the Gitea chart as they are released.
|
||||
The reasoning behind this is that new users of the chart will start with the most recent sub-chart dependency versions.
|
||||
|
||||
**Note** If you want to stay on an older appVersion of a sub-chart dependency (e.g. PostgreSQL), you need to override the image tag in your `values.yaml` file.
|
||||
In fact, we recommend to do so right from the start to be independent of major sub-chart dependency changes as they are released.
|
||||
**Note** If you want to stay on an older appVersion of a dependency (e.g. PostgreSQL), you need to override the image tag in your `values.yaml` file.
|
||||
In fact, we recommend to do so right from the start to be independent of major dependency changes as they are released.
|
||||
There is no need to update to every new PostgreSQL major version - you can happily skip some and do larger updates when you are ready for them.
|
||||
|
||||
We recommend to use a rolling tag like `:<majorVersion>-debian-<debian major version>` to incorporate minor and patch updates for the respective major version as they are released.
|
||||
@@ -121,8 +118,7 @@ Alternatively you can also use a versioning helper tool like [renovate](https://
|
||||
|
||||
Please double-check the image repository and available tags in the sub-chart:
|
||||
|
||||
- [PostgreSQL-HA](https://hub.docker.com/r/bitnami/postgresql-repmgr/tags)
|
||||
- [PostgreSQL](https://hub.docker.com/r/bitnami/postgresql/tags)
|
||||
- [CloudNativePG](https://github.com/cloudnative-pg/postgres-containers/pkgs/container/postgresql)
|
||||
- [Valkey](https://hub.docker.com/r/valkey/valkey/tags)
|
||||
|
||||
and look up the image tag which fits your needs on Dockerhub.
|
||||
@@ -219,20 +215,30 @@ INSTALL_LOCK is always set to true, since we want to configure Gitea with this h
|
||||
|
||||
_All default settings are made directly in the generated `app.ini`, not in the Values._
|
||||
|
||||
#### Rebuilding app.ini
|
||||
|
||||
By default, removed settings remain in an existing `app.ini`.
|
||||
Set `deployment.initAppIni.config.rebuild` to `true` to rebuild it on startup from the current configuration sources.
|
||||
The existing `security.SECRET_KEY`, `security.INTERNAL_TOKEN`, `oauth2.JWT_SECRET`, and `server.LFS_JWT_SECRET` are preserved.
|
||||
All other settings that are present only in `app.ini`, including manually managed secrets, are removed.
|
||||
|
||||
#### Database defaults
|
||||
|
||||
If a builtIn database is enabled the database configuration is set automatically.
|
||||
For example, PostgreSQL builtIn will appear in the `app.ini` as:
|
||||
For example, the CloudNativePG `Cluster` will appear in the `app.ini` as:
|
||||
|
||||
```ini
|
||||
[database]
|
||||
DB_TYPE = postgres
|
||||
HOST = RELEASE-NAME-postgresql.default.svc.cluster.local:5432
|
||||
HOST = RELEASE-NAME-postgresql-rw.default.svc.cluster.local:5432
|
||||
NAME = gitea
|
||||
PASSWD = gitea
|
||||
USER = gitea
|
||||
```
|
||||
|
||||
`PASSWD` is not part of the generated `app.ini`.
|
||||
It is injected into the `init-app-ini` init container as the `GITEA__database__PASSWD` environment variable, sourced
|
||||
from the credentials Secret referenced by `cloudnativePG.credentials`, and merged into the `app.ini` at startup.
|
||||
|
||||
#### Server defaults
|
||||
|
||||
The server defaults are a bit more complex.
|
||||
@@ -334,7 +340,7 @@ External tools such as `valkey` or `memcached` handle these workloads much bette
|
||||
|
||||
If HA is not needed/desired, the following configurations can be used to deploy a single-pod Gitea instance.
|
||||
|
||||
1. For a production-ready single-pod Gitea instance without external dependencies (using the chart dependency `postgresql` and `valkey`):
|
||||
1. For a production-ready single-pod Gitea instance (using the chart dependency `valkey` and a single-instance CloudNativePG `Cluster`):
|
||||
|
||||
<details>
|
||||
|
||||
@@ -343,10 +349,9 @@ If HA is not needed/desired, the following configurations can be used to deploy
|
||||
```yaml
|
||||
valkey:
|
||||
enabled: true
|
||||
postgresql:
|
||||
cloudnativePG:
|
||||
enabled: true
|
||||
postgresql-ha:
|
||||
enabled: false
|
||||
instances: 1
|
||||
|
||||
persistence:
|
||||
enabled: true
|
||||
@@ -374,9 +379,7 @@ If HA is not needed/desired, the following configurations can be used to deploy
|
||||
```yaml
|
||||
valkey:
|
||||
enabled: false
|
||||
postgresql:
|
||||
enabled: false
|
||||
postgresql-ha:
|
||||
cloudnativePG:
|
||||
enabled: false
|
||||
|
||||
persistence:
|
||||
@@ -396,7 +399,7 @@ If HA is not needed/desired, the following configurations can be used to deploy
|
||||
|
||||
</details>
|
||||
|
||||
### Additional _app.ini_ settings
|
||||
### Additional app.ini settings
|
||||
|
||||
> **The [generic](https://docs.gitea.com/administration/config-cheat-sheet#overall-default)
|
||||
> section cannot be defined that way.**
|
||||
@@ -479,16 +482,27 @@ gitea:
|
||||
|
||||
Priority (highest to lowest) for defining app.ini variables:
|
||||
|
||||
1. Environment variables prefixed with `GITEA`
|
||||
1. Environment variables prefixed with `GITEA__`
|
||||
1. Additional config sources
|
||||
1. Values defined in `gitea.config`
|
||||
1. Automatically generated initial secrets
|
||||
|
||||
Setting names are case-sensitive. Encode `.` as `_0X2E_` and `-` as `_0X2D_` in environment variable names.
|
||||
Append `__FILE` to read a setting value from a file, as supported by Gitea.
|
||||
Section names are case-insensitive, and differently encoded names can refer to the same setting.
|
||||
If multiple predefined environment variables refer to the same setting, the init container fails with a conflict error;
|
||||
remove the duplicate variables before restarting it.
|
||||
|
||||
When `app.ini` already exists, the chart preserves `security.SECRET_KEY`, `security.INTERNAL_TOKEN`,
|
||||
`oauth2.JWT_SECRET`, and `server.LFS_JWT_SECRET` instead of overwriting them from any configuration source.
|
||||
This also applies to environment variables using `__FILE` or encoded names.
|
||||
|
||||
### External Database
|
||||
|
||||
Any external database listed in [https://docs.gitea.com/installation/database-prep/](https://docs.gitea.com/installation/database-prep/) can be used instead of the built-in PostgreSQL.
|
||||
In fact, it is **highly recommended** to use an external database to ensure a stable Gitea installation longterm.
|
||||
|
||||
If an external database is used, no matter which type, make sure to set `postgresql.enabled` to `false` to disable the use of the built-in PostgreSQL.
|
||||
If an external database is used, no matter which type, make sure to set `cloudnativePG.enabled` to `false` to disable the use of the built-in PostgreSQL.
|
||||
|
||||
```yaml
|
||||
gitea:
|
||||
@@ -501,10 +515,7 @@ gitea:
|
||||
PASSWD: gitea
|
||||
SCHEMA: gitea
|
||||
|
||||
postgresql:
|
||||
enabled: false
|
||||
|
||||
postgresql-ha:
|
||||
cloudnativePG:
|
||||
enabled: false
|
||||
```
|
||||
|
||||
@@ -607,14 +618,14 @@ persistence:
|
||||
|
||||
In case that persistence has been disabled it will simply use an empty dir volume.
|
||||
|
||||
PostgreSQL handles the persistence in the exact same way.
|
||||
You can interact with the postgres settings as displayed in the following example:
|
||||
The CloudNativePG `Cluster` handles the persistence on its own.
|
||||
You can interact with its storage settings as displayed in the following example:
|
||||
|
||||
```yaml
|
||||
postgresql:
|
||||
persistence:
|
||||
enabled: true
|
||||
existingClaim: MyAwesomeGiteaPostgresClaim
|
||||
cloudnativePG:
|
||||
storage:
|
||||
size: 20Gi
|
||||
storageClass: myOwnStorageClass
|
||||
```
|
||||
|
||||
### Admin User
|
||||
@@ -1034,8 +1045,8 @@ To comply with the Gitea helm chart definition of the digest parameter, a "custo
|
||||
| `deployment.labels` | Labels for the deployment. | `{}` |
|
||||
| `deployment.affinity` | Affinity for the deployment. | `{}` |
|
||||
| `deployment.dnsConfig` | dnsConfig of the Gitea deployment. | `{}` |
|
||||
| `deployment.gitea.env` | Additional environment variables to pass to the gitea container. | `[]` |
|
||||
| `deployment.gitea.envFrom` | List of environment variables mounted from configMaps or secrets for the gitea container. | `[]` |
|
||||
| `deployment.gitea.env` | Additional environment variables to pass to the Gitea container. | `[]` |
|
||||
| `deployment.gitea.envFrom` | List of environment variables mounted from configMaps or secrets for the Gitea container. | `[]` |
|
||||
| `deployment.gitea.image.registry` | image registry, e.g. gcr.io,docker.io. | `docker.gitea.com` |
|
||||
| `deployment.gitea.image.repository` | Image to start for this pod. | `gitea` |
|
||||
| `deployment.gitea.image.tag` | Visit: [Image tag](https://hub.docker.com/r/gitea/gitea/tags?page=1&ordering=last_updated). Defaults to `appVersion` within Chart.yaml. | `""` |
|
||||
@@ -1060,6 +1071,7 @@ To comply with the Gitea helm chart definition of the digest parameter, a "custo
|
||||
| `deployment.initDirectories.resources` | Compute Resources required by the initDirectories container. Defaults to `initContainers.resources`. Cannot be updated. | `nil` |
|
||||
| `deployment.initDirectories.securityContext` | Security context of the initDirectories container. Defaults to `deployment.gitea.securityContext`. | `{}` |
|
||||
| `deployment.initDirectories.volumeMounts` | Additional volume mounts. | `[]` |
|
||||
| `deployment.initAppIni.config.rebuild` | Rebuild app.ini on startup, preserving Gitea secret keys but removing unmanaged settings. | `false` |
|
||||
| `deployment.initAppIni.env` | Additional environment variables to pass to the init container. | `[]` |
|
||||
| `deployment.initAppIni.envFrom` | List of environment variables mounted from configMaps or secrets for the initAppIni container. | `[]` |
|
||||
| `deployment.initAppIni.image.registry` | image registry, e.g. gcr.io,docker.io. | `docker.gitea.com` |
|
||||
@@ -1121,7 +1133,7 @@ To comply with the Gitea helm chart definition of the digest parameter, a "custo
|
||||
| `gatewayAPI.core.backendTLSPolicy.targetRefs` | Target references for the BackendTLSPolicy. Defaults to the HTTP service. | `[]` |
|
||||
| `gatewayAPI.core.backendTLSPolicy.validation` | Validation configuration (required when enabled). See `docs/gateway-api.md`. | `{}` |
|
||||
| `gatewayAPI.core.backendTLSPolicy.validation.caCertificateRefs` | CA certificate references for the BackendTLSPolicy validation. See `docs/gateway-api.md`. | |
|
||||
| `gatewayAPI.core.backendTLSPolicy.validation.hostname` | Hostname for the BackendTLSPolicy validation. Must be the Common Name (CN) or a Subject Alternative Name (SAN) of the gitea server certificate. See `docs/gateway-api.md`. | |
|
||||
| `gatewayAPI.core.backendTLSPolicy.validation.hostname` | Hostname for the BackendTLSPolicy validation. Must be the Common Name (CN) or a Subject Alternative Name (SAN) of the Gitea server certificate. See `docs/gateway-api.md`. | |
|
||||
| `gatewayAPI.core.httpRoute.enabled` | Render an HTTPRoute resource. | `false` |
|
||||
| `gatewayAPI.core.httpRoute.annotations` | Annotations applied to the HTTPRoute. | `{}` |
|
||||
| `gatewayAPI.core.httpRoute.labels` | Additional labels applied to the HTTPRoute. | `{}` |
|
||||
@@ -1147,12 +1159,12 @@ To comply with the Gitea helm chart definition of the digest parameter, a "custo
|
||||
| `ingress.enabled` | Enable ingress. | `false` |
|
||||
| `ingress.annotations` | Additional annotations. | `{}` |
|
||||
| `ingress.labels` | Additional labels. | `{}` |
|
||||
| `ingress.className` | DEPRECATED: Ingress class name. | `nginx` |
|
||||
| `ingress.ingressClassName` | Name of the IngressClass which backs the Ingress. | `nginx` |
|
||||
| `ingress.pathType` | Ingress Path Type. | `Prefix` |
|
||||
| `ingress.hosts[0].host` | Default Ingress host. | `git.example.com` |
|
||||
| `ingress.hosts[0].paths[0].path` | Default Ingress path. | `/` |
|
||||
| `ingress.tls` | Ingress tls settings. | `[]` |
|
||||
| `namespace` | An explicit namespace to deploy gitea into. Defaults to the release namespace if not specified. | `""` |
|
||||
| `namespace` | An explicit namespace to deploy Gitea into. Defaults to the release namespace if not specified. | `""` |
|
||||
|
||||
### Network
|
||||
|
||||
@@ -1212,7 +1224,7 @@ To comply with the Gitea helm chart definition of the digest parameter, a "custo
|
||||
| `secrets.config.existingSecret.secretName` | Name of the already existing config Secret. | `""` |
|
||||
| `secrets.config.new.annotations` | Annotations for the config Secret. | `{}` |
|
||||
| `secrets.config.new.labels` | Labels for the config Secret. | `{}` |
|
||||
| `secrets.gpg.enabled` | Enable mounting of a GPG key to sign git commits. | `false` |
|
||||
| `secrets.gpg.enabled` | Enable mounting of a GPG key to sign Git commits. | `false` |
|
||||
| `secrets.gpg.addSHASumAnnotation` | Add a pod annotation with the SHA sum of the GPG key Secret to trigger a rollout on change. Further information can be found in the [documentation](./README.md#secret-checksum-annotation). | `false` |
|
||||
| `secrets.gpg.existingSecret.enabled` | Use an already existing Secret instead of creating the GPG key Secret. | `false` |
|
||||
| `secrets.gpg.existingSecret.secretName` | Name of the already existing GPG key Secret. | `""` |
|
||||
@@ -1287,21 +1299,19 @@ To comply with the Gitea helm chart definition of the digest parameter, a "custo
|
||||
|
||||
### Persistence
|
||||
|
||||
| Name | Description | Value |
|
||||
| --------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | ------------------- |
|
||||
| `persistence.enabled` | Enable persistent storage. | `false` |
|
||||
| `persistence.existingPersistentVolumeClaim.enabled` | Enable using an existing persistent volume claim. | `false` |
|
||||
| `persistence.existingPersistentVolumeClaim.persistentVolumeClaimName` | Name of the existing persistent volume claim to use. | `""` |
|
||||
| `persistence.new.annotations.helm.sh/resource-policy` | Resource policy for the new persistent volume claim. | `keep` |
|
||||
| `persistence.new.labels` | Labels for the new persistent volume claim. | `{}` |
|
||||
| `persistence.new.accessModes` | AccessMode for the new persistent volume claim. | `["ReadWriteOnce"]` |
|
||||
| `persistence.new.persistentVolumeName` | Name of the persistent volume for the new persistent volume claim. | `""` |
|
||||
| `persistence.new.size` | Size for the new persistent volume claim. | `10Gi` |
|
||||
| `persistence.new.storageClassName` | Name of the storage class to use for the new persistent volume claim. | `""` |
|
||||
| `persistence.new.subPath` | Subdirectory of the volume to mount at for the new persistent volume claim. | `""` |
|
||||
| `extraContainers` | Additional sidecar containers to run in the pod. | `[]` |
|
||||
| `extraInitVolumeMounts` | Mounts that are only mapped into the init-containers. Can be used for additional preconfiguration. | `[]` |
|
||||
| `extraVolumeMounts` | **DEPRECATED** Additional volume mounts for init containers and the Gitea main container. | `[]` |
|
||||
| Name | Description | Value |
|
||||
| --------------------------------------------------------------------- | --------------------------------------------------------------------------- | ------------------- |
|
||||
| `persistence.enabled` | Enable persistent storage. | `false` |
|
||||
| `persistence.existingPersistentVolumeClaim.enabled` | Enable using an existing persistent volume claim. | `false` |
|
||||
| `persistence.existingPersistentVolumeClaim.persistentVolumeClaimName` | Name of the existing persistent volume claim to use. | `""` |
|
||||
| `persistence.new.annotations.helm.sh/resource-policy` | Resource policy for the new persistent volume claim. | `keep` |
|
||||
| `persistence.new.labels` | Labels for the new persistent volume claim. | `{}` |
|
||||
| `persistence.new.accessModes` | AccessMode for the new persistent volume claim. | `["ReadWriteOnce"]` |
|
||||
| `persistence.new.persistentVolumeName` | Name of the persistent volume for the new persistent volume claim. | `""` |
|
||||
| `persistence.new.size` | Size for the new persistent volume claim. | `10Gi` |
|
||||
| `persistence.new.storageClassName` | Name of the storage class to use for the new persistent volume claim. | `""` |
|
||||
| `persistence.new.subPath` | Subdirectory of the volume to mount at for the new persistent volume claim. | `""` |
|
||||
| `extraContainers` | Additional sidecar containers to run in the pod. | `[]` |
|
||||
|
||||
### Init
|
||||
|
||||
@@ -1371,6 +1381,38 @@ To comply with the Gitea helm chart definition of the digest parameter, a "custo
|
||||
| `gitea.startupProbe.successThreshold` | Success threshold for startup probe. | `1` |
|
||||
| `gitea.startupProbe.failureThreshold` | Failure threshold for startup probe. | `10` |
|
||||
|
||||
### CloudNativePG
|
||||
|
||||
| Name | Description | Value |
|
||||
| ------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------- |
|
||||
| `cloudnativePG.enabled` | Provision a CloudNativePG `Cluster` for Gitea. Requires the CloudNativePG operator to be installed in the cluster. | `false` |
|
||||
| `cloudnativePG.annotations` | Annotations for the CloudNativePG `Cluster`. | `{}` |
|
||||
| `cloudnativePG.labels` | Additional labels for the CloudNativePG `Cluster`. | `{}` |
|
||||
| `cloudnativePG.image.registry` | Image registry. | `ghcr.io` |
|
||||
| `cloudnativePG.image.repository` | Image repository. | `cloudnative-pg/postgresql` |
|
||||
| `cloudnativePG.image.tag` | Image tag. | `18.0` |
|
||||
| `cloudnativePG.instances` | Number of PostgreSQL instances. Values greater than `1` provision a HA-ready cluster with streaming replication. | `3` |
|
||||
| `cloudnativePG.credentials.addSHASumAnnotation` | Add a pod annotation with the SHA sum of the credentials Secret to trigger a rollout on change. Further information can be found in the [documentation](./README.md#secret-checksum-annotation). | `false` |
|
||||
| `cloudnativePG.credentials.database` | Name of the database to create. CloudNativePG requires it as a literal in the `Cluster`, hence it cannot be sourced from a Secret. | `gitea` |
|
||||
| `cloudnativePG.credentials.username` | Name of the database owner to create. CloudNativePG requires it as a literal in the `Cluster`, hence it cannot be sourced from a Secret. | `gitea` |
|
||||
| `cloudnativePG.credentials.existingSecret.enabled` | Use an already existing Secret instead of creating the credentials Secret. | `false` |
|
||||
| `cloudnativePG.credentials.existingSecret.secretName` | Name of the already existing credentials Secret. Must be of type `kubernetes.io/basic-auth` and its `username` must match `cloudnativePG.credentials.username`. | `""` |
|
||||
| `cloudnativePG.credentials.existingSecret.passwordKey` | Key of the password in the existing credentials Secret. | `password` |
|
||||
| `cloudnativePG.credentials.new.annotations` | Annotations for the credentials Secret. | `{}` |
|
||||
| `cloudnativePG.credentials.new.labels` | Labels for the credentials Secret. | `{}` |
|
||||
| `cloudnativePG.credentials.new.password` | Password of the database owner. | `gitea` |
|
||||
| `cloudnativePG.postgresql.parameters` | Custom PostgreSQL configuration parameters. | `{}` |
|
||||
| `cloudnativePG.storage.size` | Size of the data volume. | `10Gi` |
|
||||
| `cloudnativePG.storage.storageClass` | Storage class of the data volume. Defaults to the cluster's default storage class. | `""` |
|
||||
| `cloudnativePG.walStorage.enabled` | Store the write-ahead log on a dedicated volume. | `false` |
|
||||
| `cloudnativePG.walStorage.size` | Size of the write-ahead log volume. | `2Gi` |
|
||||
| `cloudnativePG.walStorage.storageClass` | Storage class of the write-ahead log volume. Defaults to the cluster's default storage class. | `""` |
|
||||
| `cloudnativePG.affinity` | Affinity for the PostgreSQL pods. CloudNativePG nests `nodeSelector` and `tolerations` below this key as well. | `{}` |
|
||||
| `cloudnativePG.priorityClassName` | Priority class name for the PostgreSQL pods. | `""` |
|
||||
| `cloudnativePG.monitoring.enablePodMonitor` | Create a `PodMonitor` for the CloudNativePG `Cluster`. | `false` |
|
||||
| `cloudnativePG.resources` | Kubernetes resources for the PostgreSQL containers. | `{}` |
|
||||
| `cloudnativePG.topologySpreadConstraints` | Topology spread constraints for the PostgreSQL pods. | `[]` |
|
||||
|
||||
### valkey
|
||||
|
||||
| Name | Description | Value |
|
||||
@@ -1395,56 +1437,12 @@ To comply with the Gitea helm chart definition of the digest parameter, a "custo
|
||||
| `valkey.metrics.exporter.image.repository` | Image repository. | `oliver006/redis_exporter` |
|
||||
| `valkey.metrics.exporter.image.tag` | Image tag. | `""` |
|
||||
|
||||
### PostgreSQL HA
|
||||
|
||||
| Name | Description | Value |
|
||||
| -------------------------------------------------- | ----------------------------------------------------------------- | --------------------------------- |
|
||||
| `postgresql-ha.enabled` | Enable PostgreSQL HA. | `true` |
|
||||
| `postgresql-ha.global.postgresql.database` | Name for a custom database to create (overrides `auth.database`). | `gitea` |
|
||||
| `postgresql-ha.global.postgresql.username` | Name for a custom user to create (overrides `auth.username`). | `gitea` |
|
||||
| `postgresql-ha.global.postgresql.password` | Name for a custom password to create (overrides `auth.password`). | `gitea` |
|
||||
| `postgresql-ha.metrics.image.repository` | Image repository, eg. `bitnamilegacy/postgres-exporter`. | `bitnamilegacy/postgres-exporter` |
|
||||
| `postgresql-ha.postgresql.image.repository` | Image repository, eg. `bitnamilegacy/postgresql-repmgr`. | `bitnamilegacy/postgresql-repmgr` |
|
||||
| `postgresql-ha.postgresql.repmgrPassword` | Repmgr Password. | `changeme2` |
|
||||
| `postgresql-ha.postgresql.postgresPassword` | postgres Password. | `changeme1` |
|
||||
| `postgresql-ha.postgresql.password` | Password for the `gitea` user (overrides `auth.password`). | `changeme4` |
|
||||
| `postgresql-ha.pgpool.adminPassword` | pgpool adminPassword. | `changeme3` |
|
||||
| `postgresql-ha.pgpool.image.repository` | Image repository, eg. `bitnamilegacy/pgpool`. | `bitnamilegacy/pgpool` |
|
||||
| `postgresql-ha.pgpool.srCheckPassword` | pgpool srCheckPassword. | `changeme4` |
|
||||
| `postgresql-ha.service.ports.postgresql` | PostgreSQL service port (overrides `service.ports.postgresql`). | `5432` |
|
||||
| `postgresql-ha.persistence.enabled` | Enable persistence. | `true` |
|
||||
| `postgresql-ha.persistence.storageClass` | Persistent Volume Storage Class. | `""` |
|
||||
| `postgresql-ha.persistence.size` | PVC Storage Request for PostgreSQL HA volume. | `10Gi` |
|
||||
| `postgresql-ha.volumePermissions.image.repository` | Image repository, eg. `bitnamilegacy/os-shell`. | `bitnamilegacy/os-shell` |
|
||||
|
||||
### PostgreSQL
|
||||
|
||||
| Name | Description | Value |
|
||||
| ------------------------------------------------------- | ----------------------------------------------------------------- | --------------------------------- |
|
||||
| `postgresql.enabled` | Enable PostgreSQL. | `false` |
|
||||
| `postgresql.global.postgresql.auth.password` | Password for the `gitea` user (overrides `auth.password`). | `gitea` |
|
||||
| `postgresql.global.postgresql.auth.database` | Name for a custom database to create (overrides `auth.database`). | `gitea` |
|
||||
| `postgresql.global.postgresql.auth.username` | Name for a custom user to create (overrides `auth.username`). | `gitea` |
|
||||
| `postgresql.global.postgresql.service.ports.postgresql` | PostgreSQL service port (overrides `service.ports.postgresql`). | `5432` |
|
||||
| `postgresql.image.repository` | Image repository, eg. `bitnamilegacy/postgresql`. | `bitnamilegacy/postgresql` |
|
||||
| `postgresql.primary.persistence.enabled` | Enable persistence. | `true` |
|
||||
| `postgresql.primary.persistence.storageClass` | Persistent Volume storage class. | `""` |
|
||||
| `postgresql.primary.persistence.size` | PVC Storage Request for PostgreSQL volume. | `10Gi` |
|
||||
| `postgresql.readReplicas.persistence.enabled` | Enable PostgreSQL read only data persistence using PVC. | `true` |
|
||||
| `postgresql.readReplicas.persistence.storageClass` | Persistent Volume storage class. | `""` |
|
||||
| `postgresql.readReplicas.persistence.size` | PVC Storage Request for PostgreSQL volume. | `""` |
|
||||
| `postgresql.metrics.image.repository` | Image repository, eg. `bitnamilegacy/postgres-exporter`. | `bitnamilegacy/postgres-exporter` |
|
||||
| `postgresql.volumePermissions.image.repository` | Image repository, eg. `bitnamilegacy/os-shell`. | `bitnamilegacy/os-shell` |
|
||||
|
||||
### Advanced
|
||||
|
||||
| Name | Description | Value |
|
||||
| ------------------ | ------------------------------------------------------------------ | --------- |
|
||||
| `checkDeprecation` | Set it to false to skip this basic validation check. | `true` |
|
||||
| `test.enabled` | Set it to false to disable test-connection Pod. | `true` |
|
||||
| `test.image.name` | Image name for the wget container used in the test-connection Pod. | `busybox` |
|
||||
| `test.image.tag` | Image tag for the wget container used in the test-connection Pod. | `latest` |
|
||||
| `extraDeploy` | Array of extra objects to deploy with the release. | `[]` |
|
||||
| Name | Description | Value |
|
||||
| ------------------ | ---------------------------------------------------- | ------ |
|
||||
| `checkDeprecation` | Set it to false to skip this basic validation check. | `true` |
|
||||
| `extraDeploy` | Array of extra objects to deploy with the release. | `[]` |
|
||||
|
||||
## Contributing
|
||||
|
||||
@@ -1470,6 +1468,7 @@ If you miss this, blindly upgrading may delete your Postgres instance and you ma
|
||||
- All Secrets created by this chart are now configured through the new `secrets` section.
|
||||
It exposes `annotations`, `labels`, a checksum-annotation toggle and an `existingSecret` reference for each of the
|
||||
`admin`, `config`, `gpg`, `init`, `inlineConfig` and `metrics` Secrets.
|
||||
|
||||
- The `gitea.admin` object has been replaced by `secrets.admin`.
|
||||
The chart fails to render if `gitea.admin` is still set.
|
||||
Migrate as follows:
|
||||
@@ -1490,6 +1489,7 @@ If you miss this, blindly upgrading may delete your Postgres instance and you ma
|
||||
|
||||
Admin user handling was previously skipped implicitly when neither an existing Secret nor a username and password were
|
||||
set. It is now controlled explicitly via `secrets.admin.enabled`.
|
||||
|
||||
- The top-level `signing` object has been replaced by `secrets.gpg`.
|
||||
The chart fails to render if `signing` is still set.
|
||||
Migrate as follows:
|
||||
@@ -1511,6 +1511,22 @@ If you miss this, blindly upgrading may delete your Postgres instance and you ma
|
||||
the config Secret changed from `<fullname>` to `<fullname>-config` and the metrics Secret from
|
||||
`<fullname>-metrics-secret` to `<fullname>-metrics`.
|
||||
|
||||
- `ingress.className` has been renamed to `ingress.ingressClassName` to match the name of the `spec.ingressClassName`
|
||||
field of the Ingress resource it populates. The chart fails to render if `ingress.className` is still set, even when
|
||||
it is set to an empty string.
|
||||
|
||||
- `extraVolumeMounts` has been removed. Deprecated since 6.0.0, it mounted the same volumes into the init containers
|
||||
and into the Gitea container, and it was silently ignored as soon as `extraInitVolumeMounts` or
|
||||
`deployment.gitea.volumeMounts` contained a single entry. Split the mounts explicitly: use
|
||||
`deployment.<initContainer>.volumeMounts` for the init containers and `deployment.gitea.volumeMounts` for the Gitea
|
||||
container. Volumes that are needed in both places have to be listed in both settings.
|
||||
|
||||
- `extraInitVolumeMounts` has been removed. It fanned a mount out to the four chart-managed init containers, but never
|
||||
reached init containers added through `deployment.initContainers[].container`, despite its name. Configure the mount
|
||||
on the init containers that actually need it: `deployment.initDirectories.volumeMounts`,
|
||||
`deployment.initAppIni.volumeMounts`, `deployment.initConfigureGPG.volumeMounts` or
|
||||
`deployment.initConfigureGitea.volumeMounts`.
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
@@ -1668,15 +1684,17 @@ If you want to switch to a RWX volume and go for HA, you need to
|
||||
|
||||
<!-- prettier-ignore-start -->
|
||||
<!-- markdownlint-disable-next-line -->
|
||||
**Transitioning from Postgres to Postgres HA**
|
||||
**Transitioning from Postgres or Postgres HA to CloudNativePG**
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
If you are running with a non-HA PG DB from a previous chart release, you need to set
|
||||
The `postgresql` and `postgresql-ha` sub-charts have been replaced by a [CloudNativePG](https://cloudnative-pg.io/) `Cluster` resource, configured via `cloudnativePG`.
|
||||
The CloudNativePG operator is not bundled with this chart and has to be installed cluster-wide beforehand.
|
||||
|
||||
- `postgresql-ha.enabled=false`
|
||||
- `postgresql.enabled=true`
|
||||
There is no in-place migration path: dump the database of the old deployment with `pg_dump`, remove the `postgresql` or `postgresql-ha` values and deploy the chart with `cloudnativePG.enabled=true`.
|
||||
Afterwards restore the dump into the new cluster.
|
||||
Alternatively, point the new `Cluster` at the existing data via one of the [CloudNativePG bootstrap methods](https://cloudnative-pg.io/documentation/current/bootstrap/).
|
||||
|
||||
This is needed to stay with your existing single-instance DB (as the HA-variant is the new default).
|
||||
For a single-instance database, set `cloudnativePG.instances=1`.
|
||||
|
||||
<!-- prettier-ignore-start -->
|
||||
<!-- markdownlint-disable-next-line -->
|
||||
|
||||
+24
-8
@@ -28,8 +28,8 @@ In addition, the following components are required for full HA-readiness:
|
||||
- A HA-ready cache (`valkey-cluster`)
|
||||
- A HA-ready DB
|
||||
|
||||
`postgres.enabled`, which default to `true`, must be set to `false` for a HA setup.
|
||||
The default `postgres` chart dependency is not HA-ready (there's a dedicated `postgres-ha` chart).
|
||||
`cloudnativePG.enabled`, which defaults to `false`, must be enabled for a HA setup.
|
||||
It requires the CloudNativePG operator to be installed cluster-wide beforehand.
|
||||
|
||||
The following sections discuss each of the components in more detail.
|
||||
Note that for each component discussed, the shown configurations only provides a (working) starting point, not necessarily the most optimal setup.
|
||||
@@ -153,15 +153,31 @@ persistence:
|
||||
|
||||
## Database
|
||||
|
||||
If you do not have an HA-ready DB, using a managed database service in the cloud might be the easiest and most robust solution.
|
||||
Remember: disable the built-in `postgres` dependency and configure the database connection manually via `gitea.config.database`:
|
||||
By enabling `cloudnativePG`, the chart renders a [CloudNativePG](https://cloudnative-pg.io/) `Cluster`, which provides a HA-ready PostgreSQL via streaming replication.
|
||||
The CloudNativePG operator itself is not part of this chart and has to be [installed cluster-wide](https://cloudnative-pg.io/documentation/current/installation_upgrade/) beforehand.
|
||||
For that reason the option is disabled by default.
|
||||
|
||||
```yml
|
||||
cloudnativePG:
|
||||
enabled: true
|
||||
instances: 3
|
||||
storage:
|
||||
size: 10Gi
|
||||
storageClass: <storage class>
|
||||
walStorage:
|
||||
enabled: true
|
||||
size: 2Gi
|
||||
storageClass: <storage class>
|
||||
```
|
||||
|
||||
If you do not want to run the operator, using a managed database service in the cloud might be the easiest and most robust solution.
|
||||
Remember: keep `cloudnativePG` disabled and configure the database connection manually via `gitea.config.database`:
|
||||
|
||||
```yml
|
||||
cloudnativePG:
|
||||
enabled: false
|
||||
|
||||
gitea:
|
||||
database:
|
||||
builtIn:
|
||||
postgresql:
|
||||
enabled: false
|
||||
config:
|
||||
database:
|
||||
DB_TYPE: postgres
|
||||
|
||||
Generated
+201
-90
@@ -9,7 +9,7 @@
|
||||
"devDependencies": {
|
||||
"@bitnami/readme-generator-for-helm": "^2.5.0",
|
||||
"markdown-link-check": "^3.13.6",
|
||||
"markdownlint-cli": "^0.49.0"
|
||||
"markdownlint-cli": "^0.50.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.0.0",
|
||||
@@ -33,6 +33,13 @@
|
||||
"readme-generator": "bin/index.js"
|
||||
}
|
||||
},
|
||||
"node_modules/@isaacs/nonrecursive-glob-match": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@isaacs/nonrecursive-glob-match/-/nonrecursive-glob-match-1.1.0.tgz",
|
||||
"integrity": "sha512-GPm/Dbvk5RLmhRnxXIa7nTpK0xtl4E0wj0MslsuNiJ1FIROU+2+9lgUC/dgF7Ey4QCWhfEsgxilMRMCdHPfDfw==",
|
||||
"dev": true,
|
||||
"license": "BlueOak-1.0.0"
|
||||
},
|
||||
"node_modules/@oozcitak/dom": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@oozcitak/dom/-/dom-2.0.2.tgz",
|
||||
@@ -127,9 +134,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/ansi-regex": {
|
||||
"version": "6.2.2",
|
||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz",
|
||||
"integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==",
|
||||
"version": "6.4.0",
|
||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.4.0.tgz",
|
||||
"integrity": "sha512-KzTVk2tCWAHtYrvvvaP8bJKJq2pVinhLcGEQdtLIYPbmNGNyYe8QwNaTUYQp2J7/vIsUKt5QCqAfUkYyG9DkOw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
@@ -624,9 +631,9 @@
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/get-east-asian-width": {
|
||||
"version": "1.6.0",
|
||||
"resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.6.0.tgz",
|
||||
"integrity": "sha512-QRbvDIbx6YklUe6RxeTeleMR0yv3cYH6PsPZHcnVn7xv7zO1BHN8r0XETu8n6Ye3Q+ahtSarc3WgtNWmehIBfA==",
|
||||
"version": "1.7.0",
|
||||
"resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.7.0.tgz",
|
||||
"integrity": "sha512-XjH1AECxf0giL2V1aU8vKyRR2ppRUb5c0EvT7zuJTokQ74bNo52zOtghqdWIqrhUD79fo3x0WfKZdOqxF6LG1Q==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
@@ -760,9 +767,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/ignore": {
|
||||
"version": "7.0.5",
|
||||
"resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.5.tgz",
|
||||
"integrity": "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==",
|
||||
"version": "7.0.16",
|
||||
"resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.16.tgz",
|
||||
"integrity": "sha512-52N+Y4HRMOJmbLmr+DqO4iSRyyB7N52gm7PWCT6h0p978+oKbqHCB7gIJIwZvBUsjlSdWbrBFqUSmIFNZMpn0A==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
@@ -789,13 +796,13 @@
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/ini": {
|
||||
"version": "4.1.3",
|
||||
"resolved": "https://registry.npmjs.org/ini/-/ini-4.1.3.tgz",
|
||||
"integrity": "sha512-X7rqawQBvfdjS10YU1y1YVreA3SsLrW9dX2CewP2EbBJM4ypVNLDkO5y04gejPwKIY9lR+7r9gn3rFPt/kmWFg==",
|
||||
"version": "7.0.0",
|
||||
"resolved": "https://registry.npmjs.org/ini/-/ini-7.0.0.tgz",
|
||||
"integrity": "sha512-ifK0CgjALofS5bkrcTy4RaQ9Vx2Knf/eLeIO+NaswQEpH1UblrtTSCIvN71qQDMq0PeQ/SSPojvEJp9vvvfr+w==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"engines": {
|
||||
"node": "^14.17.0 || ^16.13.0 || >=18.0.0"
|
||||
"node": "^22.22.2 || ^24.15.0 || >=26.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/ip-address": {
|
||||
@@ -967,9 +974,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/linkify-it": {
|
||||
"version": "5.0.2",
|
||||
"resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-5.0.2.tgz",
|
||||
"integrity": "sha512-ONTm2jCMAVZjgQa/Fy1kScXsuOoF5NPTsoFBdE1KVIZ2vAh/r9+Bqo+0jINCBYnavTPQZz38QzFTme79ENoN3Q==",
|
||||
"version": "6.1.0",
|
||||
"resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-6.1.0.tgz",
|
||||
"integrity": "sha512-wJ/TwpSDTLepCrQoYWYIExIKg5Zchex2Nn5yk2mFnB+6PtdkHtyLx742md9csRjjOnGkKIS/RrbY7l8D6gT9Vw==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
@@ -983,7 +990,7 @@
|
||||
],
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"uc.micro": "^2.0.0"
|
||||
"uc.micro": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/lodash": {
|
||||
@@ -1004,9 +1011,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/markdown-it": {
|
||||
"version": "14.2.0",
|
||||
"resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-14.2.0.tgz",
|
||||
"integrity": "sha512-1TGiQiJVRQ3NPmZH6sx5Cfnmg6GQm9jvC1ch4TK511NjSJvjzKLzn5pPfZRNZkRPZP0HqCioSndqH8v2nRaWVQ==",
|
||||
"version": "15.0.3",
|
||||
"resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-15.0.3.tgz",
|
||||
"integrity": "sha512-+Az7Ojz3iRGu8KYMvJ6xVhvrxP3eE+vEtJX75Ow88XBpcQNV/0lGX5ZynIIBftREo4DC2jsveAMDaeltmm8QvQ==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
@@ -1020,17 +1027,47 @@
|
||||
],
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"argparse": "^2.0.1",
|
||||
"entities": "^4.4.0",
|
||||
"linkify-it": "^5.0.1",
|
||||
"mdurl": "^2.0.0",
|
||||
"argparse": "^3.0.3",
|
||||
"entities": "^8.1.0",
|
||||
"linkify-it": "^6.1.0",
|
||||
"mdurl": "^2.1.0",
|
||||
"punycode.js": "^2.3.1",
|
||||
"uc.micro": "^2.1.0"
|
||||
"uc.micro": "^3.0.0"
|
||||
},
|
||||
"bin": {
|
||||
"markdown-it": "bin/markdown-it.mjs"
|
||||
}
|
||||
},
|
||||
"node_modules/markdown-it/node_modules/argparse": {
|
||||
"version": "3.0.4",
|
||||
"resolved": "https://registry.npmjs.org/argparse/-/argparse-3.0.4.tgz",
|
||||
"integrity": "sha512-fwWK3Zq22l4XJJjx5mcBHGikIk+hJqO+32dPm0Jur7+rtG5x1scOjSfdT9ZKeWHPpsya/l0HHK4tDImBkTrtvA==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/puzrin"
|
||||
},
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/nodeca"
|
||||
}
|
||||
],
|
||||
"license": "PSF-2.0"
|
||||
},
|
||||
"node_modules/markdown-it/node_modules/entities": {
|
||||
"version": "8.1.0",
|
||||
"resolved": "https://registry.npmjs.org/entities/-/entities-8.1.0.tgz",
|
||||
"integrity": "sha512-kxL7msIffSuh9aaFAMD7rxAIuTRMAHMeBtgHW2yUdWw732ZNh4MehkF2gdjvtdmikkaIP9bFDDJOPlsvm7avrA==",
|
||||
"dev": true,
|
||||
"license": "BSD-2-Clause",
|
||||
"engines": {
|
||||
"node": ">=20.19.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/fb55/entities?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/markdown-link-check": {
|
||||
"version": "3.15.0",
|
||||
"resolved": "https://registry.npmjs.org/markdown-link-check/-/markdown-link-check-3.15.0.tgz",
|
||||
@@ -1088,21 +1125,22 @@
|
||||
}
|
||||
},
|
||||
"node_modules/markdownlint": {
|
||||
"version": "0.41.0",
|
||||
"resolved": "https://registry.npmjs.org/markdownlint/-/markdownlint-0.41.0.tgz",
|
||||
"integrity": "sha512-xMUI3ChBuRuxuLF4ENvCZyS8z/+Jly1coUcZwErKLIB3sDj7ojpaTBa1e9YVPhSN4jGEIjYGQCldbTJS/hqS+A==",
|
||||
"version": "0.42.2",
|
||||
"resolved": "https://registry.npmjs.org/markdownlint/-/markdownlint-0.42.2.tgz",
|
||||
"integrity": "sha512-IhlUBVT+kHBX+u3EjEsQdFB4q0Rl0Hx+JsGsvVkonNut1/n8Kv8yXzwk0pazC9uF35JlwMZ+LxV4CQ9YNAbG8w==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"micromark": "4.0.2",
|
||||
"micromark-core-commonmark": "2.0.3",
|
||||
"micromark": "4.0.3",
|
||||
"micromark-core-commonmark": "2.0.4",
|
||||
"micromark-extension-directive": "4.0.0",
|
||||
"micromark-extension-gfm-autolink-literal": "2.1.0",
|
||||
"micromark-extension-gfm-footnote": "2.1.0",
|
||||
"micromark-extension-gfm-table": "2.1.1",
|
||||
"micromark-extension-gfm-table": "2.1.2",
|
||||
"micromark-extension-math": "3.1.0",
|
||||
"micromark-util-types": "2.0.2",
|
||||
"string-width": "8.2.1"
|
||||
"micromark-util-types": "2.0.3",
|
||||
"re2js": "2.9.1",
|
||||
"string-width": "8.3.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22"
|
||||
@@ -1112,23 +1150,23 @@
|
||||
}
|
||||
},
|
||||
"node_modules/markdownlint-cli": {
|
||||
"version": "0.49.0",
|
||||
"resolved": "https://registry.npmjs.org/markdownlint-cli/-/markdownlint-cli-0.49.0.tgz",
|
||||
"integrity": "sha512-vS5tWq5W91Gg33LD4pyAaXPclnz/sRvo6/RGOyDQjQ3eds2DkK6H4szUuE0M9TiRB/u/VBx1gtd9Ktrtx5WlSA==",
|
||||
"version": "0.50.1",
|
||||
"resolved": "https://registry.npmjs.org/markdownlint-cli/-/markdownlint-cli-0.50.1.tgz",
|
||||
"integrity": "sha512-3F9ON1oW8dlY2mkvQGzyDrcrfx6xiWYgS8arlijuw/JH/ZaPHE6nxp9/SP2V8YqbK8GaqZtkLD6hayPa4uj2mw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"commander": "~15.0.0",
|
||||
"commander": "~15.1.0",
|
||||
"deep-extend": "~0.6.0",
|
||||
"ignore": "~7.0.5",
|
||||
"js-yaml": "~4.2.0",
|
||||
"ignore": "~7.0.16",
|
||||
"js-yaml": "~5.5.0",
|
||||
"jsonc-parser": "~3.3.1",
|
||||
"jsonpointer": "~5.0.1",
|
||||
"markdown-it": "~14.2.0",
|
||||
"markdownlint": "~0.41.0",
|
||||
"minimatch": "~10.2.5",
|
||||
"run-con": "~1.3.2",
|
||||
"smol-toml": "~1.6.1",
|
||||
"markdown-it": "~15.0.3",
|
||||
"markdownlint": "~0.42.2",
|
||||
"minimatch": "~11.0.9",
|
||||
"run-con": "~1.3.3",
|
||||
"smol-toml": "~1.9.1",
|
||||
"tinyglobby": "~0.2.17"
|
||||
},
|
||||
"bin": {
|
||||
@@ -1138,6 +1176,23 @@
|
||||
"node": ">=22"
|
||||
}
|
||||
},
|
||||
"node_modules/markdownlint-cli/node_modules/argparse": {
|
||||
"version": "3.0.4",
|
||||
"resolved": "https://registry.npmjs.org/argparse/-/argparse-3.0.4.tgz",
|
||||
"integrity": "sha512-fwWK3Zq22l4XJJjx5mcBHGikIk+hJqO+32dPm0Jur7+rtG5x1scOjSfdT9ZKeWHPpsya/l0HHK4tDImBkTrtvA==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/puzrin"
|
||||
},
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/nodeca"
|
||||
}
|
||||
],
|
||||
"license": "PSF-2.0"
|
||||
},
|
||||
"node_modules/markdownlint-cli/node_modules/balanced-match": {
|
||||
"version": "4.0.4",
|
||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz",
|
||||
@@ -1149,39 +1204,63 @@
|
||||
}
|
||||
},
|
||||
"node_modules/markdownlint-cli/node_modules/brace-expansion": {
|
||||
"version": "5.0.7",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.7.tgz",
|
||||
"integrity": "sha512-7oFy703dxfY3/NLxC1fh2SUCQ0H9rmAY+5EpDVfXjUTTs+HEwR2nYaqLv+GWcTsumwxPfiz6CzCNkwXwBUwqCA==",
|
||||
"version": "5.1.0",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.1.0.tgz",
|
||||
"integrity": "sha512-aa11Dv491GKnYqxaul3aRJ0szew7yMJMfZPnqD44NjGrZXoj62l41OEDDpdpC4eE2P88vBFfLuSyRhpG91NUvg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"balanced-match": "^4.0.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": "18 || 20 || >=22"
|
||||
"node": "20 || >=22"
|
||||
}
|
||||
},
|
||||
"node_modules/markdownlint-cli/node_modules/commander": {
|
||||
"version": "15.0.0",
|
||||
"resolved": "https://registry.npmjs.org/commander/-/commander-15.0.0.tgz",
|
||||
"integrity": "sha512-z67u4ZhzCL/Tydu1lJARtEZYWbWaN7oYLHbsuzocr6y4N6WZAagG3RQ4FW61V1/0+jImpj293XfrcYnd1qxtPg==",
|
||||
"version": "15.1.0",
|
||||
"resolved": "https://registry.npmjs.org/commander/-/commander-15.1.0.tgz",
|
||||
"integrity": "sha512-cgnQ88TRrWcC7pVq46RzJVRMktu3W2RcbnoidnfBsl1bmDCBwJS/udcIZpKoCrbAYYaCqsz1yZCVIgbIaU3ddQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=22.12.0"
|
||||
}
|
||||
},
|
||||
"node_modules/markdownlint-cli/node_modules/js-yaml": {
|
||||
"version": "5.5.0",
|
||||
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-5.5.0.tgz",
|
||||
"integrity": "sha512-paNr4LFIFPjeeSmwNYdrb8FafLLG/Cr2Af3GjbsHJ5CxIjH4r0c2emlmRdAtpPAieP1gRVzk6buBbVP5gBMGAg==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/puzrin"
|
||||
},
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/nodeca"
|
||||
}
|
||||
],
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"argparse": "^3.0.3"
|
||||
},
|
||||
"bin": {
|
||||
"js-yaml": "bin/js-yaml.mjs"
|
||||
}
|
||||
},
|
||||
"node_modules/markdownlint-cli/node_modules/minimatch": {
|
||||
"version": "10.2.5",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.5.tgz",
|
||||
"integrity": "sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==",
|
||||
"version": "11.0.9",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-11.0.9.tgz",
|
||||
"integrity": "sha512-KCFkfyjqerNlSstjlhIGNXIKZGA/6O4V4RlhZ+Dsr621SPPw0mzlypE9D9ZOoPiVefHID+j7/XuMMlqfD/F60Q==",
|
||||
"dev": true,
|
||||
"license": "BlueOak-1.0.0",
|
||||
"dependencies": {
|
||||
"brace-expansion": "^5.0.5"
|
||||
"@isaacs/nonrecursive-glob-match": "^1.1.0",
|
||||
"brace-expansion": "^5.0.12"
|
||||
},
|
||||
"engines": {
|
||||
"node": "18 || 20 || >=22"
|
||||
"node": "20 || >=22"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/isaacs"
|
||||
@@ -1201,16 +1280,16 @@
|
||||
}
|
||||
},
|
||||
"node_modules/mdurl": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/mdurl/-/mdurl-2.0.0.tgz",
|
||||
"integrity": "sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w==",
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/mdurl/-/mdurl-2.1.0.tgz",
|
||||
"integrity": "sha512-1+HBaOx0zi/dQWht8rNv9MYf9qqpqL/kxI0hXImU6Y547zM6Sni8BQibt7ifgMcYtQg41ao3Ivd6cnSM86inpg==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/micromark": {
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmjs.org/micromark/-/micromark-4.0.2.tgz",
|
||||
"integrity": "sha512-zpe98Q6kvavpCr1NPVSCMebCKfD7CA2NqZ+rykeNhONIJBpc1tFKt9hucLGwha3jNTNI8lHpctWJWoimVF4PfA==",
|
||||
"version": "4.0.3",
|
||||
"resolved": "https://registry.npmjs.org/micromark/-/micromark-4.0.3.tgz",
|
||||
"integrity": "sha512-oGYfQzHSG5dOMovQcJ3fyTmZlWAWpi0XA0sJwJs+i6OT88o1+Jtw/8z0CmdowSLxGhhFK89rQ/oXph/wN02PNw==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
@@ -1234,6 +1313,7 @@
|
||||
"micromark-util-chunked": "^2.0.0",
|
||||
"micromark-util-combine-extensions": "^2.0.0",
|
||||
"micromark-util-decode-numeric-character-reference": "^2.0.0",
|
||||
"micromark-util-edit-map": "^1.0.0",
|
||||
"micromark-util-encode": "^2.0.0",
|
||||
"micromark-util-normalize-identifier": "^2.0.0",
|
||||
"micromark-util-resolve-all": "^2.0.0",
|
||||
@@ -1244,9 +1324,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/micromark-core-commonmark": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/micromark-core-commonmark/-/micromark-core-commonmark-2.0.3.tgz",
|
||||
"integrity": "sha512-RDBrHEMSxVFLg6xvnXmb1Ayr2WzLAWjeSATAoxwKYJV94TeNavgoIdA0a9ytzDSVzBy2YKFK+emCPOEibLeCrg==",
|
||||
"version": "2.0.4",
|
||||
"resolved": "https://registry.npmjs.org/micromark-core-commonmark/-/micromark-core-commonmark-2.0.4.tgz",
|
||||
"integrity": "sha512-wxEeE8v8XVvOrxn1TZj74qYhAtTQsSqufHVS3uNVyT1MupXxhyaHk8/9xDNPh9BmL77QNDgWTkZ3RsYHB2ry7w==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
@@ -1264,18 +1344,19 @@
|
||||
"devlop": "^1.0.0",
|
||||
"micromark-factory-destination": "^2.0.0",
|
||||
"micromark-factory-label": "^2.0.0",
|
||||
"micromark-factory-space": "^2.0.0",
|
||||
"micromark-factory-space": "^2.1.0",
|
||||
"micromark-factory-title": "^2.0.0",
|
||||
"micromark-factory-whitespace": "^2.0.0",
|
||||
"micromark-util-character": "^2.0.0",
|
||||
"micromark-util-chunked": "^2.0.0",
|
||||
"micromark-util-classify-character": "^2.0.0",
|
||||
"micromark-util-edit-map": "^1.0.0",
|
||||
"micromark-util-html-tag-name": "^2.0.0",
|
||||
"micromark-util-normalize-identifier": "^2.0.0",
|
||||
"micromark-util-resolve-all": "^2.0.0",
|
||||
"micromark-util-subtokenize": "^2.0.0",
|
||||
"micromark-util-symbol": "^2.0.0",
|
||||
"micromark-util-types": "^2.0.0"
|
||||
"micromark-util-types": "^2.0.3"
|
||||
}
|
||||
},
|
||||
"node_modules/micromark-extension-directive": {
|
||||
@@ -1337,9 +1418,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/micromark-extension-gfm-table": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/micromark-extension-gfm-table/-/micromark-extension-gfm-table-2.1.1.tgz",
|
||||
"integrity": "sha512-t2OU/dXXioARrC6yWfJ4hqB7rct14e8f7m0cbI5hUmDyyIlwv5vEtooptH8INkbLzOatzKuVbQmAYcbWoyz6Dg==",
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/micromark-extension-gfm-table/-/micromark-extension-gfm-table-2.1.2.tgz",
|
||||
"integrity": "sha512-pRzm4kDTu0MjlmBkxmS9yYhw60nncfcEwu9NNdPFSQEFXS95ZKyIIyTSHu/o3ReBUrLKYEq+7YaXCRn/bPB4MA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@@ -1420,9 +1501,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/micromark-factory-space": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/micromark-factory-space/-/micromark-factory-space-2.0.1.tgz",
|
||||
"integrity": "sha512-zRkxjtBxxLd2Sc0d+fbnEunsTj46SWXgXciZmHq0kDYGnck/ZSGj9/wULTV95uoeYiK5hRXP2mJ98Uo4cq/LQg==",
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/micromark-factory-space/-/micromark-factory-space-2.1.0.tgz",
|
||||
"integrity": "sha512-fS8hnLIjnjvdQIj39Geug8wWsR0HrYZ43KShKxNfwT7t2LOHo/LbWZEzEaSOjwtjdCsjoE6syHhonEzW0zv0+Q==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
@@ -1590,6 +1671,26 @@
|
||||
"micromark-util-symbol": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/micromark-util-edit-map": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/micromark-util-edit-map/-/micromark-util-edit-map-1.0.0.tgz",
|
||||
"integrity": "sha512-Pa2ljlsEL6sVwFaYeyrOLSYbQt73JvGbPOYFq+9AElXiSnfI5Q4465RRZ1sHv7lDjDOnGRDDaqPXqClqWK/q1Q==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
"type": "GitHub Sponsors",
|
||||
"url": "https://github.com/sponsors/unifiedjs"
|
||||
},
|
||||
{
|
||||
"type": "OpenCollective",
|
||||
"url": "https://opencollective.com/unified"
|
||||
}
|
||||
],
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"micromark-util-types": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/micromark-util-encode": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/micromark-util-encode/-/micromark-util-encode-2.0.1.tgz",
|
||||
@@ -1727,9 +1828,9 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/micromark-util-types": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/micromark-util-types/-/micromark-util-types-2.0.2.tgz",
|
||||
"integrity": "sha512-Yw0ECSpJoViF1qTU4DC6NwtC4aWGt1EkzaQB8KPPyCRR8z9TWeV0HbEFGTO+ZY1wB22zmxnJqhPyTpOVCpeHTA==",
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/micromark-util-types/-/micromark-util-types-2.0.3.tgz",
|
||||
"integrity": "sha512-oxB2Ik03hI0gv+VNn9tnh1t1YEe9MDPptViAEgfdf3YQHsn0pzGTgCdlSCJXcwhqm8phaEuM7zeEu3QQzVBrPg==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
@@ -2045,6 +2146,16 @@
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/re2js": {
|
||||
"version": "2.9.1",
|
||||
"resolved": "https://registry.npmjs.org/re2js/-/re2js-2.9.1.tgz",
|
||||
"integrity": "sha512-JIT3bEEUZTOR2YS1walNEIfH4cF/cQeZcBUFq7ldqO6lR6g0X5CBq/S8rsa9omzZcsNf8qc36jCkWpKKtncrZg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=20.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/repeat-string": {
|
||||
"version": "1.6.1",
|
||||
"resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz",
|
||||
@@ -2056,14 +2167,14 @@
|
||||
}
|
||||
},
|
||||
"node_modules/run-con": {
|
||||
"version": "1.3.2",
|
||||
"resolved": "https://registry.npmjs.org/run-con/-/run-con-1.3.2.tgz",
|
||||
"integrity": "sha512-CcfE+mYiTcKEzg0IqS08+efdnH0oJ3zV0wSUFBNrMHMuxCtXvBCLzCJHatwuXDcu/RlhjTziTo/a1ruQik6/Yg==",
|
||||
"version": "1.3.3",
|
||||
"resolved": "https://registry.npmjs.org/run-con/-/run-con-1.3.3.tgz",
|
||||
"integrity": "sha512-Lb7OKM9aaykzyoNiHGhSVCjZsvbyy6qDMp2vDXL+MoCfz3GfNJtHYH7uYsU3QNMyInBk++xx+EZ8xZ8Sxs5fNQ==",
|
||||
"dev": true,
|
||||
"license": "(BSD-2-Clause OR MIT OR Apache-2.0)",
|
||||
"dependencies": {
|
||||
"deep-extend": "^0.6.0",
|
||||
"ini": "~4.1.0",
|
||||
"ini": "~7.0.0",
|
||||
"minimist": "^1.2.8",
|
||||
"strip-json-comments": "~3.1.1"
|
||||
},
|
||||
@@ -2100,9 +2211,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/smol-toml": {
|
||||
"version": "1.6.1",
|
||||
"resolved": "https://registry.npmjs.org/smol-toml/-/smol-toml-1.6.1.tgz",
|
||||
"integrity": "sha512-dWUG8F5sIIARXih1DTaQAX4SsiTXhInKf1buxdY9DIg4ZYPZK5nGM1VRIYmEbDbsHt7USo99xSLFu5Q1IqTmsg==",
|
||||
"version": "1.9.1",
|
||||
"resolved": "https://registry.npmjs.org/smol-toml/-/smol-toml-1.9.1.tgz",
|
||||
"integrity": "sha512-j7WyPdf0CJoutMzMoPLF/bVXHtKZIT9Rb4eGeEbWw8X2t5oirjPgpL+OpaENZrILYaXqYwnVH+qgUwVbl+pUJQ==",
|
||||
"dev": true,
|
||||
"license": "BSD-3-Clause",
|
||||
"engines": {
|
||||
@@ -2154,9 +2265,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/string-width": {
|
||||
"version": "8.2.1",
|
||||
"resolved": "https://registry.npmjs.org/string-width/-/string-width-8.2.1.tgz",
|
||||
"integrity": "sha512-IIaP0g3iy9Cyy18w3M9YcaDudujEAVHKt3a3QJg1+sr/oX96TbaGUubG0hJyCjCBThFH+tFpcIyoUHUn1ogaLA==",
|
||||
"version": "8.3.0",
|
||||
"resolved": "https://registry.npmjs.org/string-width/-/string-width-8.3.0.tgz",
|
||||
"integrity": "sha512-ZbmZM0JCihQN91dWnxoipT2KOEyHqEyfRXUyjuRhW8b/xnqPDoq4gWEVApTVa9db2wN8mmoikgFBbjh71+cGeQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@@ -2224,9 +2335,9 @@
|
||||
"license": "0BSD"
|
||||
},
|
||||
"node_modules/uc.micro": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-2.1.0.tgz",
|
||||
"integrity": "sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==",
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-3.0.0.tgz",
|
||||
"integrity": "sha512-U3PppEkleoTnIfi8BozMx3yju3qc/L6SwqWo2Sw+54PX+PX0q9I+r1Um5HCmqD7n9VDX5/v3vQH/AjA6deDdtw==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
|
||||
+1
-1
@@ -16,6 +16,6 @@
|
||||
"devDependencies": {
|
||||
"@bitnami/readme-generator-for-helm": "^2.5.0",
|
||||
"markdown-link-check": "^3.13.6",
|
||||
"markdownlint-cli": "^0.49.0"
|
||||
"markdownlint-cli": "^0.50.0"
|
||||
}
|
||||
}
|
||||
+121
@@ -0,0 +1,121 @@
|
||||
{
|
||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||
"configMigration": true,
|
||||
"customManagers": [
|
||||
{
|
||||
"customType": "regex",
|
||||
"datasourceTemplate": "github-releases",
|
||||
"fileMatch": [
|
||||
".vscode/settings\\.json$"
|
||||
],
|
||||
"matchStrings": [
|
||||
"https:\\/\\/raw\\.githubusercontent\\.com\\/(?<depName>[^\\s]+?)\\/(?<currentValue>v[0-9.]+?)\\/schema\\/helm-testsuite\\.json"
|
||||
]
|
||||
},
|
||||
{
|
||||
"customType": "regex",
|
||||
"fileMatch": [
|
||||
"(^|/)(workflow-templates|\\.(?:github|gitea|forgejo)/(?:workflows|actions))/.+\\.ya?ml$",
|
||||
"(^|/)Makefile$",
|
||||
"(^|/)[\\w-]*\\.sh$"
|
||||
],
|
||||
"matchStrings": [
|
||||
"\"?(?<currentValue>[\\w.]*)\"? # renovate:(?:[[:blank:]]+datasource=['\"]*(?<datasource>[^\\s\"']*)['\"]*|[[:blank:]]+depName=['\"]*(?<depName>[^\\s'\"]*)['\"]*|[[:blank:]]+packageName=['\"]*(?<packageName>[^\\s'\"]*)['\"]*|[[:blank:]]+registryUrl=['\"]*(?<registryUrl>[^\\s'\"]*)['\"]*|[[:blank:]]+updateType=['\"]*(?<updateType>[^\\s'\"]*)['\"]*|[[:blank:]]+versioning=['\"]*(?<versioning>[^\\s'\"]*)['\"]*|[[:blank:]]+extractVersion=['\"]*(?<extractVersion>[^\\s'\"]*)['\"]*)*"
|
||||
]
|
||||
},
|
||||
{
|
||||
"customType": "regex",
|
||||
"fileMatch": [
|
||||
"^Chart\\.yaml$"
|
||||
],
|
||||
"matchStrings": [
|
||||
"appVersion: \"?(?<currentValue>[^\"\\s]+)\"?\\s*"
|
||||
],
|
||||
"datasourceTemplate": "docker",
|
||||
"depNameTemplate": "gitea",
|
||||
"lookupNameTemplate": "docker.gitea.com",
|
||||
"versioningTemplate": "semver"
|
||||
}
|
||||
],
|
||||
"extends": [
|
||||
":dependencyDashboard",
|
||||
":semanticCommitTypeAll(chore)"
|
||||
],
|
||||
"git-submodules": {
|
||||
"description": [
|
||||
"Required because of bats"
|
||||
],
|
||||
"enabled": true
|
||||
},
|
||||
"labels": [
|
||||
"kind/dependency"
|
||||
],
|
||||
"lockFileMaintenance": {
|
||||
"enabled": true,
|
||||
"automerge": true,
|
||||
"schedule": [
|
||||
"at any time"
|
||||
]
|
||||
},
|
||||
"packageRules": [
|
||||
{
|
||||
"automerge": true,
|
||||
"description": [
|
||||
"Additional packageRule, because matchCategories and matchManagers are handled as 'and' operator"
|
||||
],
|
||||
"enabled": true,
|
||||
"matchCategories": [
|
||||
"ci",
|
||||
"custom",
|
||||
"docker",
|
||||
"helm",
|
||||
"js"
|
||||
],
|
||||
"matchUpdateTypes": [
|
||||
"minor",
|
||||
"patch",
|
||||
"digest"
|
||||
]
|
||||
},
|
||||
{
|
||||
"automerge": true,
|
||||
"description": [
|
||||
"Additional packageRule, because matchCategories and matchManagers are handled as 'and' operator"
|
||||
],
|
||||
"enabled": true,
|
||||
"matchManagers": [
|
||||
"git-submodules",
|
||||
],
|
||||
"matchUpdateTypes": [
|
||||
"minor",
|
||||
"patch",
|
||||
"digest"
|
||||
]
|
||||
},
|
||||
{
|
||||
"matchManagers": [
|
||||
"helm-values"
|
||||
],
|
||||
"postUpgradeTasks": {
|
||||
"commands": [
|
||||
"install-tool node",
|
||||
"make readme"
|
||||
],
|
||||
"fileFilters": [
|
||||
"README.md"
|
||||
],
|
||||
"executionMode": "update"
|
||||
}
|
||||
}
|
||||
],
|
||||
"platformAutomerge": true,
|
||||
"prConcurrentLimit": 0,
|
||||
"prHourlyLimit": 0,
|
||||
"rebaseLabel": "renovate/rebase",
|
||||
"rebaseWhen": "behind-base-branch",
|
||||
"semanticCommits": "enabled",
|
||||
"suppressNotifications": [
|
||||
"prEditedNotification",
|
||||
"prIgnoreNotification"
|
||||
]
|
||||
}
|
||||
-136
@@ -1,136 +0,0 @@
|
||||
{
|
||||
$schema: "https://docs.renovatebot.com/renovate-schema.json",
|
||||
extends: [
|
||||
"gitea>gitea/renovate-config",
|
||||
"helpers:pinGitHubActionDigests",
|
||||
":automergeMinor",
|
||||
"schedule:automergeDaily",
|
||||
"schedule:weekends",
|
||||
],
|
||||
labels: [
|
||||
"kind/dependency",
|
||||
],
|
||||
digest: {
|
||||
automerge: true,
|
||||
},
|
||||
automergeStrategy: "squash",
|
||||
"git-submodules": {
|
||||
enabled: true,
|
||||
},
|
||||
customManagers: [
|
||||
{
|
||||
description: "Gitea-version of https://docs.renovatebot.com/presets-regexManagers/#regexmanagersgithubactionsversions",
|
||||
customType: "regex",
|
||||
managerFilePatterns: [
|
||||
"/.gitea/workflows/.+\\.ya?ml$/",
|
||||
],
|
||||
matchStrings: [
|
||||
"# renovate: datasource=(?<datasource>[a-z-.]+?) depName=(?<depName>[^\\s]+?)(?: (?:lookupName|packageName)=(?<packageName>[^\\s]+?))?(?: versioning=(?<versioning>[a-z-0-9]+?))?\\s+[A-Za-z0-9_]+?_VERSION\\s*:\\s*[\"']?(?<currentValue>.+?)[\"']?\\s",
|
||||
],
|
||||
},
|
||||
{
|
||||
description: "Detect helm-unittest yaml schema file",
|
||||
customType: "regex",
|
||||
managerFilePatterns: [
|
||||
"/.vscode/settings\\.json$/",
|
||||
],
|
||||
matchStrings: [
|
||||
"https:\\/\\/raw\\.githubusercontent\\.com\\/(?<depName>[^\\s]+?)\\/(?<currentValue>v[0-9.]+?)\\/schema\\/helm-testsuite\\.json",
|
||||
],
|
||||
datasourceTemplate: "github-releases",
|
||||
},
|
||||
{
|
||||
description: "Automatically detect new Gitea releases",
|
||||
customType: "regex",
|
||||
datasourceTemplate: "github-releases",
|
||||
depNameTemplate: "gitea/gitea",
|
||||
extractVersionTemplate: "^v(?<version>.*)$",
|
||||
managerFilePatterns: [
|
||||
"/(^|/)Chart\\.ya?ml$/",
|
||||
],
|
||||
matchStrings: [
|
||||
"^appVersion:\\s+[\"']?(?<currentVersion>\\S+)[\"']?$",
|
||||
],
|
||||
},
|
||||
],
|
||||
lockFileMaintenance: {
|
||||
"enabled": true,
|
||||
"commitMessageAction": "update",
|
||||
"commitMessageTopic": "lockfiles",
|
||||
schedule: [
|
||||
"at any time",
|
||||
]
|
||||
},
|
||||
packageRules: [
|
||||
{
|
||||
groupName: "subcharts (minor & patch)",
|
||||
matchManagers: [
|
||||
"helmv3",
|
||||
],
|
||||
matchUpdateTypes: [
|
||||
"minor",
|
||||
"patch",
|
||||
"digest",
|
||||
],
|
||||
},
|
||||
{
|
||||
groupName: "bats testing framework",
|
||||
matchManagers: [
|
||||
"git-submodules",
|
||||
],
|
||||
matchUpdateTypes: [
|
||||
"minor",
|
||||
"patch",
|
||||
"digest",
|
||||
],
|
||||
},
|
||||
{
|
||||
groupName: "workflow dependencies (minor & patch)",
|
||||
matchManagers: [
|
||||
"github-actions",
|
||||
"npm",
|
||||
"custom.regex",
|
||||
],
|
||||
matchUpdateTypes: [
|
||||
"minor",
|
||||
"patch",
|
||||
"digest",
|
||||
],
|
||||
matchFileNames: [
|
||||
"!Chart.yaml",
|
||||
],
|
||||
},
|
||||
{
|
||||
description: "Update README.md on changes in values.yaml",
|
||||
matchManagers: [
|
||||
"helm-values",
|
||||
],
|
||||
postUpgradeTasks: {
|
||||
commands: [
|
||||
"install-tool node",
|
||||
"make readme",
|
||||
],
|
||||
fileFilters: [
|
||||
"README.md",
|
||||
],
|
||||
executionMode: "update",
|
||||
},
|
||||
},
|
||||
{
|
||||
description: "Override changelog url for Helm image, to have release notes in our PRs",
|
||||
matchDepNames: [
|
||||
"alpine/helm",
|
||||
],
|
||||
changelogUrl: "https://github.com/helm/helm",
|
||||
},
|
||||
{
|
||||
description: "Bump Gitea as fast as possible - not only on weekends",
|
||||
matchDepNames: [
|
||||
"go-gitea/gitea",
|
||||
],
|
||||
schedule: [
|
||||
"at any time",
|
||||
],
|
||||
},
|
||||
],
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -eu
|
||||
|
||||
timeout_delay=15
|
||||
|
||||
check_token() {
|
||||
set +e
|
||||
|
||||
echo "Checking for existing token..."
|
||||
token="$(kubectl get secret "$SECRET_NAME" -o jsonpath="{.data['token']}" 2> /dev/null)"
|
||||
[ $? -ne 0 ] && return 1
|
||||
[ -z "$token" ] && return 2
|
||||
return 0
|
||||
}
|
||||
|
||||
create_token() {
|
||||
echo "Waiting for new token to be generated..."
|
||||
begin=$(date +%s)
|
||||
end=$((begin + timeout_delay))
|
||||
while true; do
|
||||
[ -f /data/actions/token ] && return 0
|
||||
[ "$(date +%s)" -gt $end ] && return 1
|
||||
sleep 5
|
||||
done
|
||||
}
|
||||
|
||||
store_token() {
|
||||
echo "Storing the token in Kubernetes secret..."
|
||||
kubectl patch secret "$SECRET_NAME" -p "{\"data\":{\"token\":\"$(base64 /data/actions/token | tr -d '\n')\"}}"
|
||||
}
|
||||
|
||||
if check_token; then
|
||||
echo "Key already in place, exiting."
|
||||
exit
|
||||
fi
|
||||
|
||||
if ! create_token; then
|
||||
echo "Checking for an existing act runner token in secret $SECRET_NAME timed out after $timeout_delay"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
store_token
|
||||
@@ -2,7 +2,8 @@
|
||||
set -euo pipefail
|
||||
|
||||
function env2ini::log() {
|
||||
printf "${1}\n"
|
||||
# '%b' expands the \n escapes of the callers without treating the message itself as a format string
|
||||
printf '%b\n' "${1}"
|
||||
}
|
||||
|
||||
function env2ini::read_config_to_env() {
|
||||
@@ -15,7 +16,8 @@ function env2ini::read_config_to_env() {
|
||||
fi
|
||||
|
||||
# 'xargs echo -n' trims all leading/trailing whitespaces and a trailing new line
|
||||
local setting="$(awk -F '=' '{print $1}' <<< "${line}" | xargs echo -n)"
|
||||
local setting
|
||||
setting="$(awk -F '=' '{print $1}' <<< "${line}" | xargs echo -n)"
|
||||
|
||||
if [[ -z "${setting}" ]]; then
|
||||
env2ini::log ' ! invalid setting'
|
||||
@@ -33,19 +35,23 @@ function env2ini::read_config_to_env() {
|
||||
|
||||
env2ini::log " + '${setting}'"
|
||||
|
||||
local masked_setting="${setting//./_0X2E_}"
|
||||
masked_setting="${masked_setting//-/_0X2D_}"
|
||||
|
||||
if [[ -z "${section}" ]]; then
|
||||
export "GITEA____${setting^^}=${value}" # '^^' makes the variable content uppercase
|
||||
env2ini::set_config_env "GITEA____${masked_setting}" "${value}"
|
||||
return
|
||||
fi
|
||||
|
||||
local masked_section="${section//./_0X2E_}" # '//' instructs to replace all matches
|
||||
masked_section="${masked_section//-/_0X2D_}"
|
||||
|
||||
export "GITEA__${masked_section^^}__${setting^^}=${value}" # '^^' makes the variable content uppercase
|
||||
env2ini::set_config_env "GITEA__${masked_section^^}__${masked_setting}" "${value}"
|
||||
}
|
||||
|
||||
function env2ini::reload_preset_envs() {
|
||||
env2ini::log "Reloading preset envs..."
|
||||
local -A preset_names=()
|
||||
|
||||
while read -r line; do
|
||||
if [[ -z "${line}" ]]; then
|
||||
@@ -54,7 +60,8 @@ function env2ini::reload_preset_envs() {
|
||||
fi
|
||||
|
||||
# 'xargs echo -n' trims all leading/trailing whitespaces and a trailing new line
|
||||
local setting="$(awk -F '=' '{print $1}' <<< "${line}" | xargs echo -n)"
|
||||
local setting
|
||||
setting="$(awk -F '=' '{print $1}' <<< "${line}" | xargs echo -n)"
|
||||
|
||||
if [[ -z "${setting}" ]]; then
|
||||
env2ini::log ' ! invalid setting'
|
||||
@@ -72,15 +79,32 @@ function env2ini::reload_preset_envs() {
|
||||
|
||||
env2ini::log " + '${setting}'"
|
||||
|
||||
export "${setting^^}=${value}" # '^^' makes the variable content uppercase
|
||||
if env2ini::decode_config_env "${setting}"; then
|
||||
local identity="${#gitea_decoded_section}:${gitea_decoded_section}${gitea_decoded_key}"
|
||||
if [[ -v 'preset_names["${identity}"]' ]]; then
|
||||
env2ini::log " ! conflicting preset environment variables: ${preset_names["${identity}"]} and ${setting}"
|
||||
return 1
|
||||
fi
|
||||
preset_names["${identity}"]="${setting}"
|
||||
fi
|
||||
|
||||
local section_and_key="${setting#GITEA__}"
|
||||
if [[ "${section_and_key}" == *'__'* ]]; then
|
||||
local section="${section_and_key%%__*}"
|
||||
local key="${section_and_key#*__}"
|
||||
env2ini::set_config_env "GITEA__${section^^}__${key}" "${value}"
|
||||
else
|
||||
env2ini::set_config_env "${setting}" "${value}"
|
||||
fi
|
||||
done < "$TMP_EXISTING_ENVS_FILE"
|
||||
|
||||
rm $TMP_EXISTING_ENVS_FILE
|
||||
rm "$TMP_EXISTING_ENVS_FILE"
|
||||
}
|
||||
|
||||
function env2ini::process_config_file() {
|
||||
local config_file="${1}"
|
||||
local section="$(basename "${config_file}")"
|
||||
local section
|
||||
section="$(basename "${config_file}")"
|
||||
|
||||
if [[ $section == '_generals_' ]]; then
|
||||
env2ini::log " [ini root]"
|
||||
@@ -100,7 +124,7 @@ function env2ini::load_config_sources() {
|
||||
if [[ -d "${path}" ]]; then
|
||||
env2ini::log "Processing $(basename "${path}")..."
|
||||
|
||||
while read -d '' configFile; do
|
||||
while read -r -d '' configFile; do
|
||||
env2ini::process_config_file "${configFile}"
|
||||
done < <(find "${path}" -type l -not -name '..data' -print0)
|
||||
|
||||
@@ -114,16 +138,97 @@ function env2ini::generate_initial_secrets() {
|
||||
# - initially used to set up Gitea
|
||||
# Anyway, they won't harm existing app.ini files
|
||||
|
||||
export GITEA__SECURITY__INTERNAL_TOKEN=$(gitea generate secret INTERNAL_TOKEN)
|
||||
export GITEA__SECURITY__SECRET_KEY=$(gitea generate secret SECRET_KEY)
|
||||
export GITEA__OAUTH2__JWT_SECRET=$(gitea generate secret JWT_SECRET)
|
||||
export GITEA__SERVER__LFS_JWT_SECRET=$(gitea generate secret LFS_JWT_SECRET)
|
||||
GITEA__SECURITY__INTERNAL_TOKEN="$(gitea generate secret INTERNAL_TOKEN)"
|
||||
GITEA__SECURITY__SECRET_KEY="$(gitea generate secret SECRET_KEY)"
|
||||
GITEA__OAUTH2__JWT_SECRET="$(gitea generate secret JWT_SECRET)"
|
||||
GITEA__SERVER__LFS_JWT_SECRET="$(gitea generate secret LFS_JWT_SECRET)"
|
||||
export GITEA__SECURITY__INTERNAL_TOKEN \
|
||||
GITEA__SECURITY__SECRET_KEY \
|
||||
GITEA__OAUTH2__JWT_SECRET \
|
||||
GITEA__SERVER__LFS_JWT_SECRET
|
||||
|
||||
env2ini::log "...Initial secrets generated\n"
|
||||
}
|
||||
|
||||
function env2ini::decode_config_env() {
|
||||
local encoded="${1#GITEA__}"
|
||||
encoded="${encoded%__FILE}"
|
||||
local escape_regex='_0[xX]([0-9a-fA-F][0-9a-fA-F])+_'
|
||||
local section='' key='' before escape hex byte
|
||||
local in_key=false
|
||||
|
||||
while [[ "${encoded}" =~ ${escape_regex} ]]; do
|
||||
escape="${BASH_REMATCH[0]}"
|
||||
before="${encoded%%"${escape}"*}"
|
||||
if [[ "${in_key}" == false && "${before}" == *'__'* ]]; then
|
||||
section+="${before%%__*}"
|
||||
key+="${before#*__}"
|
||||
in_key=true
|
||||
elif [[ "${in_key}" == false ]]; then
|
||||
section+="${before}"
|
||||
else
|
||||
key+="${before}"
|
||||
fi
|
||||
|
||||
hex="${escape:3:${#escape}-4}"
|
||||
while [[ -n "${hex}" ]]; do
|
||||
if [[ "${hex:0:2}" == 00 ]]; then
|
||||
return 1
|
||||
fi
|
||||
printf -v byte '%b' "\\x${hex:0:2}"
|
||||
if [[ "${in_key}" == false ]]; then
|
||||
section+="${byte}"
|
||||
else
|
||||
key+="${byte}"
|
||||
fi
|
||||
hex="${hex:2}"
|
||||
done
|
||||
encoded="${encoded#*"${escape}"}"
|
||||
done
|
||||
|
||||
if [[ "${in_key}" == false && "${encoded}" == *'__'* ]]; then
|
||||
section+="${encoded%%__*}"
|
||||
key+="${encoded#*__}"
|
||||
elif [[ "${in_key}" == true ]]; then
|
||||
key+="${encoded}"
|
||||
fi
|
||||
|
||||
[[ -n "${key}" ]] || return 1
|
||||
gitea_decoded_section="${section,,}"
|
||||
gitea_decoded_key="${key}"
|
||||
}
|
||||
|
||||
function env2ini::set_config_env() {
|
||||
local name="${1}" value="${2}" existing
|
||||
if env2ini::decode_config_env "${name}"; then
|
||||
local target_section="${gitea_decoded_section}" target_key="${gitea_decoded_key}"
|
||||
while IFS= read -r existing; do
|
||||
if env2ini::decode_config_env "${existing}" &&
|
||||
[[ "${gitea_decoded_section}" == "${target_section}" && "${gitea_decoded_key}" == "${target_key}" ]]; then
|
||||
unset "${existing}"
|
||||
fi
|
||||
done < <(compgen -e | grep '^GITEA__' || true)
|
||||
fi
|
||||
export "${name}=${value}"
|
||||
}
|
||||
|
||||
function env2ini::is_protected_secret() {
|
||||
env2ini::decode_config_env "${1}" || return 1
|
||||
case "${gitea_decoded_section}__${gitea_decoded_key}" in
|
||||
security__INTERNAL_TOKEN|security__SECRET_KEY|oauth2__JWT_SECRET|server__LFS_JWT_SECRET)
|
||||
return 0
|
||||
;;
|
||||
*)
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# save existing envs prior to script execution. Necessary to keep order of preexisting and custom envs
|
||||
env | (grep -e '^GITEA__' || [[ $? == 1 ]]) > $TMP_EXISTING_ENVS_FILE
|
||||
env | (grep -e '^GITEA__' || [[ $? == 1 ]]) > "$TMP_EXISTING_ENVS_FILE"
|
||||
while IFS= read -r setting; do
|
||||
unset "${setting}"
|
||||
done < <(compgen -e | grep '^GITEA__' || true)
|
||||
|
||||
# MUST BE CALLED BEFORE OTHER CONFIGURATION
|
||||
env2ini::generate_initial_secrets
|
||||
@@ -137,17 +242,25 @@ env2ini::reload_preset_envs
|
||||
env2ini::log "=== All configuration sources loaded ===\n"
|
||||
|
||||
# safety to prevent rewrite of secret keys if an app.ini already exists
|
||||
if [ -f ${GITEA_APP_INI} ]; then
|
||||
if [ -f "${GITEA_APP_INI}" ]; then
|
||||
env2ini::log 'An app.ini file already exists. To prevent overwriting secret keys, these settings are dropped and remain unchanged:'
|
||||
env2ini::log ' - security.INTERNAL_TOKEN'
|
||||
env2ini::log ' - security.SECRET_KEY'
|
||||
env2ini::log ' - oauth2.JWT_SECRET'
|
||||
env2ini::log ' - server.LFS_JWT_SECRET'
|
||||
|
||||
unset GITEA__SECURITY__INTERNAL_TOKEN
|
||||
unset GITEA__SECURITY__SECRET_KEY
|
||||
unset GITEA__OAUTH2__JWT_SECRET
|
||||
unset GITEA__SERVER__LFS_JWT_SECRET
|
||||
while IFS= read -r setting; do
|
||||
if env2ini::is_protected_secret "${setting}"; then
|
||||
unset "${setting}"
|
||||
fi
|
||||
done < <(compgen -e | grep '^GITEA__' || true)
|
||||
fi
|
||||
|
||||
gitea config edit-ini --apply-env --config "$GITEA_APP_INI" --out "$GITEA_APP_INI"
|
||||
if [[ "${GITEA_REBUILD_APP_INI:-false}" == "true" && -f "${GITEA_APP_INI}" ]]; then
|
||||
keep_keys_file="$(mktemp)"
|
||||
trap 'rm -f "${keep_keys_file}"' EXIT
|
||||
printf '%s\n' '[security]' 'SECRET_KEY=' 'INTERNAL_TOKEN=' '[oauth2]' 'JWT_SECRET=' '[server]' 'LFS_JWT_SECRET=' > "${keep_keys_file}"
|
||||
gitea config edit-ini --apply-env --config "$GITEA_APP_INI" --config-keep-keys "${keep_keys_file}" --out "$GITEA_APP_INI"
|
||||
else
|
||||
gitea config edit-ini --apply-env --config "$GITEA_APP_INI" --out "$GITEA_APP_INI"
|
||||
fi
|
||||
@@ -0,0 +1,24 @@
|
||||
{{/* vim: set filetype=mustache: */}}
|
||||
|
||||
{{/* annotations */}}
|
||||
|
||||
{{- define "gitea.cluster.cloudnativePG.annotations" -}}
|
||||
{{- with .Values.cloudnativePG.annotations }}
|
||||
{{- toYaml . -}}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/* labels */}}
|
||||
|
||||
{{- define "gitea.cluster.cloudnativePG.labels" -}}
|
||||
{{ include "gitea.labels" . }}
|
||||
{{- with .Values.cloudnativePG.labels }}
|
||||
{{ toYaml . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/* names */}}
|
||||
|
||||
{{- define "gitea.cluster.cloudnativePG.name" -}}
|
||||
{{ include "gitea.fullname" . }}-postgresql
|
||||
{{- end }}
|
||||
+8
-49
@@ -166,15 +166,6 @@ version: {{ .Values.deployment.gitea.image.tag | default .Chart.AppVersion | quo
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "gitea.labels.actRunner" -}}
|
||||
helm.sh/chart: {{ include "gitea.chart" . }}
|
||||
app: {{ include "gitea.name" . }}-act-runner
|
||||
{{ include "gitea.selectorLabels.actRunner" . }}
|
||||
app.kubernetes.io/version: {{ .Values.deployment.gitea.image.tag | default .Chart.AppVersion | quote }}
|
||||
version: {{ .Values.deployment.gitea.image.tag | default .Chart.AppVersion | quote }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Selector labels
|
||||
*/}}
|
||||
@@ -183,20 +174,9 @@ app.kubernetes.io/name: {{ include "gitea.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "gitea.selectorLabels.actRunner" -}}
|
||||
app.kubernetes.io/name: {{ include "gitea.name" . }}-act-runner
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "postgresql-ha.dns" -}}
|
||||
{{- if (index .Values "postgresql-ha").enabled -}}
|
||||
{{- printf "%s-postgresql-ha-pgpool.%s.svc.%s:%g" .Release.Name .Release.Namespace .Values.clusterDomain (index .Values "postgresql-ha" "service" "ports" "postgresql") -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "postgresql.dns" -}}
|
||||
{{- if (index .Values "postgresql").enabled -}}
|
||||
{{- printf "%s-postgresql.%s.svc.%s:%g" .Release.Name .Release.Namespace .Values.clusterDomain .Values.postgresql.global.postgresql.service.ports.postgresql -}}
|
||||
{{- define "cloudnativePG.dns" -}}
|
||||
{{- if .Values.cloudnativePG.enabled -}}
|
||||
{{- printf "%s-rw.%s.svc.%s:5432" (include "gitea.cluster.cloudnativePG.name" .) (.Values.namespace | default .Release.Namespace) .Values.clusterDomain -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
@@ -455,41 +435,20 @@ https
|
||||
{{- end -}}
|
||||
|
||||
{{- define "gitea.inline_configuration.defaults.database" -}}
|
||||
{{- if (index .Values "postgresql-ha" "enabled") -}}
|
||||
{{- if .Values.cloudnativePG.enabled -}}
|
||||
{{/* PASSWD is injected as an env-to-ini variable from the credentials Secret. */}}
|
||||
{{- $_ := set .Values.gitea.config.database "DB_TYPE" "postgres" -}}
|
||||
{{- if not (.Values.gitea.config.database.HOST) -}}
|
||||
{{- $_ := set .Values.gitea.config.database "HOST" (include "postgresql-ha.dns" .) -}}
|
||||
{{- $_ := set .Values.gitea.config.database "HOST" (include "cloudnativePG.dns" .) -}}
|
||||
{{- end -}}
|
||||
{{- $_ := set .Values.gitea.config.database "NAME" (index .Values "postgresql-ha" "global" "postgresql" "database") -}}
|
||||
{{- $_ := set .Values.gitea.config.database "USER" (index .Values "postgresql-ha" "global" "postgresql" "username") -}}
|
||||
{{- $_ := set .Values.gitea.config.database "PASSWD" (index .Values "postgresql-ha" "global" "postgresql" "password") -}}
|
||||
{{- end -}}
|
||||
{{- if (index .Values "postgresql" "enabled") -}}
|
||||
{{- $_ := set .Values.gitea.config.database "DB_TYPE" "postgres" -}}
|
||||
{{- if not (.Values.gitea.config.database.HOST) -}}
|
||||
{{- $_ := set .Values.gitea.config.database "HOST" (include "postgresql.dns" .) -}}
|
||||
{{- end -}}
|
||||
{{- $_ := set .Values.gitea.config.database "NAME" .Values.postgresql.global.postgresql.auth.database -}}
|
||||
{{- $_ := set .Values.gitea.config.database "USER" .Values.postgresql.global.postgresql.auth.username -}}
|
||||
{{- $_ := set .Values.gitea.config.database "PASSWD" .Values.postgresql.global.postgresql.auth.password -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "gitea.init-additional-mounts" -}}
|
||||
{{- /* Honor the deprecated extraVolumeMounts variable when defined */ -}}
|
||||
{{- if gt (len .Values.extraInitVolumeMounts) 0 -}}
|
||||
{{- toYaml .Values.extraInitVolumeMounts -}}
|
||||
{{- else if gt (len .Values.extraVolumeMounts) 0 -}}
|
||||
{{- toYaml .Values.extraVolumeMounts -}}
|
||||
{{- $_ := set .Values.gitea.config.database "NAME" .Values.cloudnativePG.credentials.database -}}
|
||||
{{- $_ := set .Values.gitea.config.database "USER" .Values.cloudnativePG.credentials.username -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "gitea.container-additional-mounts" -}}
|
||||
{{- /* Honor the deprecated extraVolumeMounts variable when defined */ -}}
|
||||
{{- if gt (len .Values.deployment.gitea.volumeMounts) 0 -}}
|
||||
{{- toYaml .Values.deployment.gitea.volumeMounts -}}
|
||||
{{- else if gt (len .Values.extraVolumeMounts) 0 -}}
|
||||
{{- toYaml .Values.extraVolumeMounts -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
|
||||
@@ -43,7 +43,6 @@
|
||||
{{- if .Values.persistence.new.subPath }}
|
||||
subPath: {{ .Values.persistence.new.subPath }}
|
||||
{{- end }}
|
||||
{{- include "gitea.init-additional-mounts" . | nindent 4 }}
|
||||
{{- with $config.volumeMounts }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
@@ -85,6 +84,15 @@
|
||||
value: /tmp/existing-envs
|
||||
- name: ENV_TO_INI_MOUNT_POINT
|
||||
value: /env-to-ini-mounts
|
||||
- name: GITEA_REBUILD_APP_INI
|
||||
value: {{ $config.config.rebuild | quote }}
|
||||
{{- if .Values.cloudnativePG.enabled }}
|
||||
- name: GITEA__database__PASSWD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
key: {{ include "gitea.secret.cloudnativePG.passwordKey" . }}
|
||||
name: {{ include "gitea.secret.cloudnativePG.name" . }}
|
||||
{{- end }}
|
||||
{{- if .Values.deployment.gitea.env }}
|
||||
{{- toYaml .Values.deployment.gitea.env | nindent 4 }}
|
||||
{{- end }}
|
||||
@@ -114,7 +122,6 @@
|
||||
- name: additional-config-sources-{{ $idx }}
|
||||
mountPath: "/env-to-ini-mounts/additionals/{{ $idx }}/"
|
||||
{{- end }}
|
||||
{{- include "gitea.init-additional-mounts" . | nindent 4 }}
|
||||
{{- with $config.volumeMounts }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
@@ -174,9 +181,6 @@
|
||||
- name: gpg-private-key
|
||||
mountPath: /raw
|
||||
readOnly: true
|
||||
{{- if .Values.extraVolumeMounts }}
|
||||
{{- toYaml .Values.extraVolumeMounts | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- with $config.volumeMounts }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
@@ -295,7 +299,6 @@
|
||||
{{- if .Values.persistence.new.subPath }}
|
||||
subPath: {{ .Values.persistence.new.subPath }}
|
||||
{{- end }}
|
||||
{{- include "gitea.init-additional-mounts" . | nindent 4 }}
|
||||
{{- with $config.volumeMounts }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
|
||||
@@ -9,6 +9,11 @@
|
||||
checksum/admin: {{ include "gitea.secret.checksum" (list . "admin") }}
|
||||
{{- end }}
|
||||
|
||||
{{/* secret - cloudnativePG */}}
|
||||
{{- if and .Values.cloudnativePG.enabled .Values.cloudnativePG.credentials.addSHASumAnnotation }}
|
||||
checksum/cloudnativePG: {{ include "gitea.secret.checksum" (list . "cloudnativePG") }}
|
||||
{{- end }}
|
||||
|
||||
{{/* secret - config */}}
|
||||
{{- if and .Values.secrets.config.enabled .Values.secrets.config.addSHASumAnnotation }}
|
||||
checksum/config: {{ include "gitea.secret.checksum" (list . "config") }}
|
||||
|
||||
+34
-1
@@ -8,6 +8,12 @@
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- define "gitea.secret.cloudnativePG.annotations" -}}
|
||||
{{- with .Values.cloudnativePG.credentials.new.annotations }}
|
||||
{{- toYaml . -}}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- define "gitea.secret.config.annotations" -}}
|
||||
{{- with .Values.secrets.config.new.annotations }}
|
||||
{{- toYaml . -}}
|
||||
@@ -49,7 +55,11 @@ Arguments: (list $root $key)
|
||||
{{- define "gitea.secret.checksum" -}}
|
||||
{{- $root := index . 0 -}}
|
||||
{{- $key := index . 1 -}}
|
||||
{{- if (index $root.Values.secrets $key).existingSecret.enabled -}}
|
||||
{{- $config := index $root.Values.secrets $key -}}
|
||||
{{- if eq $key "cloudnativePG" -}}
|
||||
{{- $config = $root.Values.cloudnativePG.credentials -}}
|
||||
{{- end -}}
|
||||
{{- if $config.existingSecret.enabled -}}
|
||||
{{- $namespace := $root.Values.namespace | default $root.Release.Namespace -}}
|
||||
{{- $name := include (printf "gitea.secret.%s.name" $key) $root -}}
|
||||
{{- lookup "v1" "Secret" $namespace $name | toYaml | sha256sum -}}
|
||||
@@ -68,6 +78,13 @@ Arguments: (list $root $key)
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- define "gitea.secret.cloudnativePG.labels" -}}
|
||||
{{ include "gitea.labels" . }}
|
||||
{{- with .Values.cloudnativePG.credentials.new.labels }}
|
||||
{{ toYaml . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- define "gitea.secret.config.labels" -}}
|
||||
{{ include "gitea.labels" . }}
|
||||
{{- with .Values.secrets.config.new.labels }}
|
||||
@@ -113,6 +130,14 @@ Arguments: (list $root $key)
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
|
||||
{{- define "gitea.secret.cloudnativePG.name" -}}
|
||||
{{- if .Values.cloudnativePG.credentials.existingSecret.enabled -}}
|
||||
{{ required "`cloudnativePG.credentials.existingSecret.secretName` must be set when `cloudnativePG.credentials.existingSecret.enabled` is enabled" .Values.cloudnativePG.credentials.existingSecret.secretName }}
|
||||
{{- else -}}
|
||||
{{ include "gitea.cluster.cloudnativePG.name" . }}-app
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
|
||||
{{- define "gitea.secret.config.name" -}}
|
||||
{{- if .Values.secrets.config.existingSecret.enabled -}}
|
||||
{{ required "`secrets.config.existingSecret.secretName` must be set when `secrets.config.existingSecret.enabled` is enabled" .Values.secrets.config.existingSecret.secretName }}
|
||||
@@ -179,6 +204,14 @@ username
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
|
||||
{{- define "gitea.secret.cloudnativePG.passwordKey" -}}
|
||||
{{- if .Values.cloudnativePG.credentials.existingSecret.enabled -}}
|
||||
{{ .Values.cloudnativePG.credentials.existingSecret.passwordKey }}
|
||||
{{- else -}}
|
||||
password
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
|
||||
{{- define "gitea.secret.gpg.gpgHomeKey" -}}
|
||||
{{- if .Values.secrets.gpg.existingSecret.enabled -}}
|
||||
{{ .Values.secrets.gpg.existingSecret.gpgHomeKey }}
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
{{- if .Values.cloudnativePG.enabled -}}
|
||||
{{- $registry := .Values.global.imageRegistry | default .Values.cloudnativePG.image.registry -}}
|
||||
apiVersion: postgresql.cnpg.io/v1
|
||||
kind: Cluster
|
||||
metadata:
|
||||
{{- with (include "gitea.cluster.cloudnativePG.annotations" .) }}
|
||||
annotations:
|
||||
{{- . | nindent 4 }}
|
||||
{{- end }}
|
||||
labels:
|
||||
{{- include "gitea.cluster.cloudnativePG.labels" . | nindent 4 }}
|
||||
name: {{ include "gitea.cluster.cloudnativePG.name" . }}
|
||||
namespace: {{ .Values.namespace | default .Release.Namespace }}
|
||||
spec:
|
||||
{{- with .Values.cloudnativePG.affinity }}
|
||||
affinity:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
bootstrap:
|
||||
initdb:
|
||||
database: {{ .Values.cloudnativePG.credentials.database | quote }}
|
||||
owner: {{ .Values.cloudnativePG.credentials.username | quote }}
|
||||
secret:
|
||||
name: {{ include "gitea.secret.cloudnativePG.name" . }}
|
||||
imageName: {{ printf "%s/%s:%s" $registry .Values.cloudnativePG.image.repository (.Values.cloudnativePG.image.tag | toString) | quote }}
|
||||
instances: {{ .Values.cloudnativePG.instances }}
|
||||
monitoring:
|
||||
enablePodMonitor: {{ .Values.cloudnativePG.monitoring.enablePodMonitor }}
|
||||
postgresql:
|
||||
parameters:
|
||||
{{- toYaml .Values.cloudnativePG.postgresql.parameters | nindent 6 }}
|
||||
priorityClassName: {{ .Values.cloudnativePG.priorityClassName | quote }}
|
||||
resources:
|
||||
{{- toYaml .Values.cloudnativePG.resources | nindent 4 }}
|
||||
storage:
|
||||
size: {{ .Values.cloudnativePG.storage.size | quote }}
|
||||
{{- with .Values.cloudnativePG.storage.storageClass }}
|
||||
storageClass: {{ . | quote }}
|
||||
{{- end }}
|
||||
{{- with .Values.cloudnativePG.topologySpreadConstraints }}
|
||||
topologySpreadConstraints:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.cloudnativePG.walStorage.enabled }}
|
||||
walStorage:
|
||||
size: {{ .Values.cloudnativePG.walStorage.size | quote }}
|
||||
{{- with .Values.cloudnativePG.walStorage.storageClass }}
|
||||
storageClass: {{ . | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
@@ -65,11 +65,26 @@
|
||||
{{- fail "`extraContainerVolumeMounts` does no longer exist. Please refer to the changelog and configure `deployment.gitea.volumeMounts` instead." -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/* EXTRA INIT VOLUME MOUNTS */}}
|
||||
{{- if .Values.extraInitVolumeMounts -}}
|
||||
{{- fail "`extraInitVolumeMounts` does no longer exist. Please refer to the changelog and configure `deployment.<initContainer>.volumeMounts` instead." -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/* EXTRA VOLUME MOUNTS */}}
|
||||
{{- if .Values.extraVolumeMounts -}}
|
||||
{{- fail "`extraVolumeMounts` does no longer exist. Please refer to the changelog and configure `deployment.gitea.volumeMounts` and `deployment.<initContainer>.volumeMounts` instead." -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/* EXTRA VOLUMES */}}
|
||||
{{- if .Values.extraVolumes -}}
|
||||
{{- fail "`extraVolumes` does no longer exist. Please refer to the changelog and configure `deployment.volumes` instead." -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/* INGRESS CLASS NAME */}}
|
||||
{{- if hasKey .Values.ingress "className" -}}
|
||||
{{- fail "`ingress.className` does no longer exist. Please refer to the changelog and configure `ingress.ingressClassName` instead." -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/* NODE SELECTOR */}}
|
||||
{{- if .Values.nodeSelector -}}
|
||||
{{- fail "`nodeSelector` does no longer exist. Please refer to the changelog and configure `deployment.nodeSelector` instead." -}}
|
||||
@@ -80,6 +95,16 @@
|
||||
{{- fail "`openshift.hostUsers` does no longer exist. Please refer to the changelog and configure `deployment.hostUsers` instead." -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/* POSTGRESQL */}}
|
||||
{{- if index .Values "postgresql" -}}
|
||||
{{- fail "`postgresql` does no longer exist. Please refer to the changelog and configure `cloudnativePG` instead, which requires the CloudNativePG operator to be installed in the cluster." -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/* POSTGRESQL HA */}}
|
||||
{{- if index .Values "postgresql-ha" -}}
|
||||
{{- fail "`postgresql-ha` does no longer exist. Please refer to the changelog and configure `cloudnativePG` instead, which requires the CloudNativePG operator to be installed in the cluster." -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/* PRIORITY CLASS NAME */}}
|
||||
{{- if .Values.priorityClassName -}}
|
||||
{{- fail "`priorityClassName` does no longer exist. Please refer to the changelog and configure `deployment.priorityClassName` instead." -}}
|
||||
@@ -125,6 +150,11 @@
|
||||
{{- fail "`strategy` does no longer exist. Please refer to the changelog and configure `deployment.strategy` instead." -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/* TEST */}}
|
||||
{{- if .Values.test -}}
|
||||
{{- fail "`test` does no longer exist. Please refer to the changelog. The `helm test` connection Pod has been removed without replacement." -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/* TOLERATIONS */}}
|
||||
{{- if .Values.tolerations -}}
|
||||
{{- fail "`tolerations` does no longer exist. Please refer to the changelog and configure `deployment.tolerations` instead." -}}
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
{{- with (include "gitea.ingress.annotations" .) }}
|
||||
{{- with (include "gitea.ingress.annotations" $) }}
|
||||
annotations:
|
||||
{{- . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- tpl . $ | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- with (include "gitea.ingress.labels" .) }}
|
||||
labels:
|
||||
{{- . | nindent 4 }}
|
||||
@@ -14,7 +14,7 @@ metadata:
|
||||
name: {{ include "gitea.ingress.name" . }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
spec:
|
||||
ingressClassName: {{ tpl .Values.ingress.className . }}
|
||||
ingressClassName: {{ tpl .Values.ingress.ingressClassName $ }}
|
||||
rules:
|
||||
{{- range .Values.ingress.hosts }}
|
||||
- host: {{ tpl .host $ | quote }}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
{{- if and .Values.cloudnativePG.enabled (not .Values.cloudnativePG.credentials.existingSecret.enabled) -}}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
{{- with (include "gitea.secret.cloudnativePG.annotations" .) }}
|
||||
annotations:
|
||||
{{- . | nindent 4 }}
|
||||
{{- end }}
|
||||
labels:
|
||||
{{- include "gitea.secret.cloudnativePG.labels" . | nindent 4 }}
|
||||
name: {{ include "gitea.secret.cloudnativePG.name" . }}
|
||||
namespace: {{ .Values.namespace | default .Release.Namespace }}
|
||||
type: kubernetes.io/basic-auth
|
||||
data:
|
||||
password: {{ required "`cloudnativePG.credentials.new.password` must be set when `cloudnativePG.enabled` is enabled" .Values.cloudnativePG.credentials.new.password | b64enc | quote }}
|
||||
{{- /* CloudNativePG requires the username of a basic-auth bootstrap Secret to match the owner of the Cluster. */}}
|
||||
username: {{ required "`cloudnativePG.credentials.username` must be set when `cloudnativePG.enabled` is enabled" .Values.cloudnativePG.credentials.username | b64enc | quote }}
|
||||
{{- end -}}
|
||||
@@ -14,19 +14,13 @@ metadata:
|
||||
name: {{ include "gitea.secret.config.name" . }}
|
||||
namespace: {{ .Values.namespace | default .Release.Namespace }}
|
||||
type: Opaque
|
||||
stringData:
|
||||
{{ (.Files.Glob "scripts/init-containers/config/*.sh").AsConfig | indent 2 }}
|
||||
assertions: |
|
||||
{{- $assertions | nindent 4 }}
|
||||
data:
|
||||
{{ (.Files.Glob "scripts/init-containers/config/*.sh").AsSecrets | indent 2 }}
|
||||
assertions: {{ $assertions | b64enc | quote }}
|
||||
{{- end }}
|
||||
|
||||
{{- define "gitea.config.assertions" -}}
|
||||
|
||||
{{- /*assert that only one PG dep is enabled */ -}}
|
||||
{{- if and (.Values.postgresql.enabled) (index .Values "postgresql-ha" "enabled") -}}
|
||||
{{- fail "Only one of postgresql or postgresql-ha can be enabled at the same time." -}}
|
||||
{{- end }}
|
||||
|
||||
{{- /* multiple replicas assertions */ -}}
|
||||
{{- if gt (.Values.deployment.replicas | int) 1 -}}
|
||||
{{- if .Values.gitea.config.cron -}}
|
||||
|
||||
+223
-218
@@ -11,224 +11,229 @@ metadata:
|
||||
name: {{ include "gitea.secret.init.name" . }}
|
||||
namespace: {{ .Values.namespace | default .Release.Namespace }}
|
||||
type: Opaque
|
||||
stringData:
|
||||
{{ (.Files.Glob "scripts/init-containers/init/*.sh").AsConfig | indent 2 }}
|
||||
init_directory_structure.sh: |-
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
{{- if .Values.initPreScript }}
|
||||
# BEGIN: initPreScript
|
||||
{{- with .Values.initPreScript -}}
|
||||
{{ . | nindent 4}}
|
||||
{{- end -}}
|
||||
# END: initPreScript
|
||||
{{- end }}
|
||||
|
||||
{{- if not .Values.deployment.gitea.image.rootless }}
|
||||
chown -v 1000:1000 /data
|
||||
{{- end }}
|
||||
mkdir -pv /data/git/.ssh
|
||||
chmod -Rv 700 /data/git/.ssh
|
||||
[ ! -d /data/gitea/conf ] && mkdir -pv /data/gitea/conf
|
||||
|
||||
# prepare temp directory structure
|
||||
mkdir -pv "${GITEA_TEMP}"
|
||||
{{- if not .Values.deployment.gitea.image.rootless }}
|
||||
chown -v 1000:1000 "${GITEA_TEMP}"
|
||||
{{- end }}
|
||||
chmod -v ug+rwx "${GITEA_TEMP}"
|
||||
|
||||
{{ if .Values.secrets.gpg.enabled -}}
|
||||
if [ ! -d "${GNUPGHOME}" ]; then
|
||||
mkdir -pv "${GNUPGHOME}"
|
||||
chmod -v 700 "${GNUPGHOME}"
|
||||
chown -v 1000:1000 "${GNUPGHOME}"
|
||||
data:
|
||||
{{ (.Files.Glob "scripts/init-containers/init/*.sh").AsSecrets | indent 2 }}
|
||||
configure_gitea.sh: {{ include "gitea.init.configureGitea" . | trimAll "\n" | b64enc | quote }}
|
||||
init_directory_structure.sh: {{ include "gitea.init.initDirectoryStructure" . | trimAll "\n" | b64enc | quote }}
|
||||
{{- end }}
|
||||
|
||||
{{- define "gitea.init.initDirectoryStructure" -}}
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
{{- if .Values.initPreScript }}
|
||||
# BEGIN: initPreScript
|
||||
{{- with .Values.initPreScript -}}
|
||||
{{ . | nindent 0 }}
|
||||
{{- end -}}
|
||||
# END: initPreScript
|
||||
{{- end }}
|
||||
|
||||
{{- if not .Values.deployment.gitea.image.rootless }}
|
||||
chown -v 1000:1000 /data
|
||||
{{- end }}
|
||||
mkdir -pv /data/git/.ssh
|
||||
chmod -Rv 700 /data/git/.ssh
|
||||
[ ! -d /data/gitea/conf ] && mkdir -pv /data/gitea/conf
|
||||
|
||||
# prepare temp directory structure
|
||||
mkdir -pv "${GITEA_TEMP}"
|
||||
{{- if not .Values.deployment.gitea.image.rootless }}
|
||||
chown -v 1000:1000 "${GITEA_TEMP}"
|
||||
{{- end }}
|
||||
chmod -v ug+rwx "${GITEA_TEMP}"
|
||||
|
||||
{{ if .Values.secrets.gpg.enabled -}}
|
||||
if [ ! -d "${GNUPGHOME}" ]; then
|
||||
mkdir -pv "${GNUPGHOME}"
|
||||
chmod -v 700 "${GNUPGHOME}"
|
||||
chown -v 1000:1000 "${GNUPGHOME}"
|
||||
fi
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- define "gitea.init.configureGitea" -}}
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
echo '==== BEGIN GITEA CONFIGURATION ===='
|
||||
|
||||
{ # try
|
||||
gitea migrate
|
||||
} || { # catch
|
||||
echo "Gitea migrate might fail due to database connection...This init-container will try again in a few seconds"
|
||||
exit 1
|
||||
}
|
||||
|
||||
{{- if include "valkey.servicename" . }}
|
||||
function test_valkey_connection() {
|
||||
local RETRY=0
|
||||
local MAX=30
|
||||
|
||||
echo 'Wait for valkey to become avialable...'
|
||||
until [ "${RETRY}" -ge "${MAX}" ]; do
|
||||
RES_OPTIONS="ndots:0" nc -vz -w2 {{ include "valkey.servicename" . }} {{ include "valkey.port" . }} && break
|
||||
RETRY=$[${RETRY}+1]
|
||||
echo "...not ready yet (${RETRY}/${MAX})"
|
||||
done
|
||||
|
||||
if [ "${RETRY}" -ge "${MAX}" ]; then
|
||||
echo "Valkey not reachable after '${MAX}' attempts!"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
test_valkey_connection
|
||||
{{- end }}
|
||||
|
||||
|
||||
{{- if .Values.secrets.admin.enabled }}
|
||||
function configure_admin_user() {
|
||||
local full_admin_list=$(gitea admin user list --admin)
|
||||
local actual_user_table=''
|
||||
|
||||
# We might have distorted output due to warning logs, so we have to detect the actual user table by its headline and trim output above that line
|
||||
local regex="(.*)(ID\s+Username\s+Email\s+IsActive.*)"
|
||||
if [[ "${full_admin_list}" =~ $regex ]]; then
|
||||
actual_user_table=$(echo "${BASH_REMATCH[2]}" | tail -n+2) # tail'ing to drop the table headline
|
||||
else
|
||||
# This code block should never be reached, as long as the output table header remains the same.
|
||||
# If this code block is reached, the regex doesn't match anymore and we probably have to adjust this script.
|
||||
|
||||
echo "ERROR: 'configure_admin_user' was not able to determine the current list of admin users."
|
||||
echo " Please review the output of 'gitea admin user list --admin' shown below."
|
||||
echo " If you think it is an issue with the Helm Chart provisioning, file an issue at https://gitea.com/gitea/helm-gitea/issues."
|
||||
echo "DEBUG: Output of 'gitea admin user list --admin'"
|
||||
echo "--"
|
||||
echo "${full_admin_list}"
|
||||
echo "--"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
local ACCOUNT_ID=$(echo "${actual_user_table}" | grep -E "\s+${GITEA_ADMIN_USERNAME}\s+" | awk -F " " "{printf \$1}")
|
||||
if [[ -z "${ACCOUNT_ID}" ]]; then
|
||||
local -a create_args
|
||||
create_args=(--admin --username "${GITEA_ADMIN_USERNAME}" --password "${GITEA_ADMIN_PASSWORD}" --email "${GITEA_ADMIN_EMAIL}")
|
||||
if [[ "${GITEA_ADMIN_PASSWORD_MODE}" = initialOnlyRequireReset ]]; then
|
||||
create_args+=(--must-change-password=true)
|
||||
else
|
||||
create_args+=(--must-change-password=false)
|
||||
fi
|
||||
{{- end }}
|
||||
|
||||
configure_gitea.sh: |-
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
echo '==== BEGIN GITEA CONFIGURATION ===='
|
||||
|
||||
{ # try
|
||||
gitea migrate
|
||||
} || { # catch
|
||||
echo "Gitea migrate might fail due to database connection...This init-container will try again in a few seconds"
|
||||
exit 1
|
||||
}
|
||||
|
||||
{{- if include "valkey.servicename" . }}
|
||||
function test_valkey_connection() {
|
||||
local RETRY=0
|
||||
local MAX=30
|
||||
|
||||
echo 'Wait for valkey to become avialable...'
|
||||
until [ "${RETRY}" -ge "${MAX}" ]; do
|
||||
RES_OPTIONS="ndots:0" nc -vz -w2 {{ include "valkey.servicename" . }} {{ include "valkey.port" . }} && break
|
||||
RETRY=$[${RETRY}+1]
|
||||
echo "...not ready yet (${RETRY}/${MAX})"
|
||||
done
|
||||
|
||||
if [ "${RETRY}" -ge "${MAX}" ]; then
|
||||
echo "Valkey not reachable after '${MAX}' attempts!"
|
||||
exit 1
|
||||
echo "No admin user '${GITEA_ADMIN_USERNAME}' found. Creating now..."
|
||||
gitea admin user create "${create_args[@]}"
|
||||
echo '...created.'
|
||||
else
|
||||
if [[ "${GITEA_ADMIN_PASSWORD_MODE}" = keepUpdated ]]; then
|
||||
echo "Admin account '${GITEA_ADMIN_USERNAME}' already exist. Running update to sync password..."
|
||||
# See https://gitea.com/gitea/helm-gitea/issues/673
|
||||
# --must-change-password argument was added to change-password, defaulting to true, counter to the previous behavior
|
||||
# which acted as if it were provided with =false. If the argument is present in this version of gitea, then we
|
||||
# should add it to prevent requiring frequent admin password resets.
|
||||
local -a change_args
|
||||
change_args=(--username "${GITEA_ADMIN_USERNAME}" --password "${GITEA_ADMIN_PASSWORD}")
|
||||
if gitea admin user change-password --help | grep -F -- '--must-change-password' >/dev/null; then
|
||||
change_args+=(--must-change-password=false)
|
||||
fi
|
||||
}
|
||||
|
||||
test_valkey_connection
|
||||
{{- end }}
|
||||
|
||||
|
||||
{{- if .Values.secrets.admin.enabled }}
|
||||
function configure_admin_user() {
|
||||
local full_admin_list=$(gitea admin user list --admin)
|
||||
local actual_user_table=''
|
||||
|
||||
# We might have distorted output due to warning logs, so we have to detect the actual user table by its headline and trim output above that line
|
||||
local regex="(.*)(ID\s+Username\s+Email\s+IsActive.*)"
|
||||
if [[ "${full_admin_list}" =~ $regex ]]; then
|
||||
actual_user_table=$(echo "${BASH_REMATCH[2]}" | tail -n+2) # tail'ing to drop the table headline
|
||||
else
|
||||
# This code block should never be reached, as long as the output table header remains the same.
|
||||
# If this code block is reached, the regex doesn't match anymore and we probably have to adjust this script.
|
||||
|
||||
echo "ERROR: 'configure_admin_user' was not able to determine the current list of admin users."
|
||||
echo " Please review the output of 'gitea admin user list --admin' shown below."
|
||||
echo " If you think it is an issue with the Helm Chart provisioning, file an issue at https://gitea.com/gitea/helm-gitea/issues."
|
||||
echo "DEBUG: Output of 'gitea admin user list --admin'"
|
||||
echo "--"
|
||||
echo "${full_admin_list}"
|
||||
echo "--"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
local ACCOUNT_ID=$(echo "${actual_user_table}" | grep -E "\s+${GITEA_ADMIN_USERNAME}\s+" | awk -F " " "{printf \$1}")
|
||||
if [[ -z "${ACCOUNT_ID}" ]]; then
|
||||
local -a create_args
|
||||
create_args=(--admin --username "${GITEA_ADMIN_USERNAME}" --password "${GITEA_ADMIN_PASSWORD}" --email "${GITEA_ADMIN_EMAIL}")
|
||||
if [[ "${GITEA_ADMIN_PASSWORD_MODE}" = initialOnlyRequireReset ]]; then
|
||||
create_args+=(--must-change-password=true)
|
||||
else
|
||||
create_args+=(--must-change-password=false)
|
||||
fi
|
||||
echo "No admin user '${GITEA_ADMIN_USERNAME}' found. Creating now..."
|
||||
gitea admin user create "${create_args[@]}"
|
||||
echo '...created.'
|
||||
else
|
||||
if [[ "${GITEA_ADMIN_PASSWORD_MODE}" = keepUpdated ]]; then
|
||||
echo "Admin account '${GITEA_ADMIN_USERNAME}' already exist. Running update to sync password..."
|
||||
# See https://gitea.com/gitea/helm-gitea/issues/673
|
||||
# --must-change-password argument was added to change-password, defaulting to true, counter to the previous behavior
|
||||
# which acted as if it were provided with =false. If the argument is present in this version of gitea, then we
|
||||
# should add it to prevent requiring frequent admin password resets.
|
||||
local -a change_args
|
||||
change_args=(--username "${GITEA_ADMIN_USERNAME}" --password "${GITEA_ADMIN_PASSWORD}")
|
||||
if gitea admin user change-password --help | grep -F -- '--must-change-password' >/dev/null; then
|
||||
change_args+=(--must-change-password=false)
|
||||
fi
|
||||
gitea admin user change-password "${change_args[@]}"
|
||||
echo '...password sync done.'
|
||||
else
|
||||
echo "Admin account '${GITEA_ADMIN_USERNAME}' already exist, but update mode is set to '${GITEA_ADMIN_PASSWORD_MODE}'. Skipping."
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
configure_admin_user
|
||||
{{- end }}
|
||||
|
||||
function configure_ldap() {
|
||||
{{- if .Values.gitea.ldap }}
|
||||
{{- range $idx, $value := .Values.gitea.ldap }}
|
||||
local LDAP_NAME={{ (printf "%s" $value.name) | squote }}
|
||||
local full_auth_list=$(gitea admin auth list --vertical-bars)
|
||||
local actual_auth_table=''
|
||||
|
||||
# We might have distorted output due to warning logs, so we have to detect the actual user table by its headline and trim output above that line
|
||||
local regex="(.*)(ID\s+\|Name\s+\|Type\s+\|Enabled.*)"
|
||||
if [[ "${full_auth_list}" =~ $regex ]]; then
|
||||
actual_auth_table=$(echo "${BASH_REMATCH[2]}" | tail -n+2) # tail'ing to drop the table headline
|
||||
else
|
||||
# This code block should never be reached, as long as the output table header remains the same.
|
||||
# If this code block is reached, the regex doesn't match anymore and we probably have to adjust this script.
|
||||
|
||||
echo "ERROR: 'configure_ldap' was not able to determine the current list of authentication sources."
|
||||
echo " Please review the output of 'gitea admin auth list --vertical-bars' shown below."
|
||||
echo " If you think it is an issue with the Helm Chart provisioning, file an issue at https://gitea.com/gitea/helm-gitea/issues."
|
||||
echo "DEBUG: Output of 'gitea admin auth list --vertical-bars'"
|
||||
echo "--"
|
||||
echo "${full_auth_list}"
|
||||
echo "--"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
local GITEA_AUTH_ID=$(echo "${actual_auth_table}" | grep -E "\|${LDAP_NAME}\s+\|" | grep -iE '\|LDAP \(via BindDN\)\s+\|' | awk -F " " "{print \$1}")
|
||||
|
||||
if [[ -z "${GITEA_AUTH_ID}" ]]; then
|
||||
echo "No ldap configuration found with name '${LDAP_NAME}'. Installing it now..."
|
||||
gitea admin auth add-ldap {{- include "gitea.ldap_settings" (list $idx $value) | indent 1 }}
|
||||
echo '...installed.'
|
||||
else
|
||||
echo "Existing ldap configuration with name '${LDAP_NAME}': '${GITEA_AUTH_ID}'. Running update to sync settings..."
|
||||
gitea admin auth update-ldap --id "${GITEA_AUTH_ID}" {{- include "gitea.ldap_settings" (list $idx $value) | indent 1 }}
|
||||
echo '...sync settings done.'
|
||||
fi
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
echo 'no ldap configuration... skipping.'
|
||||
{{- end }}
|
||||
}
|
||||
|
||||
configure_ldap
|
||||
|
||||
function configure_oauth() {
|
||||
{{- if .Values.gitea.oauth }}
|
||||
{{- range $idx, $value := .Values.gitea.oauth }}
|
||||
local OAUTH_NAME={{ (printf "%s" $value.name) | squote }}
|
||||
local full_auth_list=$(gitea admin auth list --vertical-bars)
|
||||
local actual_auth_table=''
|
||||
|
||||
# We might have distorted output due to warning logs, so we have to detect the actual user table by its headline and trim output above that line
|
||||
local regex="(.*)(ID\s+\|Name\s+\|Type\s+\|Enabled.*)"
|
||||
if [[ "${full_auth_list}" =~ $regex ]]; then
|
||||
actual_auth_table=$(echo "${BASH_REMATCH[2]}" | tail -n+2) # tail'ing to drop the table headline
|
||||
else
|
||||
# This code block should never be reached, as long as the output table header remains the same.
|
||||
# If this code block is reached, the regex doesn't match anymore and we probably have to adjust this script.
|
||||
|
||||
echo "ERROR: 'configure_oauth' was not able to determine the current list of authentication sources."
|
||||
echo " Please review the output of 'gitea admin auth list --vertical-bars' shown below."
|
||||
echo " If you think it is an issue with the Helm Chart provisioning, file an issue at https://gitea.com/gitea/helm-gitea/issues."
|
||||
echo "DEBUG: Output of 'gitea admin auth list --vertical-bars'"
|
||||
echo "--"
|
||||
echo "${full_auth_list}"
|
||||
echo "--"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
local AUTH_ID=$(echo "${actual_auth_table}" | grep -E "\|${OAUTH_NAME}\s+\|" | grep -iE '\|OAuth2\s+\|' | awk -F " " "{print \$1}")
|
||||
|
||||
if [[ -z "${AUTH_ID}" ]]; then
|
||||
echo "No oauth configuration found with name '${OAUTH_NAME}'. Installing it now..."
|
||||
gitea admin auth add-oauth {{- include "gitea.oauth_settings" (list $idx $value) | indent 1 }}
|
||||
echo '...installed.'
|
||||
else
|
||||
echo "Existing oauth configuration with name '${OAUTH_NAME}': '${AUTH_ID}'. Running update to sync settings..."
|
||||
gitea admin auth update-oauth --id "${AUTH_ID}" {{- include "gitea.oauth_settings" (list $idx $value) | indent 1 }}
|
||||
echo '...sync settings done.'
|
||||
fi
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
echo 'no oauth configuration... skipping.'
|
||||
{{- end }}
|
||||
}
|
||||
|
||||
configure_oauth
|
||||
|
||||
echo '==== END GITEA CONFIGURATION ===='
|
||||
gitea admin user change-password "${change_args[@]}"
|
||||
echo '...password sync done.'
|
||||
else
|
||||
echo "Admin account '${GITEA_ADMIN_USERNAME}' already exist, but update mode is set to '${GITEA_ADMIN_PASSWORD_MODE}'. Skipping."
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
configure_admin_user
|
||||
{{- end }}
|
||||
|
||||
function configure_ldap() {
|
||||
{{- if .Values.gitea.ldap }}
|
||||
{{- range $idx, $value := .Values.gitea.ldap }}
|
||||
local LDAP_NAME={{ (printf "%s" $value.name) | squote }}
|
||||
local full_auth_list=$(gitea admin auth list --vertical-bars)
|
||||
local actual_auth_table=''
|
||||
|
||||
# We might have distorted output due to warning logs, so we have to detect the actual user table by its headline and trim output above that line
|
||||
local regex="(.*)(ID\s+\|Name\s+\|Type\s+\|Enabled.*)"
|
||||
if [[ "${full_auth_list}" =~ $regex ]]; then
|
||||
actual_auth_table=$(echo "${BASH_REMATCH[2]}" | tail -n+2) # tail'ing to drop the table headline
|
||||
else
|
||||
# This code block should never be reached, as long as the output table header remains the same.
|
||||
# If this code block is reached, the regex doesn't match anymore and we probably have to adjust this script.
|
||||
|
||||
echo "ERROR: 'configure_ldap' was not able to determine the current list of authentication sources."
|
||||
echo " Please review the output of 'gitea admin auth list --vertical-bars' shown below."
|
||||
echo " If you think it is an issue with the Helm Chart provisioning, file an issue at https://gitea.com/gitea/helm-gitea/issues."
|
||||
echo "DEBUG: Output of 'gitea admin auth list --vertical-bars'"
|
||||
echo "--"
|
||||
echo "${full_auth_list}"
|
||||
echo "--"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
local GITEA_AUTH_ID=$(echo "${actual_auth_table}" | grep -E "\|${LDAP_NAME}\s+\|" | grep -iE '\|LDAP \(via BindDN\)\s+\|' | awk -F " " "{print \$1}")
|
||||
|
||||
if [[ -z "${GITEA_AUTH_ID}" ]]; then
|
||||
echo "No ldap configuration found with name '${LDAP_NAME}'. Installing it now..."
|
||||
gitea admin auth add-ldap {{- include "gitea.ldap_settings" (list $idx $value) | indent 1 }}
|
||||
echo '...installed.'
|
||||
else
|
||||
echo "Existing ldap configuration with name '${LDAP_NAME}': '${GITEA_AUTH_ID}'. Running update to sync settings..."
|
||||
gitea admin auth update-ldap --id "${GITEA_AUTH_ID}" {{- include "gitea.ldap_settings" (list $idx $value) | indent 1 }}
|
||||
echo '...sync settings done.'
|
||||
fi
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
echo 'no ldap configuration... skipping.'
|
||||
{{- end }}
|
||||
}
|
||||
|
||||
configure_ldap
|
||||
|
||||
function configure_oauth() {
|
||||
{{- if .Values.gitea.oauth }}
|
||||
{{- range $idx, $value := .Values.gitea.oauth }}
|
||||
local OAUTH_NAME={{ (printf "%s" $value.name) | squote }}
|
||||
local full_auth_list=$(gitea admin auth list --vertical-bars)
|
||||
local actual_auth_table=''
|
||||
|
||||
# We might have distorted output due to warning logs, so we have to detect the actual user table by its headline and trim output above that line
|
||||
local regex="(.*)(ID\s+\|Name\s+\|Type\s+\|Enabled.*)"
|
||||
if [[ "${full_auth_list}" =~ $regex ]]; then
|
||||
actual_auth_table=$(echo "${BASH_REMATCH[2]}" | tail -n+2) # tail'ing to drop the table headline
|
||||
else
|
||||
# This code block should never be reached, as long as the output table header remains the same.
|
||||
# If this code block is reached, the regex doesn't match anymore and we probably have to adjust this script.
|
||||
|
||||
echo "ERROR: 'configure_oauth' was not able to determine the current list of authentication sources."
|
||||
echo " Please review the output of 'gitea admin auth list --vertical-bars' shown below."
|
||||
echo " If you think it is an issue with the Helm Chart provisioning, file an issue at https://gitea.com/gitea/helm-gitea/issues."
|
||||
echo "DEBUG: Output of 'gitea admin auth list --vertical-bars'"
|
||||
echo "--"
|
||||
echo "${full_auth_list}"
|
||||
echo "--"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
local AUTH_ID=$(echo "${actual_auth_table}" | grep -E "\|${OAUTH_NAME}\s+\|" | grep -iE '\|OAuth2\s+\|' | awk -F " " "{print \$1}")
|
||||
|
||||
if [[ -z "${AUTH_ID}" ]]; then
|
||||
echo "No oauth configuration found with name '${OAUTH_NAME}'. Installing it now..."
|
||||
gitea admin auth add-oauth {{- include "gitea.oauth_settings" (list $idx $value) | indent 1 }}
|
||||
echo '...installed.'
|
||||
else
|
||||
echo "Existing oauth configuration with name '${OAUTH_NAME}': '${AUTH_ID}'. Running update to sync settings..."
|
||||
gitea admin auth update-oauth --id "${AUTH_ID}" {{- include "gitea.oauth_settings" (list $idx $value) | indent 1 }}
|
||||
echo '...sync settings done.'
|
||||
fi
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
echo 'no oauth configuration... skipping.'
|
||||
{{- end }}
|
||||
}
|
||||
|
||||
configure_oauth
|
||||
|
||||
echo '==== END GITEA CONFIGURATION ===='
|
||||
{{- end }}
|
||||
@@ -14,6 +14,8 @@ metadata:
|
||||
name: {{ include "gitea.secret.inlineConfig.name" . }}
|
||||
namespace: {{ .Values.namespace | default .Release.Namespace }}
|
||||
type: Opaque
|
||||
stringData:
|
||||
{{- $inlineConfiguration | nindent 2 }}
|
||||
data:
|
||||
{{- range $key, $value := fromYaml $inlineConfiguration }}
|
||||
{{ $key }}: {{ $value | b64enc | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -1,27 +0,0 @@
|
||||
{{- if .Values.test.enabled }}
|
||||
apiVersion: v1
|
||||
kind: Pod
|
||||
metadata:
|
||||
name: "{{ include "gitea.fullname" . }}-test-connection"
|
||||
namespace: {{ .Values.namespace | default .Release.Namespace }}
|
||||
labels:
|
||||
{{ include "gitea.labels" . | nindent 4 }}
|
||||
annotations:
|
||||
"helm.sh/hook": test-success
|
||||
spec:
|
||||
{{- $hostUsers := include "gitea.hostUsers" . | trim }}
|
||||
{{- $testContainerSecurityContext := include "gitea.containerSecurityContext" (list . (dict)) | trim }}
|
||||
{{- if $hostUsers }}
|
||||
hostUsers: {{ $hostUsers }}
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: wget
|
||||
image: "{{ .Values.test.image.name }}:{{ .Values.test.image.tag }}"
|
||||
{{- if $testContainerSecurityContext }}
|
||||
securityContext:
|
||||
{{- $testContainerSecurityContext | nindent 8 }}
|
||||
{{- end }}
|
||||
command: ['wget']
|
||||
args: ['{{ include "gitea.service.http.name" . }}:{{ .Values.service.http.port }}']
|
||||
restartPolicy: Never
|
||||
{{- end }}
|
||||
@@ -30,6 +30,11 @@ case "$*" in
|
||||
'generate secret LFS_JWT_SECRET')
|
||||
echo 'mocked-lfs-jwt-secret'
|
||||
;;
|
||||
"config edit-ini --apply-env --config $GITEA_APP_INI --config-keep-keys "*" --out $GITEA_APP_INI")
|
||||
test "$GITEA_EDIT_INI_EXPECTED" -eq 1
|
||||
cat "$7"
|
||||
echo 'Stubbed gitea config edit-ini rebuild was called!'
|
||||
;;
|
||||
"config edit-ini --apply-env --config $GITEA_APP_INI --out $GITEA_APP_INI")
|
||||
if [ "$GITEA_EDIT_INI_EXPECTED" -eq 1 ]; then
|
||||
echo 'Stubbed gitea config edit-ini was called!'
|
||||
@@ -63,7 +68,13 @@ function execute_test_script() {
|
||||
currentEnvsAfter=$(env | sort)
|
||||
|
||||
# diff as unified +/- output without context before/after
|
||||
diff --unified=0 <(echo "$currentEnvsBefore") <(echo "$currentEnvsAfter")
|
||||
local diffStatus
|
||||
if diff --unified=0 <(echo "$currentEnvsBefore") <(echo "$currentEnvsAfter"); then
|
||||
:
|
||||
else
|
||||
diffStatus=$?
|
||||
[[ $diffStatus == 1 ]] || return "$diffStatus"
|
||||
fi
|
||||
|
||||
exit $exitCode
|
||||
}
|
||||
@@ -115,6 +126,61 @@ function write_mounted_file() {
|
||||
refute_line '+GITEA__SERVER__LFS_JWT_SECRET=mocked-lfs-jwt-secret'
|
||||
}
|
||||
|
||||
@test "protects existing secrets from file and encoded environment variables" {
|
||||
expect_gitea_config_edit_ini_call
|
||||
touch "$GITEA_APP_INI"
|
||||
export GITEA__SECURITY__SECRET_KEY__FILE="/tmp/secret"
|
||||
export GITEA__SEC_0X55_RITY__INTERNAL_TOKEN="override"
|
||||
export GITEA__OAUTH2__JWT_0X5F_SECRET__FILE="/tmp/jwt"
|
||||
export GITEA__SERVER__LFS_JWT_SECRET="override"
|
||||
export GITEA__SECURITY__OTHER__FILE="/tmp/other"
|
||||
export GITEA___0x7365637572697479____0x5345435245545f4b4559_="encoded"
|
||||
export GITEA__SECURITY__secret_key="other-case"
|
||||
|
||||
for GITEA_REBUILD_APP_INI in false true; do
|
||||
export GITEA_REBUILD_APP_INI
|
||||
run execute_test_script
|
||||
|
||||
assert_success
|
||||
assert_line '-GITEA__SECURITY__SECRET_KEY__FILE=/tmp/secret'
|
||||
assert_line '-GITEA__SEC_0X55_RITY__INTERNAL_TOKEN=override'
|
||||
assert_line '-GITEA__OAUTH2__JWT_0X5F_SECRET__FILE=/tmp/jwt'
|
||||
assert_line '-GITEA__SERVER__LFS_JWT_SECRET=override'
|
||||
assert_line '-GITEA___0x7365637572697479____0x5345435245545f4b4559_=encoded'
|
||||
refute_line '+GITEA___0X7365637572697479____0x5345435245545f4b4559_=encoded'
|
||||
refute_line '-GITEA__SECURITY__OTHER__FILE=/tmp/other'
|
||||
refute_line '-GITEA__SECURITY__secret_key=other-case'
|
||||
done
|
||||
}
|
||||
|
||||
@test "rebuilds an existing app.ini while preserving secret keys" {
|
||||
expect_gitea_config_edit_ini_call
|
||||
export GITEA_REBUILD_APP_INI=true
|
||||
touch "$GITEA_APP_INI"
|
||||
|
||||
run "$PROJECT_ROOT/scripts/init-containers/config/config_environment.sh"
|
||||
|
||||
assert_success
|
||||
assert_line '[security]'
|
||||
assert_line 'SECRET_KEY='
|
||||
assert_line 'INTERNAL_TOKEN='
|
||||
assert_line '[oauth2]'
|
||||
assert_line 'JWT_SECRET='
|
||||
assert_line '[server]'
|
||||
assert_line 'LFS_JWT_SECRET='
|
||||
assert_line 'Stubbed gitea config edit-ini rebuild was called!'
|
||||
}
|
||||
|
||||
@test "uses normal initialization when rebuild is enabled for a new app.ini" {
|
||||
expect_gitea_config_edit_ini_call
|
||||
export GITEA_REBUILD_APP_INI=true
|
||||
|
||||
run "$PROJECT_ROOT/scripts/init-containers/config/config_environment.sh"
|
||||
|
||||
assert_success
|
||||
assert_line 'Stubbed gitea config edit-ini was called!'
|
||||
}
|
||||
|
||||
@test "ensures that preset environment variables take precedence over auto-generated ones" {
|
||||
expect_gitea_config_edit_ini_call
|
||||
export GITEA__OAUTH2__JWT_SECRET="pre-defined-jwt-secret"
|
||||
@@ -125,6 +191,43 @@ function write_mounted_file() {
|
||||
refute_line '+GITEA__OAUTH2__JWT_SECRET=mocked-jwt-secret'
|
||||
}
|
||||
|
||||
@test "ensures that preset secrets with lowercase sections override generated secrets" {
|
||||
expect_gitea_config_edit_ini_call
|
||||
export GITEA__oauth2__JWT_SECRET="pre-defined-jwt-secret"
|
||||
|
||||
run execute_test_script
|
||||
|
||||
assert_success
|
||||
assert_line '+GITEA__OAUTH2__JWT_SECRET=pre-defined-jwt-secret'
|
||||
refute_line '+GITEA__OAUTH2__JWT_SECRET=mocked-jwt-secret'
|
||||
}
|
||||
|
||||
@test "preset encoded file variables override generated and mounted settings" {
|
||||
expect_gitea_config_edit_ini_call
|
||||
export GITEA___0x6f6175746832___JWT_0x5f_SECRET__FILE="/tmp/jwt"
|
||||
write_mounted_file "inlines" "oauth2" "JWT_SECRET=inline"
|
||||
write_mounted_file "additionals" "oauth2" "JWT_SECRET=additional"
|
||||
|
||||
run execute_test_script
|
||||
|
||||
assert_success
|
||||
refute_line '+GITEA__OAUTH2__JWT_SECRET=mocked-jwt-secret'
|
||||
refute_line '+GITEA__OAUTH2__JWT_SECRET=inline'
|
||||
refute_line '+GITEA__OAUTH2__JWT_SECRET=additional'
|
||||
assert_line '+GITEA___0X6F6175746832___JWT_0x5f_SECRET__FILE=/tmp/jwt'
|
||||
}
|
||||
|
||||
@test "rejects conflicting preset variables for the same setting" {
|
||||
expect_gitea_config_edit_ini_call
|
||||
export GITEA__OAUTH2__JWT_SECRET="first"
|
||||
export GITEA__oauth2__JWT_0X5F_SECRET__FILE="/tmp/jwt"
|
||||
|
||||
run "$PROJECT_ROOT/scripts/init-containers/config/config_environment.sh"
|
||||
|
||||
assert_failure
|
||||
assert_output --partial 'conflicting preset environment variables'
|
||||
}
|
||||
|
||||
@test "ensures that preset environment variables take precedence over mounted ones" {
|
||||
expect_gitea_config_edit_ini_call
|
||||
export GITEA__OAUTH2__JWT_SECRET="pre-defined-jwt-secret"
|
||||
@@ -172,22 +275,35 @@ EOF
|
||||
assert_line '+GITEA__REPOSITORY_0X2E_PULL_0X2D_REQUEST__WORK_IN_PROGRESS_PREFIXES=WIP:,[WIP]'
|
||||
}
|
||||
|
||||
###############################################################
|
||||
##### THIS IS A BUG, BUT I WANT IT TO BE COVERED BY TESTS #####
|
||||
###############################################################
|
||||
@test "ensures uppercase section and setting names (🐞)" {
|
||||
@test "preserves the case of setting names and masks dots and dashes" {
|
||||
expect_gitea_config_edit_ini_call
|
||||
export GITEA__oauth2__JwT_Secret="pre-defined-jwt-secret"
|
||||
write_mounted_file "inlines" "repository.pull-request" "$(cat << EOF
|
||||
WORK_IN_progress_PREFIXES=WIP:,[WIP]
|
||||
write_mounted_file "inlines" "log" "$(cat << EOF
|
||||
logger.router.MODE=console-warn
|
||||
Mixed-Case=value
|
||||
EOF
|
||||
)"
|
||||
|
||||
run execute_test_script
|
||||
|
||||
assert_success
|
||||
assert_line '+GITEA__REPOSITORY_0X2E_PULL_0X2D_REQUEST__WORK_IN_PROGRESS_PREFIXES=WIP:,[WIP]'
|
||||
assert_line '+GITEA__OAUTH2__JWT_SECRET=pre-defined-jwt-secret'
|
||||
assert_line '+GITEA__LOG__logger_0X2E_router_0X2E_MODE=console-warn'
|
||||
assert_line '+GITEA__LOG__Mixed_0X2D_Case=value'
|
||||
}
|
||||
|
||||
@test "preserves preset setting case and its precedence over mounted values" {
|
||||
expect_gitea_config_edit_ini_call
|
||||
export GITEA__log__MixedKey="preset"
|
||||
write_mounted_file "inlines" "log" "$(cat << EOF
|
||||
MixedKey=inline
|
||||
EOF
|
||||
)"
|
||||
|
||||
run execute_test_script
|
||||
|
||||
assert_success
|
||||
assert_line '-GITEA__log__MixedKey=preset'
|
||||
assert_line '+GITEA__LOG__MixedKey=preset'
|
||||
refute_line '+GITEA__LOG__MixedKey=inline'
|
||||
}
|
||||
|
||||
@test "treats top-level configuration as section-less" {
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
suite: Admin secret template
|
||||
suite: Test admin secret
|
||||
release:
|
||||
name: gitea-unittests
|
||||
namespace: testing
|
||||
templates:
|
||||
- templates/secret_admin.yaml
|
||||
tests:
|
||||
- it: skips rendering when the admin user is disabled
|
||||
- it: "Skip rendering when the admin user is disabled"
|
||||
set:
|
||||
secrets.admin.enabled: false
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 0
|
||||
|
||||
- it: skips rendering using an existing secret reference
|
||||
- it: "Skip rendering when an existing Secret is referenced"
|
||||
set:
|
||||
secrets.admin.enabled: true
|
||||
secrets.admin.existingSecret.enabled: true
|
||||
@@ -21,14 +21,14 @@ tests:
|
||||
- hasDocuments:
|
||||
count: 0
|
||||
|
||||
- it: fails rendering without credentials
|
||||
- it: "Fail when no credentials are configured"
|
||||
set:
|
||||
secrets.admin.new.password: ""
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: Either specify `secrets.admin.new.username` and `secrets.admin.new.password` or reference an existing Secret via `secrets.admin.existingSecret`
|
||||
|
||||
- it: renders the secret specification with the default credentials
|
||||
- it: "Render the Secret with the default credentials"
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 1
|
||||
@@ -49,7 +49,7 @@ tests:
|
||||
path: data.username
|
||||
value: "Z2l0ZWFfYWRtaW4="
|
||||
|
||||
- it: supports custom annotations and labels
|
||||
- it: "Render custom annotations and labels"
|
||||
set:
|
||||
secrets.admin.new.annotations:
|
||||
custom-annotation: annotation-value
|
||||
@@ -0,0 +1,182 @@
|
||||
suite: Test cluster basics
|
||||
release:
|
||||
name: gitea-unittests
|
||||
namespace: testing
|
||||
tests:
|
||||
- it: "Render nothing when cloudnativePG is disabled"
|
||||
templates:
|
||||
- templates/cluster.yaml
|
||||
- templates/secret_cloudnativePG.yaml
|
||||
set:
|
||||
cloudnativePG:
|
||||
enabled: false
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 0
|
||||
|
||||
- it: "Render the Cluster with the default values"
|
||||
template: templates/cluster.yaml
|
||||
set:
|
||||
cloudnativePG:
|
||||
enabled: true
|
||||
asserts:
|
||||
- containsDocument:
|
||||
kind: Cluster
|
||||
apiVersion: postgresql.cnpg.io/v1
|
||||
name: gitea-unittests-postgresql
|
||||
namespace: testing
|
||||
- equal:
|
||||
path: spec.instances
|
||||
value: 3
|
||||
- equal:
|
||||
path: spec.imageName
|
||||
value: "ghcr.io/cloudnative-pg/postgresql:18.0"
|
||||
- equal:
|
||||
path: spec.bootstrap.initdb
|
||||
value:
|
||||
database: "gitea"
|
||||
owner: "gitea"
|
||||
secret:
|
||||
name: gitea-unittests-postgresql-app
|
||||
- equal:
|
||||
path: spec.storage.size
|
||||
value: "10Gi"
|
||||
- notExists:
|
||||
path: spec.storage.storageClass
|
||||
- notExists:
|
||||
path: spec.walStorage
|
||||
- notExists:
|
||||
path: spec.affinity
|
||||
- notExists:
|
||||
path: spec.topologySpreadConstraints
|
||||
|
||||
- it: "Render the credential Secret with the default values"
|
||||
template: templates/secret_cloudnativePG.yaml
|
||||
set:
|
||||
cloudnativePG:
|
||||
enabled: true
|
||||
asserts:
|
||||
- containsDocument:
|
||||
kind: Secret
|
||||
apiVersion: v1
|
||||
name: gitea-unittests-postgresql-app
|
||||
namespace: testing
|
||||
- equal:
|
||||
path: type
|
||||
value: kubernetes.io/basic-auth
|
||||
- equal:
|
||||
path: data.password
|
||||
decodeBase64: true
|
||||
value: "gitea"
|
||||
- equal:
|
||||
path: data.username
|
||||
decodeBase64: true
|
||||
value: "gitea"
|
||||
- notExists:
|
||||
path: data.database
|
||||
- notExists:
|
||||
path: stringData
|
||||
|
||||
- it: "Render no credential Secret when an existing Secret is used"
|
||||
template: templates/secret_cloudnativePG.yaml
|
||||
set:
|
||||
cloudnativePG:
|
||||
enabled: true
|
||||
credentials:
|
||||
existingSecret:
|
||||
enabled: true
|
||||
secretName: my-credentials
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 0
|
||||
|
||||
- it: "Reference the existing Secret in the Cluster"
|
||||
template: templates/cluster.yaml
|
||||
set:
|
||||
cloudnativePG:
|
||||
enabled: true
|
||||
credentials:
|
||||
existingSecret:
|
||||
enabled: true
|
||||
secretName: my-credentials
|
||||
database: my-database
|
||||
username: my-username
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.bootstrap.initdb
|
||||
value:
|
||||
database: "my-database"
|
||||
owner: "my-username"
|
||||
secret:
|
||||
name: my-credentials
|
||||
|
||||
- it: "Apply the storage and walStorage customizations"
|
||||
template: templates/cluster.yaml
|
||||
set:
|
||||
cloudnativePG:
|
||||
enabled: true
|
||||
storage:
|
||||
size: 1337Mi
|
||||
storageClass: my-storage-class
|
||||
walStorage:
|
||||
enabled: true
|
||||
size: 42Mi
|
||||
storageClass: my-wal-storage-class
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.storage
|
||||
value:
|
||||
size: "1337Mi"
|
||||
storageClass: "my-storage-class"
|
||||
- equal:
|
||||
path: spec.walStorage
|
||||
value:
|
||||
size: "42Mi"
|
||||
storageClass: "my-wal-storage-class"
|
||||
|
||||
- it: "Apply the scheduling customizations"
|
||||
template: templates/cluster.yaml
|
||||
set:
|
||||
cloudnativePG:
|
||||
enabled: true
|
||||
affinity:
|
||||
nodeSelector:
|
||||
disktype: ssd
|
||||
podAntiAffinityType: required
|
||||
tolerations:
|
||||
- key: my-key
|
||||
operator: Equal
|
||||
value: my-value
|
||||
effect: NoSchedule
|
||||
priorityClassName: my-priority-class
|
||||
topologySpreadConstraints:
|
||||
- maxSkew: 1
|
||||
topologyKey: topology.kubernetes.io/zone
|
||||
whenUnsatisfiable: DoNotSchedule
|
||||
labelSelector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: gitea
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.affinity
|
||||
value:
|
||||
nodeSelector:
|
||||
disktype: ssd
|
||||
podAntiAffinityType: required
|
||||
tolerations:
|
||||
- key: my-key
|
||||
operator: Equal
|
||||
value: my-value
|
||||
effect: NoSchedule
|
||||
- equal:
|
||||
path: spec.priorityClassName
|
||||
value: my-priority-class
|
||||
- equal:
|
||||
path: spec.topologySpreadConstraints
|
||||
value:
|
||||
- maxSkew: 1
|
||||
topologyKey: topology.kubernetes.io/zone
|
||||
whenUnsatisfiable: DoNotSchedule
|
||||
labelSelector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: gitea
|
||||
@@ -1,24 +1,25 @@
|
||||
suite: config template | actions config
|
||||
suite: Test config actions
|
||||
release:
|
||||
name: gitea-unittests
|
||||
namespace: testing
|
||||
templates:
|
||||
- templates/secret_inlineConfig.yaml
|
||||
tests:
|
||||
- it: "actions are enabled by default (based on vanilla Gitea behavior)"
|
||||
- it: "Enable actions by default to match vanilla Gitea"
|
||||
template: templates/secret_inlineConfig.yaml
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
notExists:
|
||||
path: stringData.actions
|
||||
path: data.actions
|
||||
|
||||
- it: "actions can be disabled via inline config"
|
||||
- it: "Disable actions via the inline config"
|
||||
template: templates/secret_inlineConfig.yaml
|
||||
set:
|
||||
gitea.config.actions.ENABLED: false
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: stringData.actions
|
||||
path: data.actions
|
||||
decodeBase64: true
|
||||
value: |-
|
||||
ENABLED=false
|
||||
@@ -1,9 +1,9 @@
|
||||
suite: config template | cache config
|
||||
suite: Test config cache
|
||||
release:
|
||||
name: gitea-unittests
|
||||
namespace: testing
|
||||
tests:
|
||||
- it: "cache is configured correctly for valkey"
|
||||
- it: "Configure the cache for valkey"
|
||||
template: templates/secret_inlineConfig.yaml
|
||||
set:
|
||||
valkey:
|
||||
@@ -11,12 +11,13 @@ tests:
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: stringData.cache
|
||||
path: data.cache
|
||||
decodeBase64: true
|
||||
value: |-
|
||||
ADAPTER=redis
|
||||
HOST=redis://:changeme@gitea-unittests-valkey.testing.svc.cluster.local:6379/0?pool_size=100&idle_timeout=180s&
|
||||
|
||||
- it: "cache is configured correctly for 'memory' when valkey is disabled"
|
||||
- it: "Configure the cache for 'memory' when valkey is disabled"
|
||||
template: templates/secret_inlineConfig.yaml
|
||||
set:
|
||||
valkey:
|
||||
@@ -24,12 +25,13 @@ tests:
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: stringData.cache
|
||||
path: data.cache
|
||||
decodeBase64: true
|
||||
value: |-
|
||||
ADAPTER=memory
|
||||
HOST=
|
||||
|
||||
- it: "cache can be customized when valkey is disabled"
|
||||
- it: "Customize the cache when valkey is disabled"
|
||||
template: templates/secret_inlineConfig.yaml
|
||||
set:
|
||||
valkey:
|
||||
@@ -39,7 +41,8 @@ tests:
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: stringData.cache
|
||||
path: data.cache
|
||||
decodeBase64: true
|
||||
value: |-
|
||||
ADAPTER=custom-adapter
|
||||
HOST=custom-host
|
||||
@@ -1,15 +0,0 @@
|
||||
suite: config template | config_environment.sh
|
||||
release:
|
||||
name: gitea-unittests
|
||||
namespace: testing
|
||||
templates:
|
||||
- templates/secret_admin.yaml
|
||||
- templates/secret_config.yaml
|
||||
tests:
|
||||
- it: uses `gitea config edit-ini` to write app.ini from environment variables
|
||||
template: templates/secret_config.yaml
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
matchRegex:
|
||||
path: stringData["config_environment.sh"]
|
||||
pattern: 'gitea config edit-ini --apply-env --config .+GITEA_APP_INI.+ --out .+GITEA_APP_INI'
|
||||
@@ -0,0 +1,48 @@
|
||||
suite: Test config database
|
||||
release:
|
||||
name: gitea-unittests
|
||||
namespace: testing
|
||||
tests:
|
||||
- it: "Connect to the read-write Service of the CloudNativePG Cluster"
|
||||
template: templates/secret_inlineConfig.yaml
|
||||
set:
|
||||
cloudnativePG:
|
||||
enabled: true
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
matchRegex:
|
||||
path: data.database
|
||||
decodeBase64: true
|
||||
pattern: HOST=gitea-unittests-postgresql-rw.testing.svc.cluster.local:5432
|
||||
|
||||
- it: "Connect to the read-write Service of the CloudNativePG Cluster with a custom cluster domain"
|
||||
template: templates/secret_inlineConfig.yaml
|
||||
set:
|
||||
clusterDomain: my-special-cluster.local
|
||||
cloudnativePG:
|
||||
enabled: true
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
matchRegex:
|
||||
path: data.database
|
||||
decodeBase64: true
|
||||
pattern: HOST=gitea-unittests-postgresql-rw.testing.svc.my-special-cluster.local:5432
|
||||
|
||||
- it: "Connect to the configured CloudNativePG database"
|
||||
template: templates/secret_inlineConfig.yaml
|
||||
set:
|
||||
cloudnativePG:
|
||||
enabled: true
|
||||
credentials:
|
||||
database: gitea-database
|
||||
username: gitea-username
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: data.database
|
||||
decodeBase64: true
|
||||
value: |-
|
||||
DB_TYPE=postgres
|
||||
HOST=gitea-unittests-postgresql-rw.testing.svc.cluster.local:5432
|
||||
NAME=gitea-database
|
||||
USER=gitea-username
|
||||
@@ -0,0 +1,25 @@
|
||||
suite: Test config environment script
|
||||
release:
|
||||
name: gitea-unittests
|
||||
namespace: testing
|
||||
templates:
|
||||
- templates/secret_admin.yaml
|
||||
- templates/secret_config.yaml
|
||||
tests:
|
||||
- it: "Write app.ini from the environment variables via `gitea config edit-ini`"
|
||||
template: templates/secret_config.yaml
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
matchRegex:
|
||||
path: data["config_environment.sh"]
|
||||
decodeBase64: true
|
||||
pattern: 'gitea config edit-ini --apply-env --config .+GITEA_APP_INI.+ --out .+GITEA_APP_INI'
|
||||
- it: "Render data instead of stringData so removed keys are pruned on upgrade"
|
||||
template: templates/secret_config.yaml
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
notExists:
|
||||
path: stringData
|
||||
- documentIndex: 0
|
||||
exists:
|
||||
path: data["config_environment.sh"]
|
||||
+16
-5
@@ -1,11 +1,11 @@
|
||||
suite: config template
|
||||
suite: Test config inlineConfig
|
||||
release:
|
||||
name: gitea-unittests
|
||||
namespace: testing
|
||||
templates:
|
||||
- templates/secret_inlineConfig.yaml
|
||||
tests:
|
||||
- it: inline config stringData.server using TPL
|
||||
- it: "Render the inline config of data.server via tpl"
|
||||
set:
|
||||
global.giteaHostName: "gitea.example.com"
|
||||
ingress.enabled: true
|
||||
@@ -21,13 +21,24 @@ tests:
|
||||
pattern: .*-inline-config$
|
||||
- documentIndex: 0
|
||||
matchRegex:
|
||||
path: stringData.server
|
||||
path: data.server
|
||||
decodeBase64: true
|
||||
pattern: DOMAIN=gitea\.example\.com
|
||||
- documentIndex: 0
|
||||
matchRegex:
|
||||
path: stringData.server
|
||||
path: data.server
|
||||
decodeBase64: true
|
||||
pattern: ROOT_URL=https://gitea\.example\.com
|
||||
- documentIndex: 0
|
||||
matchRegex:
|
||||
path: stringData.server
|
||||
path: data.server
|
||||
decodeBase64: true
|
||||
pattern: SSH_DOMAIN=gitea\.example\.com
|
||||
- it: "Render data instead of stringData so removed sections are pruned on upgrade"
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
notExists:
|
||||
path: stringData
|
||||
- documentIndex: 0
|
||||
exists:
|
||||
path: data.server
|
||||
+13
-9
@@ -1,9 +1,9 @@
|
||||
suite: config template | metrics section (metrics token)
|
||||
suite: Test config metrics token
|
||||
release:
|
||||
name: gitea-unittests
|
||||
namespace: testing
|
||||
tests:
|
||||
- it: metrics token is set
|
||||
- it: "Configure the metrics token when it is set"
|
||||
template: templates/secret_inlineConfig.yaml
|
||||
set:
|
||||
gitea:
|
||||
@@ -13,11 +13,12 @@ tests:
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: stringData.metrics
|
||||
path: data.metrics
|
||||
decodeBase64: true
|
||||
value: |-
|
||||
ENABLED=true
|
||||
TOKEN=somepassword
|
||||
- it: metrics token is empty
|
||||
- it: "Omit the metrics token when it is empty"
|
||||
template: templates/secret_inlineConfig.yaml
|
||||
set:
|
||||
gitea:
|
||||
@@ -27,10 +28,11 @@ tests:
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: stringData.metrics
|
||||
path: data.metrics
|
||||
decodeBase64: true
|
||||
value: |-
|
||||
ENABLED=true
|
||||
- it: metrics token is nil
|
||||
- it: "Omit the metrics token when it is nil"
|
||||
template: templates/secret_inlineConfig.yaml
|
||||
set:
|
||||
gitea:
|
||||
@@ -40,10 +42,11 @@ tests:
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: stringData.metrics
|
||||
path: data.metrics
|
||||
decodeBase64: true
|
||||
value: |-
|
||||
ENABLED=true
|
||||
- it: does not configures a token if metrics are disabled
|
||||
- it: "Omit the metrics token when metrics are disabled"
|
||||
template: templates/secret_inlineConfig.yaml
|
||||
set:
|
||||
gitea:
|
||||
@@ -53,6 +56,7 @@ tests:
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: stringData.metrics
|
||||
path: data.metrics
|
||||
decodeBase64: true
|
||||
value: |-
|
||||
ENABLED=false
|
||||
@@ -1,9 +1,9 @@
|
||||
suite: config template | queue config
|
||||
suite: Test config queue
|
||||
release:
|
||||
name: gitea-unittests
|
||||
namespace: testing
|
||||
tests:
|
||||
- it: "queue is configured correctly for valkey"
|
||||
- it: "Configure the queue for valkey"
|
||||
template: templates/secret_inlineConfig.yaml
|
||||
set:
|
||||
valkey:
|
||||
@@ -11,12 +11,13 @@ tests:
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: stringData.queue
|
||||
path: data.queue
|
||||
decodeBase64: true
|
||||
value: |-
|
||||
CONN_STR=redis://:changeme@gitea-unittests-valkey.testing.svc.cluster.local:6379/0?pool_size=100&idle_timeout=180s&
|
||||
TYPE=redis
|
||||
|
||||
- it: "queue is configured correctly for 'levelDB' when valkey is disabled"
|
||||
- it: "Configure the queue for 'levelDB' when valkey is disabled"
|
||||
template: templates/secret_inlineConfig.yaml
|
||||
set:
|
||||
valkey:
|
||||
@@ -24,12 +25,13 @@ tests:
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: stringData.queue
|
||||
path: data.queue
|
||||
decodeBase64: true
|
||||
value: |-
|
||||
CONN_STR=
|
||||
TYPE=level
|
||||
|
||||
- it: "queue can be customized when valkey is disabled"
|
||||
- it: "Customize the queue when valkey is disabled"
|
||||
template: templates/secret_inlineConfig.yaml
|
||||
set:
|
||||
valkey:
|
||||
@@ -39,7 +41,8 @@ tests:
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: stringData.queue
|
||||
path: data.queue
|
||||
decodeBase64: true
|
||||
value: |-
|
||||
CONN_STR=custom-connection-string
|
||||
TYPE=custom-type
|
||||
+42
-25
@@ -1,27 +1,30 @@
|
||||
suite: config template | server section (domain related)
|
||||
suite: Test config server domain
|
||||
release:
|
||||
name: gitea-unittests
|
||||
namespace: testing
|
||||
tests:
|
||||
- it: "[default values] uses ingress host for DOMAIN|SSH_DOMAIN|ROOT_URL"
|
||||
- it: "[default values] Use the ingress host for DOMAIN|SSH_DOMAIN|ROOT_URL"
|
||||
template: templates/secret_inlineConfig.yaml
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
matchRegex:
|
||||
path: stringData.server
|
||||
path: data.server
|
||||
decodeBase64: true
|
||||
pattern: \nDOMAIN=git.example.com
|
||||
- documentIndex: 0
|
||||
matchRegex:
|
||||
path: stringData.server
|
||||
path: data.server
|
||||
decodeBase64: true
|
||||
pattern: \nSSH_DOMAIN=git.example.com
|
||||
- documentIndex: 0
|
||||
matchRegex:
|
||||
path: stringData.server
|
||||
path: data.server
|
||||
decodeBase64: true
|
||||
pattern: \nROOT_URL=http://git.example.com
|
||||
|
||||
################################################
|
||||
|
||||
- it: "[no ingress hosts] uses gitea http service for DOMAIN|SSH_DOMAIN|ROOT_URL"
|
||||
- it: "[no ingress hosts] Use the HTTP Service for DOMAIN|SSH_DOMAIN|ROOT_URL"
|
||||
template: templates/secret_inlineConfig.yaml
|
||||
set:
|
||||
ingress:
|
||||
@@ -29,20 +32,23 @@ tests:
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
matchRegex:
|
||||
path: stringData.server
|
||||
path: data.server
|
||||
decodeBase64: true
|
||||
pattern: \nDOMAIN=gitea-unittests-http.testing.svc.cluster.local
|
||||
- documentIndex: 0
|
||||
matchRegex:
|
||||
path: stringData.server
|
||||
path: data.server
|
||||
decodeBase64: true
|
||||
pattern: \nSSH_DOMAIN=gitea-unittests-http.testing.svc.cluster.local
|
||||
- documentIndex: 0
|
||||
matchRegex:
|
||||
path: stringData.server
|
||||
path: data.server
|
||||
decodeBase64: true
|
||||
pattern: \nROOT_URL=http://gitea-unittests-http.testing.svc.cluster.local
|
||||
|
||||
################################################
|
||||
|
||||
- it: "[provided via values] uses that for DOMAIN|SSH_DOMAIN|ROOT_URL"
|
||||
- it: "[provided via values] Use the configured values for DOMAIN|SSH_DOMAIN|ROOT_URL"
|
||||
template: templates/secret_inlineConfig.yaml
|
||||
set:
|
||||
gitea.config.server.DOMAIN: provided.example.com
|
||||
@@ -55,20 +61,23 @@ tests:
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
matchRegex:
|
||||
path: stringData.server
|
||||
path: data.server
|
||||
decodeBase64: true
|
||||
pattern: \nDOMAIN=provided.example.com
|
||||
- documentIndex: 0
|
||||
matchRegex:
|
||||
path: stringData.server
|
||||
path: data.server
|
||||
decodeBase64: true
|
||||
pattern: \nSSH_DOMAIN=provided.example.com
|
||||
- documentIndex: 0
|
||||
matchRegex:
|
||||
path: stringData.server
|
||||
path: data.server
|
||||
decodeBase64: true
|
||||
pattern: \nROOT_URL=http://provided.example.com
|
||||
|
||||
################################################
|
||||
|
||||
- it: "[route enabled] uses route host for DOMAIN|SSH_DOMAIN|ROOT_URL"
|
||||
- it: "[route enabled] Use the Route host for DOMAIN|SSH_DOMAIN|ROOT_URL"
|
||||
template: templates/secret_inlineConfig.yaml
|
||||
set:
|
||||
route:
|
||||
@@ -77,20 +86,23 @@ tests:
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
matchRegex:
|
||||
path: stringData.server
|
||||
path: data.server
|
||||
decodeBase64: true
|
||||
pattern: \nDOMAIN=route.example.com
|
||||
- documentIndex: 0
|
||||
matchRegex:
|
||||
path: stringData.server
|
||||
path: data.server
|
||||
decodeBase64: true
|
||||
pattern: \nSSH_DOMAIN=route.example.com
|
||||
- documentIndex: 0
|
||||
matchRegex:
|
||||
path: stringData.server
|
||||
path: data.server
|
||||
decodeBase64: true
|
||||
pattern: \nROOT_URL=http://route.example.com
|
||||
|
||||
################################################
|
||||
|
||||
- it: "[route tls termination] uses https for ROOT_URL"
|
||||
- it: "[route tls termination] Use https for ROOT_URL"
|
||||
template: templates/secret_inlineConfig.yaml
|
||||
set:
|
||||
route:
|
||||
@@ -101,12 +113,13 @@ tests:
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
matchRegex:
|
||||
path: stringData.server
|
||||
path: data.server
|
||||
decodeBase64: true
|
||||
pattern: \nROOT_URL=https://route.example.com
|
||||
|
||||
################################################
|
||||
|
||||
- it: "[HTTPRoute enabled] uses first hostname for DOMAIN|SSH_DOMAIN|ROOT_URL"
|
||||
- it: "[HTTPRoute enabled] Use the first hostname for DOMAIN|SSH_DOMAIN|ROOT_URL"
|
||||
template: templates/secret_inlineConfig.yaml
|
||||
set:
|
||||
ingress:
|
||||
@@ -123,20 +136,23 @@ tests:
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
matchRegex:
|
||||
path: stringData.server
|
||||
path: data.server
|
||||
decodeBase64: true
|
||||
pattern: \nDOMAIN=gw.example.com
|
||||
- documentIndex: 0
|
||||
matchRegex:
|
||||
path: stringData.server
|
||||
path: data.server
|
||||
decodeBase64: true
|
||||
pattern: \nSSH_DOMAIN=gw.example.com
|
||||
- documentIndex: 0
|
||||
matchRegex:
|
||||
path: stringData.server
|
||||
path: data.server
|
||||
decodeBase64: true
|
||||
pattern: \nROOT_URL=http://gw.example.com
|
||||
|
||||
################################################
|
||||
|
||||
- it: "[HTTPRoute tls] switches ROOT_URL to https"
|
||||
- it: "[HTTPRoute tls] Switch ROOT_URL to https"
|
||||
template: templates/secret_inlineConfig.yaml
|
||||
set:
|
||||
ingress:
|
||||
@@ -154,5 +170,6 @@ tests:
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
matchRegex:
|
||||
path: stringData.server
|
||||
path: data.server
|
||||
decodeBase64: true
|
||||
pattern: \nROOT_URL=https://gw.example.com
|
||||
@@ -1,9 +1,9 @@
|
||||
suite: config template | session config
|
||||
suite: Test config session
|
||||
release:
|
||||
name: gitea-unittests
|
||||
namespace: testing
|
||||
tests:
|
||||
- it: "session is configured correctly for valkey"
|
||||
- it: "Configure the session for valkey"
|
||||
template: templates/secret_inlineConfig.yaml
|
||||
set:
|
||||
valkey:
|
||||
@@ -11,12 +11,13 @@ tests:
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: stringData.session
|
||||
path: data.session
|
||||
decodeBase64: true
|
||||
value: |-
|
||||
PROVIDER=redis
|
||||
PROVIDER_CONFIG=redis://:changeme@gitea-unittests-valkey.testing.svc.cluster.local:6379/0?pool_size=100&idle_timeout=180s&
|
||||
|
||||
- it: "session is configured correctly for 'memory' when valkey is disabled"
|
||||
- it: "Configure the session for 'memory' when valkey is disabled"
|
||||
template: templates/secret_inlineConfig.yaml
|
||||
set:
|
||||
valkey:
|
||||
@@ -24,12 +25,13 @@ tests:
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: stringData.session
|
||||
path: data.session
|
||||
decodeBase64: true
|
||||
value: |-
|
||||
PROVIDER=memory
|
||||
PROVIDER_CONFIG=
|
||||
|
||||
- it: "session can be customized when valkey is disabled"
|
||||
- it: "Customize the session when valkey is disabled"
|
||||
template: templates/secret_inlineConfig.yaml
|
||||
set:
|
||||
valkey:
|
||||
@@ -39,7 +41,8 @@ tests:
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: stringData.session
|
||||
path: data.session
|
||||
decodeBase64: true
|
||||
value: |-
|
||||
PROVIDER=custom-provider
|
||||
PROVIDER_CONFIG=custom-provider-config
|
||||
@@ -1,138 +0,0 @@
|
||||
suite: Dependency checks | Customization integrity | postgresql-ha
|
||||
release:
|
||||
name: gitea-unittests
|
||||
namespace: testing
|
||||
set:
|
||||
postgresql:
|
||||
enabled: false
|
||||
postgresql-ha:
|
||||
enabled: true
|
||||
global:
|
||||
postgresql:
|
||||
database: gitea-database
|
||||
password: gitea-password
|
||||
username: gitea-username
|
||||
postgresql:
|
||||
repmgrPassword: custom-password-repmgr
|
||||
postgresPassword: custom-password-postgres
|
||||
password: custom-password-overwritten-by-global-postgresql-password
|
||||
pgpool:
|
||||
adminPassword: custom-password-pgpool
|
||||
srCheckPassword: custom-password-sr-check
|
||||
service:
|
||||
ports:
|
||||
postgresql: 1234
|
||||
persistence:
|
||||
size: 1337Mi
|
||||
tests:
|
||||
- it: "[postgresql-ha] DB settings are applied as expected"
|
||||
template: charts/postgresql-ha/templates/postgresql/statefulset.yaml
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
contains:
|
||||
path: spec.template.spec.containers[0].env
|
||||
content:
|
||||
name: POSTGRES_DB
|
||||
value: "gitea-database"
|
||||
- documentIndex: 0
|
||||
contains:
|
||||
path: spec.template.spec.containers[0].env
|
||||
content:
|
||||
name: POSTGRES_USER
|
||||
value: "gitea-username"
|
||||
- it: "[postgresql-ha] DB passwords are applied as expected"
|
||||
template: charts/postgresql-ha/templates/postgresql/secrets.yaml
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: data["repmgr-password"]
|
||||
value: "Y3VzdG9tLXBhc3N3b3JkLXJlcG1ncg=="
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: data["postgres-password"]
|
||||
value: "Y3VzdG9tLXBhc3N3b3JkLXBvc3RncmVz"
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: data["password"]
|
||||
value: "Z2l0ZWEtcGFzc3dvcmQ=" # postgresql-ha.postgresql.password is overwritten by postgresql-ha.global.postgresql.password and should not be referenced here
|
||||
- it: "[postgresql-ha] pgpool.adminPassword is applied as expected"
|
||||
template: charts/postgresql-ha/templates/pgpool/secrets.yaml
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: data["admin-password"]
|
||||
value: "Y3VzdG9tLXBhc3N3b3JkLXBncG9vbA=="
|
||||
- it: "[postgresql-ha] pgpool.adminPassword is applied as expected"
|
||||
template: charts/postgresql-ha/templates/pgpool/secrets.yaml
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: data["admin-password"]
|
||||
value: "Y3VzdG9tLXBhc3N3b3JkLXBncG9vbA=="
|
||||
- it: "[postgresql-ha] pgpool.adminPassword is applied as expected"
|
||||
template: charts/postgresql-ha/templates/pgpool/secrets.yaml
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: data["admin-password"]
|
||||
value: "Y3VzdG9tLXBhc3N3b3JkLXBncG9vbA=="
|
||||
- it: "[postgresql-ha] pgpool.srCheckPassword is applied as expected"
|
||||
template: charts/postgresql-ha/templates/pgpool/secrets.yaml
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: data["sr-check-password"]
|
||||
value: "Y3VzdG9tLXBhc3N3b3JkLXNyLWNoZWNr"
|
||||
- it: "[postgresql-ha] persistence.size is applied as expected"
|
||||
template: charts/postgresql-ha/templates/postgresql/statefulset.yaml
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: spec.volumeClaimTemplates[0].spec.resources.requests.storage
|
||||
value: "1337Mi"
|
||||
- it: "[postgresql-ha] service.ports.postgresql is applied as expected"
|
||||
template: charts/postgresql-ha/templates/pgpool/service.yaml
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: spec.ports[0].port
|
||||
value: 1234
|
||||
- it: "[postgresql-ha] renders the referenced service"
|
||||
template: charts/postgresql-ha/templates/pgpool/service.yaml
|
||||
asserts:
|
||||
- containsDocument:
|
||||
kind: Service
|
||||
apiVersion: v1
|
||||
name: gitea-unittests-postgresql-ha-pgpool
|
||||
namespace: testing
|
||||
- it: "[gitea] connects to pgpool service"
|
||||
template: templates/secret_inlineConfig.yaml
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
matchRegex:
|
||||
path: stringData.database
|
||||
pattern: HOST=gitea-unittests-postgresql-ha-pgpool.testing.svc.cluster.local:1234
|
||||
- it: "[gitea] connects to pgpool service with custom cluster domain"
|
||||
set:
|
||||
clusterDomain: my-special-cluster.local
|
||||
template: templates/secret_inlineConfig.yaml
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
matchRegex:
|
||||
path: stringData.database
|
||||
pattern: HOST=gitea-unittests-postgresql-ha-pgpool.testing.svc.my-special-cluster.local:1234
|
||||
- it: "[gitea] connects to configured database"
|
||||
template: templates/secret_inlineConfig.yaml
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
matchRegex:
|
||||
path: stringData.database
|
||||
pattern: NAME=gitea-database
|
||||
- documentIndex: 0
|
||||
matchRegex:
|
||||
path: stringData.database
|
||||
pattern: USER=gitea-username
|
||||
- documentIndex: 0
|
||||
matchRegex:
|
||||
path: stringData.database
|
||||
pattern: PASSWD=gitea-password
|
||||
@@ -1,97 +0,0 @@
|
||||
suite: Dependency checks | Customization integrity | postgresql
|
||||
release:
|
||||
name: gitea-unittests
|
||||
namespace: testing
|
||||
set:
|
||||
postgresql-ha:
|
||||
enabled: false
|
||||
postgresql:
|
||||
enabled: true
|
||||
global:
|
||||
postgresql:
|
||||
auth:
|
||||
password: gitea-password
|
||||
database: gitea-database
|
||||
username: gitea-username
|
||||
service:
|
||||
ports:
|
||||
postgresql: 1234
|
||||
primary:
|
||||
persistence:
|
||||
size: 1337Mi
|
||||
tests:
|
||||
- it: "[postgresql] DB settings are applied as expected"
|
||||
template: charts/postgresql/templates/primary/statefulset.yaml
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
contains:
|
||||
path: spec.template.spec.containers[0].env
|
||||
content:
|
||||
name: POSTGRES_DATABASE
|
||||
value: "gitea-database"
|
||||
- documentIndex: 0
|
||||
contains:
|
||||
path: spec.template.spec.containers[0].env
|
||||
content:
|
||||
name: POSTGRES_USER
|
||||
value: "gitea-username"
|
||||
- it: "[postgresql] DB password is applied as expected"
|
||||
template: charts/postgresql/templates/secrets.yaml
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: data["password"]
|
||||
value: "Z2l0ZWEtcGFzc3dvcmQ="
|
||||
- it: "[postgresql] primary.persistence.size is applied as expected"
|
||||
template: charts/postgresql/templates/primary/statefulset.yaml
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: spec.volumeClaimTemplates[0].spec.resources.requests.storage
|
||||
value: "1337Mi"
|
||||
- it: "[postgresql] global.postgresql.service.ports.postgresql is applied as expected"
|
||||
template: charts/postgresql/templates/primary/svc.yaml
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: spec.ports[0].port
|
||||
value: 1234
|
||||
- it: "[postgresql] renders the referenced service"
|
||||
template: charts/postgresql/templates/primary/svc.yaml
|
||||
asserts:
|
||||
- containsDocument:
|
||||
kind: Service
|
||||
apiVersion: v1
|
||||
name: gitea-unittests-postgresql
|
||||
namespace: testing
|
||||
- it: "[gitea] connects to postgresql service"
|
||||
template: templates/secret_inlineConfig.yaml
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
matchRegex:
|
||||
path: stringData.database
|
||||
pattern: HOST=gitea-unittests-postgresql.testing.svc.cluster.local:1234
|
||||
- it: "[gitea] connects to postgresql service with custom cluster domain"
|
||||
set:
|
||||
clusterDomain: my-special-cluster.local
|
||||
template: templates/secret_inlineConfig.yaml
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
matchRegex:
|
||||
path: stringData.database
|
||||
pattern: HOST=gitea-unittests-postgresql.testing.svc.my-special-cluster.local:1234
|
||||
- it: "[gitea] connects to configured database"
|
||||
template: templates/secret_inlineConfig.yaml
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
matchRegex:
|
||||
path: stringData.database
|
||||
pattern: NAME=gitea-database
|
||||
- documentIndex: 0
|
||||
matchRegex:
|
||||
path: stringData.database
|
||||
pattern: USER=gitea-username
|
||||
- documentIndex: 0
|
||||
matchRegex:
|
||||
path: stringData.database
|
||||
pattern: PASSWD=gitea-password
|
||||
+9
-7
@@ -1,4 +1,4 @@
|
||||
suite: Dependency checks | Customization integrity | valkey
|
||||
suite: Test dependency customization integrity of valkey
|
||||
release:
|
||||
name: gitea-unittests
|
||||
namespace: testing
|
||||
@@ -12,14 +12,14 @@ set:
|
||||
permissions: "~* &* +@all"
|
||||
password: gitea-password
|
||||
tests:
|
||||
- it: "[valkey] valkey.auth.aclUsers.default.password is applied as expected"
|
||||
- it: "[valkey] Apply valkey.auth.aclUsers.default.password"
|
||||
template: charts/valkey/templates/secret.yaml
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: data.default-password
|
||||
value: "Z2l0ZWEtcGFzc3dvcmQ="
|
||||
- it: "[valkey] renders the referenced service"
|
||||
- it: "[valkey] Render the referenced Service"
|
||||
template: charts/valkey/templates/service.yaml
|
||||
asserts:
|
||||
- containsDocument:
|
||||
@@ -34,19 +34,21 @@ tests:
|
||||
port: 6379
|
||||
targetPort: tcp
|
||||
protocol: TCP
|
||||
- it: "[gitea] waits for valkey to be up and running"
|
||||
- it: "[gitea] Wait for valkey to be up and running"
|
||||
template: templates/secret_init.yaml
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
matchRegex:
|
||||
path: stringData["configure_gitea.sh"]
|
||||
path: data["configure_gitea.sh"]
|
||||
decodeBase64: true
|
||||
pattern: nc -vz -w2 gitea-unittests-valkey.testing.svc.cluster.local 6379
|
||||
- it: "[gitea] waits for valkey to be up and running with custom cluster domain"
|
||||
- it: "[gitea] Wait for valkey to be up and running with a custom cluster domain"
|
||||
set:
|
||||
clusterDomain: my-special-cluster.local
|
||||
template: templates/secret_init.yaml
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
matchRegex:
|
||||
path: stringData["configure_gitea.sh"]
|
||||
path: data["configure_gitea.sh"]
|
||||
decodeBase64: true
|
||||
pattern: nc -vz -w2 gitea-unittests-valkey.testing.svc.my-special-cluster.local 6379
|
||||
@@ -1,42 +0,0 @@
|
||||
suite: Dependency checks | Major image bumps
|
||||
release:
|
||||
name: gitea-unittests
|
||||
namespace: testing
|
||||
tests:
|
||||
- it: "[postgresql-ha] ensures we detect major image version upgrades"
|
||||
template: charts/postgresql-ha/templates/postgresql/statefulset.yaml
|
||||
set:
|
||||
postgresql:
|
||||
enabled: false
|
||||
postgresql-ha:
|
||||
enabled: true
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
matchRegex:
|
||||
path: spec.template.spec.containers[0].image
|
||||
# IN CASE OF AN INTENTIONAL MAJOR BUMP, ADJUST THIS TEST
|
||||
pattern: bitnamilegacy/postgresql-repmgr:17.+$
|
||||
- it: "[postgresql] ensures we detect major image version upgrades"
|
||||
template: charts/postgresql/templates/primary/statefulset.yaml
|
||||
set:
|
||||
postgresql:
|
||||
enabled: true
|
||||
postgresql-ha:
|
||||
enabled: false
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
matchRegex:
|
||||
path: spec.template.spec.containers[0].image
|
||||
# IN CASE OF AN INTENTIONAL MAJOR BUMP, ADJUST THIS TEST
|
||||
pattern: bitnamilegacy/postgresql:17.+$
|
||||
- it: "[valkey] ensures we detect major image version upgrades"
|
||||
template: charts/valkey/templates/deploy_valkey.yaml
|
||||
set:
|
||||
valkey:
|
||||
enabled: true
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
matchRegex:
|
||||
path: spec.template.spec.containers[0].image
|
||||
# IN CASE OF AN INTENTIONAL MAJOR BUMP, ADJUST THIS TEST
|
||||
pattern: valkey/valkey:9.+$
|
||||
@@ -0,0 +1,16 @@
|
||||
suite: Test dependency major image bumps
|
||||
release:
|
||||
name: gitea-unittests
|
||||
namespace: testing
|
||||
tests:
|
||||
- it: "[valkey] Detect major image version upgrades"
|
||||
template: charts/valkey/templates/deploy_valkey.yaml
|
||||
set:
|
||||
valkey:
|
||||
enabled: true
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
matchRegex:
|
||||
path: spec.template.spec.containers[0].image
|
||||
# IN CASE OF AN INTENTIONAL MAJOR BUMP, ADJUST THIS TEST
|
||||
pattern: valkey/valkey:9.+$
|
||||
+111
-103
@@ -1,4 +1,4 @@
|
||||
suite: deployment template
|
||||
suite: Test deployment additional config
|
||||
release:
|
||||
name: gitea-unittests
|
||||
namespace: testing
|
||||
@@ -11,7 +11,7 @@ templates:
|
||||
- templates/secret_inlineConfig.yaml
|
||||
- templates/secret_metrics.yaml
|
||||
tests:
|
||||
- it: Renders a deployment
|
||||
- it: "Render a Deployment with additionalConfigFromEnvs"
|
||||
template: templates/deployment.yaml
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
@@ -20,110 +20,10 @@ tests:
|
||||
kind: Deployment
|
||||
apiVersion: apps/v1
|
||||
name: gitea-unittests
|
||||
- it: Deployment with empty additionalConfigFromEnvs
|
||||
- it: "Render the Deployment with empty additionalConfigFromEnvs"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
gitea.additionalConfigFromEnvs: []
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 1
|
||||
- exists:
|
||||
path: spec.template.spec.initContainers[1].env
|
||||
- lengthEqual:
|
||||
path: spec.template.spec.initContainers[1].env
|
||||
count: 6
|
||||
- isSubset:
|
||||
path: spec.template.spec.initContainers[1]
|
||||
content:
|
||||
env:
|
||||
- name: GITEA_APP_INI
|
||||
value: /data/gitea/conf/app.ini
|
||||
- name: GITEA_CUSTOM
|
||||
value: /data/gitea
|
||||
- name: GITEA_WORK_DIR
|
||||
value: /data
|
||||
- name: GITEA_TEMP
|
||||
value: /tmp/gitea
|
||||
- name: TMP_EXISTING_ENVS_FILE
|
||||
value: /tmp/existing-envs
|
||||
- name: ENV_TO_INI_MOUNT_POINT
|
||||
value: /env-to-ini-mounts
|
||||
- it: Deployment with standard additionalConfigFromEnvs
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
gitea.additionalConfigFromEnvs: [{name: GITEA_database_HOST, value: my-db:123}, {name: GITEA_database_USER, value: my-user}]
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 1
|
||||
- exists:
|
||||
path: spec.template.spec.initContainers[1].env
|
||||
- lengthEqual:
|
||||
path: spec.template.spec.initContainers[1].env
|
||||
count: 8
|
||||
- isSubset:
|
||||
path: spec.template.spec.initContainers[1]
|
||||
content:
|
||||
env:
|
||||
- name: GITEA_APP_INI
|
||||
value: /data/gitea/conf/app.ini
|
||||
- name: GITEA_CUSTOM
|
||||
value: /data/gitea
|
||||
- name: GITEA_WORK_DIR
|
||||
value: /data
|
||||
- name: GITEA_TEMP
|
||||
value: /tmp/gitea
|
||||
- name: TMP_EXISTING_ENVS_FILE
|
||||
value: /tmp/existing-envs
|
||||
- name: ENV_TO_INI_MOUNT_POINT
|
||||
value: /env-to-ini-mounts
|
||||
- name: GITEA_database_HOST
|
||||
value: my-db:123
|
||||
- name: GITEA_database_USER
|
||||
value: my-user
|
||||
- it: Deployment with templated additionalConfigFromEnvs
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
gitea.misc.host: my-db-host:321
|
||||
gitea.misc.user: my-db-user
|
||||
gitea.additionalConfigFromEnvs: [{name: GITEA_database_HOST, value: "{{ .Values.gitea.misc.host }}"}, {name: GITEA_database_USER, value: "{{ .Values.gitea.misc.user }}"}]
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 1
|
||||
- exists:
|
||||
path: spec.template.spec.initContainers[1].env
|
||||
- lengthEqual:
|
||||
path: spec.template.spec.initContainers[1].env
|
||||
count: 8
|
||||
- isSubset:
|
||||
path: spec.template.spec.initContainers[1]
|
||||
content:
|
||||
env:
|
||||
- name: GITEA_APP_INI
|
||||
value: /data/gitea/conf/app.ini
|
||||
- name: GITEA_CUSTOM
|
||||
value: /data/gitea
|
||||
- name: GITEA_WORK_DIR
|
||||
value: /data
|
||||
- name: GITEA_TEMP
|
||||
value: /tmp/gitea
|
||||
- name: TMP_EXISTING_ENVS_FILE
|
||||
value: /tmp/existing-envs
|
||||
- name: ENV_TO_INI_MOUNT_POINT
|
||||
value: /env-to-ini-mounts
|
||||
- name: GITEA_database_HOST
|
||||
value: my-db-host:321
|
||||
- name: GITEA_database_USER
|
||||
value: my-db-user
|
||||
- it: Deployment with additionalConfigFromEnvs templated secret name
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
gitea.misc.existingSecret: my-db-secret
|
||||
gitea.additionalConfigFromEnvs[0]:
|
||||
name: GITEA_database_HOST
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: "{{ .Values.gitea.misc.existingSecret }}"
|
||||
key: password
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 1
|
||||
@@ -148,6 +48,114 @@ tests:
|
||||
value: /tmp/existing-envs
|
||||
- name: ENV_TO_INI_MOUNT_POINT
|
||||
value: /env-to-ini-mounts
|
||||
- name: GITEA_REBUILD_APP_INI
|
||||
value: "false"
|
||||
- it: "Render the Deployment with standard additionalConfigFromEnvs"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
gitea.additionalConfigFromEnvs: [{name: GITEA_database_HOST, value: my-db:123}, {name: GITEA_database_USER, value: my-user}]
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 1
|
||||
- exists:
|
||||
path: spec.template.spec.initContainers[1].env
|
||||
- lengthEqual:
|
||||
path: spec.template.spec.initContainers[1].env
|
||||
count: 9
|
||||
- isSubset:
|
||||
path: spec.template.spec.initContainers[1]
|
||||
content:
|
||||
env:
|
||||
- name: GITEA_APP_INI
|
||||
value: /data/gitea/conf/app.ini
|
||||
- name: GITEA_CUSTOM
|
||||
value: /data/gitea
|
||||
- name: GITEA_WORK_DIR
|
||||
value: /data
|
||||
- name: GITEA_TEMP
|
||||
value: /tmp/gitea
|
||||
- name: TMP_EXISTING_ENVS_FILE
|
||||
value: /tmp/existing-envs
|
||||
- name: ENV_TO_INI_MOUNT_POINT
|
||||
value: /env-to-ini-mounts
|
||||
- name: GITEA_REBUILD_APP_INI
|
||||
value: "false"
|
||||
- name: GITEA_database_HOST
|
||||
value: my-db:123
|
||||
- name: GITEA_database_USER
|
||||
value: my-user
|
||||
- it: "Render the Deployment with templated additionalConfigFromEnvs"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
gitea.misc.host: my-db-host:321
|
||||
gitea.misc.user: my-db-user
|
||||
gitea.additionalConfigFromEnvs: [{name: GITEA_database_HOST, value: "{{ .Values.gitea.misc.host }}"}, {name: GITEA_database_USER, value: "{{ .Values.gitea.misc.user }}"}]
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 1
|
||||
- exists:
|
||||
path: spec.template.spec.initContainers[1].env
|
||||
- lengthEqual:
|
||||
path: spec.template.spec.initContainers[1].env
|
||||
count: 9
|
||||
- isSubset:
|
||||
path: spec.template.spec.initContainers[1]
|
||||
content:
|
||||
env:
|
||||
- name: GITEA_APP_INI
|
||||
value: /data/gitea/conf/app.ini
|
||||
- name: GITEA_CUSTOM
|
||||
value: /data/gitea
|
||||
- name: GITEA_WORK_DIR
|
||||
value: /data
|
||||
- name: GITEA_TEMP
|
||||
value: /tmp/gitea
|
||||
- name: TMP_EXISTING_ENVS_FILE
|
||||
value: /tmp/existing-envs
|
||||
- name: ENV_TO_INI_MOUNT_POINT
|
||||
value: /env-to-ini-mounts
|
||||
- name: GITEA_REBUILD_APP_INI
|
||||
value: "false"
|
||||
- name: GITEA_database_HOST
|
||||
value: my-db-host:321
|
||||
- name: GITEA_database_USER
|
||||
value: my-db-user
|
||||
- it: "Render the Deployment with a templated Secret name in additionalConfigFromEnvs"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
gitea.misc.existingSecret: my-db-secret
|
||||
gitea.additionalConfigFromEnvs[0]:
|
||||
name: GITEA_database_HOST
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: "{{ .Values.gitea.misc.existingSecret }}"
|
||||
key: password
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 1
|
||||
- exists:
|
||||
path: spec.template.spec.initContainers[1].env
|
||||
- lengthEqual:
|
||||
path: spec.template.spec.initContainers[1].env
|
||||
count: 8
|
||||
- isSubset:
|
||||
path: spec.template.spec.initContainers[1]
|
||||
content:
|
||||
env:
|
||||
- name: GITEA_APP_INI
|
||||
value: /data/gitea/conf/app.ini
|
||||
- name: GITEA_CUSTOM
|
||||
value: /data/gitea
|
||||
- name: GITEA_WORK_DIR
|
||||
value: /data
|
||||
- name: GITEA_TEMP
|
||||
value: /tmp/gitea
|
||||
- name: TMP_EXISTING_ENVS_FILE
|
||||
value: /tmp/existing-envs
|
||||
- name: ENV_TO_INI_MOUNT_POINT
|
||||
value: /env-to-ini-mounts
|
||||
- name: GITEA_REBUILD_APP_INI
|
||||
value: "false"
|
||||
- name: GITEA_database_HOST
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
@@ -1,4 +1,4 @@
|
||||
suite: deployment template (admin user)
|
||||
suite: Test deployment admin user
|
||||
release:
|
||||
name: gitea-unittests
|
||||
namespace: testing
|
||||
@@ -11,7 +11,7 @@ templates:
|
||||
- templates/secret_inlineConfig.yaml
|
||||
- templates/secret_metrics.yaml
|
||||
tests:
|
||||
- it: reads the admin credentials from the generated secret
|
||||
- it: "Read the admin credentials from the generated Secret"
|
||||
template: templates/deployment.yaml
|
||||
asserts:
|
||||
- contains:
|
||||
@@ -44,7 +44,7 @@ tests:
|
||||
name: GITEA_ADMIN_PASSWORD_MODE
|
||||
value: keepUpdated
|
||||
|
||||
- it: reads the admin credentials from the configured keys of an existing secret
|
||||
- it: "Read the admin credentials from the configured keys of an existing Secret"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
secrets.admin.existingSecret.enabled: true
|
||||
@@ -78,7 +78,7 @@ tests:
|
||||
key: custom-email
|
||||
name: custom-admin-secret
|
||||
|
||||
- it: omits the admin environment when the admin user is disabled
|
||||
- it: "Omit the admin environment when the admin user is disabled"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
secrets.admin.enabled: false
|
||||
@@ -94,7 +94,7 @@ tests:
|
||||
name: GITEA_ADMIN_PASSWORD_MODE
|
||||
any: true
|
||||
|
||||
- it: fails on an unsupported password mode
|
||||
- it: "Fail on an unsupported password mode"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
secrets.admin.passwordMode: unsupported
|
||||
@@ -1,4 +1,4 @@
|
||||
suite: deployment template (basic)
|
||||
suite: Test deployment basics
|
||||
release:
|
||||
name: gitea-unittests
|
||||
namespace: testing
|
||||
@@ -11,7 +11,7 @@ templates:
|
||||
- templates/secret_inlineConfig.yaml
|
||||
- templates/secret_metrics.yaml
|
||||
tests:
|
||||
- it: renders a deployment
|
||||
- it: "Render a Deployment"
|
||||
template: templates/deployment.yaml
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
@@ -20,14 +20,14 @@ tests:
|
||||
kind: Deployment
|
||||
apiVersion: apps/v1
|
||||
name: gitea-unittests
|
||||
- it: renders no deployment when disabled
|
||||
- it: "Skip rendering when the Deployment is disabled"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
deployment.enabled: false
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 0
|
||||
- it: deployment labels are set
|
||||
- it: "Render the configured Deployment labels"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
deployment.labels:
|
||||
@@ -45,7 +45,7 @@ tests:
|
||||
path: spec.selector.matchLabels
|
||||
content:
|
||||
hello: world
|
||||
- it: deployment labels are not in selector matchLabels
|
||||
- it: "Omit the Deployment labels from the selector matchLabels"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
deployment.labels:
|
||||
@@ -57,7 +57,7 @@ tests:
|
||||
value:
|
||||
app.kubernetes.io/name: gitea
|
||||
app.kubernetes.io/instance: gitea-unittests
|
||||
- it: deployment labels are always rendered
|
||||
- it: "Render the Deployment labels even when none are configured"
|
||||
template: templates/deployment.yaml
|
||||
asserts:
|
||||
- isSubset:
|
||||
@@ -67,12 +67,12 @@ tests:
|
||||
app.kubernetes.io/name: gitea
|
||||
app.kubernetes.io/instance: gitea-unittests
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
- it: deployment annotations are undefined
|
||||
- it: "Omit the Deployment annotations when none are configured"
|
||||
template: templates/deployment.yaml
|
||||
asserts:
|
||||
- notExists:
|
||||
path: metadata.annotations
|
||||
- it: deployment annotations are set
|
||||
- it: "Render the configured Deployment annotations"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
deployment.annotations:
|
||||
@@ -82,12 +82,12 @@ tests:
|
||||
path: metadata.annotations
|
||||
value:
|
||||
hello: world
|
||||
- it: nodeSelector is undefined
|
||||
- it: "Omit the nodeSelector when none is configured"
|
||||
asserts:
|
||||
- notExists:
|
||||
path: spec.template.spec.nodeSelector
|
||||
template: templates/deployment.yaml
|
||||
- it: nodeSelector is defined
|
||||
- it: "Render the configured nodeSelector"
|
||||
set:
|
||||
deployment.nodeSelector:
|
||||
foo: bar
|
||||
@@ -99,12 +99,12 @@ tests:
|
||||
foo: bar
|
||||
bar: foo
|
||||
template: templates/deployment.yaml
|
||||
- it: affinity is undefined
|
||||
- it: "Omit the affinity when none is configured"
|
||||
template: templates/deployment.yaml
|
||||
asserts:
|
||||
- notExists:
|
||||
path: spec.template.spec.affinity
|
||||
- it: affinity is defined
|
||||
- it: "Render the configured affinity"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
deployment.affinity:
|
||||
@@ -128,12 +128,12 @@ tests:
|
||||
operator: In
|
||||
values:
|
||||
- linux
|
||||
- it: dnsConfig is undefined
|
||||
- it: "Omit the dnsConfig when none is configured"
|
||||
template: templates/deployment.yaml
|
||||
asserts:
|
||||
- notExists:
|
||||
path: spec.template.spec.dnsConfig
|
||||
- it: dnsConfig is defined
|
||||
- it: "Render the configured dnsConfig"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
deployment.dnsConfig:
|
||||
@@ -151,12 +151,12 @@ tests:
|
||||
options:
|
||||
- name: ndots
|
||||
value: "2"
|
||||
- it: priorityClassName is undefined
|
||||
- it: "Omit the priorityClassName when none is configured"
|
||||
template: templates/deployment.yaml
|
||||
asserts:
|
||||
- notExists:
|
||||
path: spec.template.spec.priorityClassName
|
||||
- it: priorityClassName is defined
|
||||
- it: "Render the configured priorityClassName"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
deployment.priorityClassName: high-priority
|
||||
@@ -164,12 +164,12 @@ tests:
|
||||
- equal:
|
||||
path: spec.template.spec.priorityClassName
|
||||
value: high-priority
|
||||
- it: schedulerName is undefined
|
||||
- it: "Omit the schedulerName when none is configured"
|
||||
template: templates/deployment.yaml
|
||||
asserts:
|
||||
- notExists:
|
||||
path: spec.template.spec.schedulerName
|
||||
- it: schedulerName is defined
|
||||
- it: "Render the configured schedulerName"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
deployment.schedulerName: stork
|
||||
@@ -177,7 +177,7 @@ tests:
|
||||
- equal:
|
||||
path: spec.template.spec.schedulerName
|
||||
value: stork
|
||||
- it: strategy defaults to a rolling update
|
||||
- it: "Default the strategy to a rolling update"
|
||||
template: templates/deployment.yaml
|
||||
asserts:
|
||||
- equal:
|
||||
@@ -187,7 +187,7 @@ tests:
|
||||
rollingUpdate:
|
||||
maxUnavailable: 0
|
||||
maxSurge: 100%
|
||||
- it: strategy omits rollingUpdate for other strategy types
|
||||
- it: "Omit rollingUpdate for other strategy types"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
deployment.strategy.type: Recreate
|
||||
@@ -196,12 +196,12 @@ tests:
|
||||
path: spec.strategy
|
||||
value:
|
||||
type: Recreate
|
||||
- it: tolerations are undefined
|
||||
- it: "Omit the tolerations when none are configured"
|
||||
template: templates/deployment.yaml
|
||||
asserts:
|
||||
- notExists:
|
||||
path: spec.template.spec.tolerations
|
||||
- it: tolerations are defined
|
||||
- it: "Render the configured tolerations"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
deployment.tolerations:
|
||||
@@ -217,12 +217,12 @@ tests:
|
||||
operator: Equal
|
||||
value: postgres
|
||||
effect: NoSchedule
|
||||
- it: topologySpreadConstraints are undefined
|
||||
- it: "Omit the topologySpreadConstraints when none are configured"
|
||||
template: templates/deployment.yaml
|
||||
asserts:
|
||||
- notExists:
|
||||
path: spec.template.spec.topologySpreadConstraints
|
||||
- it: topologySpreadConstraints are defined
|
||||
- it: "Render the configured topologySpreadConstraints"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
deployment.topologySpreadConstraints:
|
||||
@@ -243,7 +243,7 @@ tests:
|
||||
matchLabels:
|
||||
app.kubernetes.io/instance: gitea-unittests
|
||||
|
||||
- it: "injects TMP_EXISTING_ENVS_FILE as environment variable to 'init-app-ini' init container"
|
||||
- it: "Inject TMP_EXISTING_ENVS_FILE into the 'init-app-ini' init container"
|
||||
template: templates/deployment.yaml
|
||||
asserts:
|
||||
- contains:
|
||||
@@ -251,7 +251,7 @@ tests:
|
||||
content:
|
||||
name: TMP_EXISTING_ENVS_FILE
|
||||
value: /tmp/existing-envs
|
||||
- it: "injects ENV_TO_INI_MOUNT_POINT as environment variable to 'init-app-ini' init container"
|
||||
- it: "Inject ENV_TO_INI_MOUNT_POINT into the 'init-app-ini' init container"
|
||||
template: templates/deployment.yaml
|
||||
asserts:
|
||||
- contains:
|
||||
@@ -259,7 +259,7 @@ tests:
|
||||
content:
|
||||
name: ENV_TO_INI_MOUNT_POINT
|
||||
value: /env-to-ini-mounts
|
||||
- it: "deployment.gitea.env is injected into all init containers and the gitea container"
|
||||
- it: "Inject deployment.gitea.env into all init containers and the gitea container"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
deployment.gitea.env:
|
||||
@@ -286,7 +286,7 @@ tests:
|
||||
content:
|
||||
name: VARIABLE
|
||||
value: my-value
|
||||
- it: CPU resources are defined as well as GOMAXPROCS
|
||||
- it: "Render GOMAXPROCS when the CPU resources are defined"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
deployment.gitea.resources:
|
||||
@@ -314,7 +314,7 @@ tests:
|
||||
requests:
|
||||
cpu: 100ms
|
||||
memory: 100Mi
|
||||
- it: container resources default to an empty map and GOMAXPROCS is omitted
|
||||
- it: "Default the container resources to an empty map and omit GOMAXPROCS"
|
||||
template: templates/deployment.yaml
|
||||
asserts:
|
||||
- equal:
|
||||
@@ -328,12 +328,12 @@ tests:
|
||||
resourceFieldRef:
|
||||
divisor: "1"
|
||||
resource: limits.cpu
|
||||
- it: pod level resources are undefined
|
||||
- it: "Omit the pod level resources when none are configured"
|
||||
template: templates/deployment.yaml
|
||||
asserts:
|
||||
- notExists:
|
||||
path: spec.template.spec.resources
|
||||
- it: pod level resources are defined
|
||||
- it: "Render the configured pod level resources"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
deployment.resources:
|
||||
@@ -353,7 +353,7 @@ tests:
|
||||
requests:
|
||||
cpu: 250m
|
||||
memory: 256Mi
|
||||
- it: Init containers have correct volumeMount path
|
||||
- it: "Render the configured volumeMount path of the init containers"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
initContainersScriptsVolumeMountPath: "/custom/init/path"
|
||||
@@ -364,7 +364,7 @@ tests:
|
||||
- equal:
|
||||
path: spec.template.spec.initContainers[*].volumeMounts[?(@.name=="config")].mountPath
|
||||
value: "/custom/init/path"
|
||||
- it: Init containers have correct volumeMount path if there is no override
|
||||
- it: "Render the default volumeMount path of the init containers"
|
||||
template: templates/deployment.yaml
|
||||
asserts:
|
||||
- equal:
|
||||
+15
-5
@@ -1,19 +1,22 @@
|
||||
suite: deployment template (checksum annotations)
|
||||
suite: Test deployment checksum annotations
|
||||
release:
|
||||
name: gitea-unittests
|
||||
namespace: testing
|
||||
templates:
|
||||
- templates/deployment.yaml
|
||||
- templates/secret_admin.yaml
|
||||
- templates/secret_cloudnativePG.yaml
|
||||
- templates/secret_config.yaml
|
||||
- templates/secret_gpg.yaml
|
||||
- templates/secret_init.yaml
|
||||
- templates/secret_inlineConfig.yaml
|
||||
- templates/secret_metrics.yaml
|
||||
tests:
|
||||
- it: omits the checksum annotations by default
|
||||
- it: "Omit the checksum annotations by default"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
cloudnativePG.enabled: true
|
||||
|
||||
secrets.admin.enabled: true
|
||||
secrets.config.enabled: true
|
||||
secrets.gpg.enabled: true
|
||||
@@ -26,6 +29,8 @@ tests:
|
||||
asserts:
|
||||
- notExists:
|
||||
path: spec.template.metadata.annotations["checksum/admin"]
|
||||
- notExists:
|
||||
path: spec.template.metadata.annotations["checksum/cloudnativePG"]
|
||||
- notExists:
|
||||
path: spec.template.metadata.annotations["checksum/config"]
|
||||
- notExists:
|
||||
@@ -37,9 +42,12 @@ tests:
|
||||
- notExists:
|
||||
path: spec.template.metadata.annotations["checksum/metrics"]
|
||||
|
||||
- it: adds a checksum annotation for every Secret when addSHASumAnnotation is enabled
|
||||
- it: "Add a checksum annotation for every Secret when addSHASumAnnotation is enabled"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
cloudnativePG.credentials.addSHASumAnnotation: true
|
||||
cloudnativePG.enabled: true
|
||||
|
||||
secrets.admin.addSHASumAnnotation: true
|
||||
secrets.admin.enabled: true
|
||||
|
||||
@@ -63,6 +71,8 @@ tests:
|
||||
asserts:
|
||||
- exists:
|
||||
path: spec.template.metadata.annotations["checksum/admin"]
|
||||
- exists:
|
||||
path: spec.template.metadata.annotations["checksum/cloudnativePG"]
|
||||
- exists:
|
||||
path: spec.template.metadata.annotations["checksum/config"]
|
||||
- exists:
|
||||
@@ -74,7 +84,7 @@ tests:
|
||||
- exists:
|
||||
path: spec.template.metadata.annotations["checksum/metrics"]
|
||||
|
||||
- it: omits the checksum annotation of a single disabled Secret only
|
||||
- it: "Omit the checksum annotation of a single disabled Secret only"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
secrets.admin.addSHASumAnnotation: false
|
||||
@@ -111,7 +121,7 @@ tests:
|
||||
- notExists:
|
||||
path: spec.template.metadata.annotations["checksum/metrics"]
|
||||
|
||||
- it: adds the checksum of Secrets provided by the user
|
||||
- it: "Add the checksum of Secrets provided by the user"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
secrets.admin.enabled: true
|
||||
@@ -0,0 +1,67 @@
|
||||
suite: Test deployment cloudnativePG credentials
|
||||
release:
|
||||
name: gitea-unittests
|
||||
namespace: testing
|
||||
templates:
|
||||
- templates/deployment.yaml
|
||||
- templates/secret_cloudnativePG.yaml
|
||||
tests:
|
||||
- it: "Inject no database password when cloudnativePG is disabled"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
cloudnativePG:
|
||||
enabled: false
|
||||
asserts:
|
||||
- notContains:
|
||||
path: spec.template.spec.initContainers[1].env
|
||||
content:
|
||||
name: GITEA__database__PASSWD
|
||||
any: true
|
||||
|
||||
- it: "Inject the database password from the rendered Secret"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
cloudnativePG:
|
||||
enabled: true
|
||||
asserts:
|
||||
- contains:
|
||||
path: spec.template.spec.initContainers[1].env
|
||||
content:
|
||||
name: GITEA__database__PASSWD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
key: password
|
||||
name: gitea-unittests-postgresql-app
|
||||
|
||||
- it: "Inject the database password from an existing Secret"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
cloudnativePG:
|
||||
enabled: true
|
||||
credentials:
|
||||
existingSecret:
|
||||
enabled: true
|
||||
secretName: my-credentials
|
||||
passwordKey: my-password-key
|
||||
asserts:
|
||||
- contains:
|
||||
path: spec.template.spec.initContainers[1].env
|
||||
content:
|
||||
name: GITEA__database__PASSWD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
key: my-password-key
|
||||
name: my-credentials
|
||||
|
||||
- it: "Fail when an existing Secret is used without a name"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
cloudnativePG:
|
||||
enabled: true
|
||||
credentials:
|
||||
existingSecret:
|
||||
enabled: true
|
||||
secretName: ""
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: "`cloudnativePG.credentials.existingSecret.secretName` must be set when `cloudnativePG.credentials.existingSecret.enabled` is enabled"
|
||||
@@ -1,4 +1,4 @@
|
||||
suite: deployment template (extraEnvSourceFile)
|
||||
suite: Test deployment extraEnvSourceFile
|
||||
release:
|
||||
name: gitea-unittests
|
||||
namespace: testing
|
||||
@@ -11,7 +11,7 @@ templates:
|
||||
- templates/secret_inlineConfig.yaml
|
||||
- templates/secret_metrics.yaml
|
||||
tests:
|
||||
- it: uses direct execution when extraEnvSourceFile is not set
|
||||
- it: "Use direct execution when extraEnvSourceFile is not set"
|
||||
template: templates/deployment.yaml
|
||||
asserts:
|
||||
- equal:
|
||||
@@ -25,7 +25,7 @@ tests:
|
||||
- notExists:
|
||||
path: spec.template.spec.initContainers[2].args
|
||||
|
||||
- it: sources env file in init-app-ini when extraEnvSourceFile is set
|
||||
- it: "Source the env file in init-app-ini when extraEnvSourceFile is set"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
gitea:
|
||||
@@ -41,7 +41,7 @@ tests:
|
||||
path: spec.template.spec.initContainers[1].args[0]
|
||||
pattern: config_environment\.sh
|
||||
|
||||
- it: sources env file in configure-gitea when extraEnvSourceFile is set
|
||||
- it: "Source the env file in configure-gitea when extraEnvSourceFile is set"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
gitea:
|
||||
@@ -57,7 +57,7 @@ tests:
|
||||
path: spec.template.spec.initContainers[2].args[0]
|
||||
pattern: configure_gitea\.sh
|
||||
|
||||
- it: sources env file in configure-gpg when extraEnvSourceFile is set with signing enabled
|
||||
- it: "Source the env file in configure-gpg when extraEnvSourceFile is set and signing is enabled"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
secrets.gpg.enabled: true
|
||||
@@ -76,7 +76,7 @@ tests:
|
||||
path: spec.template.spec.initContainers[2].args[0]
|
||||
pattern: configure_gpg_environment\.sh
|
||||
|
||||
- it: includes file existence check in source command
|
||||
- it: "Include a file existence check in the source command"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
gitea:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
suite: deployment template
|
||||
suite: Test deployment extraInitContainers
|
||||
release:
|
||||
name: gitea-unittests
|
||||
namespace: testing
|
||||
@@ -11,7 +11,7 @@ templates:
|
||||
- templates/secret_inlineConfig.yaml
|
||||
- templates/secret_metrics.yaml
|
||||
tests:
|
||||
- it: Render the deployment (default)
|
||||
- it: "Render the Deployment with the default init containers"
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 1
|
||||
@@ -21,7 +21,7 @@ tests:
|
||||
count: 3
|
||||
template: templates/deployment.yaml
|
||||
|
||||
- it: Render the deployment (signing)
|
||||
- it: "Render the Deployment with the signing init container"
|
||||
set:
|
||||
secrets.gpg.enabled: true
|
||||
secrets.gpg.existingSecret.enabled: true
|
||||
@@ -35,7 +35,7 @@ tests:
|
||||
count: 4
|
||||
template: templates/deployment.yaml
|
||||
|
||||
- it: Render the deployment (extraInitContainers)
|
||||
- it: "Render the Deployment with extraInitContainers"
|
||||
set:
|
||||
deployment.initContainers:
|
||||
- container:
|
||||
@@ -68,7 +68,7 @@ tests:
|
||||
value: foo
|
||||
template: templates/deployment.yaml
|
||||
|
||||
- it: renders the chart-managed init containers in the configured order
|
||||
- it: "Render the chart-managed init containers in the configured order"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
deployment.initContainers:
|
||||
@@ -82,7 +82,7 @@ tests:
|
||||
path: spec.template.spec.initContainers[1].name
|
||||
value: init-directories
|
||||
|
||||
- it: fails when an init container entry sets both container and link
|
||||
- it: "Fail when an init container entry sets both container and link"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
deployment.initContainers:
|
||||
@@ -94,7 +94,7 @@ tests:
|
||||
- failedTemplate:
|
||||
errorMessage: "deployment.initContainers[0]: `container` and `link` are mutually exclusive"
|
||||
|
||||
- it: fails when an init container entry sets neither container nor link
|
||||
- it: "Fail when an init container entry sets neither container nor link"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
deployment.initContainers:
|
||||
@@ -103,7 +103,7 @@ tests:
|
||||
- failedTemplate:
|
||||
errorMessage: "deployment.initContainers[0]: either `container` or `link` must be set"
|
||||
|
||||
- it: fails when an init container links to an unknown configuration
|
||||
- it: "Fail when an init container links to an unknown configuration"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
deployment.initContainers:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
suite: deployment template (HA)
|
||||
suite: Test deployment high availability
|
||||
release:
|
||||
name: gitea-unittests
|
||||
namespace: testing
|
||||
@@ -11,7 +11,7 @@ templates:
|
||||
- templates/secret_inlineConfig.yaml
|
||||
- templates/secret_metrics.yaml
|
||||
tests:
|
||||
- it: fails with multiple replicas and "GIT_GC_REPOS" enabled
|
||||
- it: "Fail with multiple replicas and GIT_GC_REPOS enabled"
|
||||
template: templates/secret_config.yaml
|
||||
set:
|
||||
deployment:
|
||||
@@ -28,7 +28,7 @@ tests:
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: "Invoking the garbage collector via CRON is not yet supported when running with multiple replicas. Please set 'gitea.config.cron.GIT_GC_REPOS.enabled = false'."
|
||||
- it: fails with multiple replicas and RWX file system not set
|
||||
- it: "Fail with multiple replicas and no RWX file system"
|
||||
template: templates/secret_config.yaml
|
||||
set:
|
||||
deployment:
|
||||
@@ -36,7 +36,7 @@ tests:
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: "When using multiple replicas, a RWX file system is required and persistence.new.accessModes[0] must be set to ReadWriteMany."
|
||||
- it: fails with multiple replicas and bleve issue indexer
|
||||
- it: "Fail with multiple replicas and the bleve issue indexer"
|
||||
template: templates/secret_config.yaml
|
||||
set:
|
||||
deployment:
|
||||
@@ -52,7 +52,7 @@ tests:
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: "When using multiple replicas, the issue indexer (gitea.config.indexer.ISSUE_INDEXER_TYPE) must be set to a HA-ready provider such as 'meilisearch', 'elasticsearch' or 'db' (if the DB is HA-ready)."
|
||||
- it: fails with multiple replicas and bleve repo indexer
|
||||
- it: "Fail with multiple replicas and the bleve repo indexer"
|
||||
template: templates/secret_config.yaml
|
||||
set:
|
||||
deployment:
|
||||
+12
-12
@@ -1,4 +1,4 @@
|
||||
suite: deployment template (image configuration)
|
||||
suite: Test deployment image configuration
|
||||
release:
|
||||
name: gitea-unittests
|
||||
namespace: testing
|
||||
@@ -14,13 +14,13 @@ templates:
|
||||
- templates/secret_inlineConfig.yaml
|
||||
- templates/secret_metrics.yaml
|
||||
tests:
|
||||
- it: default values
|
||||
- it: "Render the default image reference"
|
||||
template: templates/deployment.yaml
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].image
|
||||
value: "docker.gitea.com/gitea:1.19.3-rootless"
|
||||
- it: tag override
|
||||
- it: "Render a custom image tag"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
deployment.gitea.image.tag: "1.19.4"
|
||||
@@ -28,7 +28,7 @@ tests:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].image
|
||||
value: "docker.gitea.com/gitea:1.19.4-rootless"
|
||||
- it: root-based image
|
||||
- it: "Render the root-based image variant"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
deployment.gitea.image.rootless: false
|
||||
@@ -36,7 +36,7 @@ tests:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].image
|
||||
value: "docker.gitea.com/gitea:1.19.3"
|
||||
- it: scoped registry
|
||||
- it: "Render a scoped image registry"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
deployment.gitea.image.registry: "example.com"
|
||||
@@ -44,7 +44,7 @@ tests:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].image
|
||||
value: "example.com/gitea:1.19.3-rootless"
|
||||
- it: global registry
|
||||
- it: "Render the global image registry"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
global.imageRegistry: "global.example.com"
|
||||
@@ -52,7 +52,7 @@ tests:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].image
|
||||
value: "global.example.com/gitea:1.19.3-rootless"
|
||||
- it: digest for rootless image
|
||||
- it: "Render a digest for the rootless image"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
deployment:
|
||||
@@ -64,7 +64,7 @@ tests:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].image
|
||||
value: "docker.gitea.com/gitea:1.19.3-rootless@sha256:b28e8f3089b52ebe6693295df142f8c12eff354e9a4a5bfbb5c10f296c3a537a"
|
||||
- it: image fullOverride (does not append rootless)
|
||||
- it: "Render image.fullOverride without appending the rootless suffix"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
deployment:
|
||||
@@ -81,7 +81,7 @@ tests:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].image
|
||||
value: "docker.gitea.com/gitea:1.19.3"
|
||||
- it: digest for root-based image
|
||||
- it: "Render a digest for the root-based image"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
deployment:
|
||||
@@ -93,7 +93,7 @@ tests:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].image
|
||||
value: "docker.gitea.com/gitea:1.19.3@sha256:b28e8f3089b52ebe6693295df142f8c12eff354e9a4a5bfbb5c10f296c3a537a"
|
||||
- it: digest and global registry
|
||||
- it: "Render a digest together with the global image registry"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
global.imageRegistry: "global.example.com"
|
||||
@@ -102,7 +102,7 @@ tests:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].image
|
||||
value: "global.example.com/gitea:1.19.3-rootless@sha256:b28e8f3089b52ebe6693295df142f8c12eff354e9a4a5bfbb5c10f296c3a537a"
|
||||
- it: correctly renders floating tag references
|
||||
- it: "Render unquoted floating tag references"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
# use non-quoted values on purpose. See: https://gitea.com/gitea/helm-gitea/issues/631
|
||||
@@ -123,7 +123,7 @@ tests:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].image
|
||||
value: "docker.gitea.com/gitea:1.21-rootless"
|
||||
- it: init containers use their own image configuration
|
||||
- it: "Render the own image configuration of the init containers"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
deployment.initDirectories.image.registry: "init.example.com"
|
||||
@@ -1,4 +1,4 @@
|
||||
suite: deployment template (init container configuration)
|
||||
suite: Test deployment init container configuration
|
||||
release:
|
||||
name: gitea-unittests
|
||||
namespace: testing
|
||||
@@ -11,7 +11,7 @@ templates:
|
||||
- templates/secret_inlineConfig.yaml
|
||||
- templates/secret_metrics.yaml
|
||||
tests:
|
||||
- it: appends the per-container env
|
||||
- it: "Append the per-container env"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
deployment.initDirectories.env:
|
||||
@@ -37,7 +37,7 @@ tests:
|
||||
name: INIT_DIRECTORIES
|
||||
value: "1"
|
||||
|
||||
- it: renders the per-container envFrom
|
||||
- it: "Render the per-container envFrom"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
deployment.initAppIni.envFrom:
|
||||
@@ -52,7 +52,7 @@ tests:
|
||||
- secretRef:
|
||||
name: special-secret
|
||||
|
||||
- it: appends the per-container volumeMounts
|
||||
- it: "Append the per-container volumeMounts"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
deployment.initConfigureGitea.volumeMounts:
|
||||
@@ -73,7 +73,7 @@ tests:
|
||||
mountPath: /configmap
|
||||
readOnly: true
|
||||
|
||||
- it: overrides the resources of a single init container
|
||||
- it: "Override the resources of a single init container"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
deployment.initDirectories.resources:
|
||||
@@ -93,7 +93,7 @@ tests:
|
||||
cpu: 100m
|
||||
memory: 128Mi
|
||||
|
||||
- it: overrides the security context of a single init container
|
||||
- it: "Override the security context of a single init container"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
deployment.gitea.securityContext:
|
||||
@@ -108,7 +108,7 @@ tests:
|
||||
path: spec.template.spec.initContainers[1].securityContext.runAsUser
|
||||
value: 1000
|
||||
|
||||
- it: renders the envFrom of the gitea container
|
||||
- it: "Render the envFrom of the gitea container"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
deployment.gitea.envFrom:
|
||||
@@ -121,7 +121,7 @@ tests:
|
||||
- configMapRef:
|
||||
name: special-config
|
||||
|
||||
- it: omits envFrom when unset
|
||||
- it: "Omit the envFrom when it is unset"
|
||||
template: templates/deployment.yaml
|
||||
asserts:
|
||||
- notExists:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
suite: deployment template (openshift)
|
||||
suite: Test deployment on OpenShift
|
||||
release:
|
||||
name: gitea-unittests
|
||||
namespace: testing
|
||||
@@ -11,7 +11,7 @@ templates:
|
||||
- templates/secret_inlineConfig.yaml
|
||||
- templates/secret_metrics.yaml
|
||||
tests:
|
||||
- it: renders openshift-compatible defaults for chart-managed containers
|
||||
- it: "Render OpenShift compatible defaults for the chart-managed containers"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
openshift.enabled: true
|
||||
@@ -61,7 +61,7 @@ tests:
|
||||
seccompProfile:
|
||||
type: RuntimeDefault
|
||||
|
||||
- it: does not force runAsUser 1000 for command init containers on OpenShift
|
||||
- it: "Omit runAsUser 1000 for command init containers on OpenShift"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
openshift.enabled: true
|
||||
@@ -74,7 +74,7 @@ tests:
|
||||
- notExists:
|
||||
path: spec.template.spec.initContainers[3].securityContext.runAsUser
|
||||
|
||||
- it: preserves explicit pod and container security context overrides on OpenShift
|
||||
- it: "Preserve explicit pod and container security context overrides on OpenShift"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
openshift:
|
||||
@@ -102,7 +102,7 @@ tests:
|
||||
path: spec.template.spec.containers[0].securityContext.runAsGroup
|
||||
value: 1000620000
|
||||
|
||||
- it: renders an explicit hostUsers=false override on OpenShift
|
||||
- it: "Render an explicit hostUsers=false override on OpenShift"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
openshift:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
suite: deployment template (probes)
|
||||
suite: Test deployment probes
|
||||
release:
|
||||
name: gitea-unittests
|
||||
namespace: testing
|
||||
@@ -11,7 +11,7 @@ templates:
|
||||
- templates/secret_inlineConfig.yaml
|
||||
- templates/secret_metrics.yaml
|
||||
tests:
|
||||
- it: renders default liveness probe
|
||||
- it: "Render the default liveness probe"
|
||||
template: templates/deployment.yaml
|
||||
asserts:
|
||||
- notExists:
|
||||
@@ -26,7 +26,7 @@ tests:
|
||||
tcpSocket:
|
||||
port: http
|
||||
timeoutSeconds: 1
|
||||
- it: renders default readiness probe
|
||||
- it: "Render the default readiness probe"
|
||||
template: templates/deployment.yaml
|
||||
asserts:
|
||||
- notExists:
|
||||
@@ -41,12 +41,12 @@ tests:
|
||||
tcpSocket:
|
||||
port: http
|
||||
timeoutSeconds: 1
|
||||
- it: does not render a default startup probe
|
||||
- it: "Skip the startup probe by default"
|
||||
template: templates/deployment.yaml
|
||||
asserts:
|
||||
- notExists:
|
||||
path: spec.template.spec.containers[0].startupProbe
|
||||
- it: allows enabling a startup probe
|
||||
- it: "Render the startup probe when it is enabled"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
gitea.startupProbe.enabled: true
|
||||
@@ -64,7 +64,7 @@ tests:
|
||||
port: http
|
||||
timeoutSeconds: 1
|
||||
|
||||
- it: allows overwriting the default port of the liveness probe
|
||||
- it: "Overwrite the default port of the liveness probe"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
gitea:
|
||||
@@ -78,7 +78,7 @@ tests:
|
||||
tcpSocket:
|
||||
port: my-port
|
||||
|
||||
- it: allows overwriting the default port of the readiness probe
|
||||
- it: "Overwrite the default port of the readiness probe"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
gitea:
|
||||
@@ -92,7 +92,7 @@ tests:
|
||||
tcpSocket:
|
||||
port: my-port
|
||||
|
||||
- it: allows overwriting the default port of the startup probe
|
||||
- it: "Overwrite the default port of the startup probe"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
gitea:
|
||||
@@ -107,7 +107,7 @@ tests:
|
||||
tcpSocket:
|
||||
port: my-port
|
||||
|
||||
- it: allows using a non-default method as liveness probe
|
||||
- it: "Use a non-default method as liveness probe"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
gitea:
|
||||
@@ -135,7 +135,7 @@ tests:
|
||||
port: http
|
||||
timeoutSeconds: 13372
|
||||
|
||||
- it: allows using a non-default method as readiness probe
|
||||
- it: "Use a non-default method as readiness probe"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
gitea:
|
||||
@@ -163,7 +163,7 @@ tests:
|
||||
port: http
|
||||
timeoutSeconds: 13372
|
||||
|
||||
- it: allows using a non-default method as startup probe
|
||||
- it: "Use a non-default method as startup probe"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
gitea:
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
suite: Test deployment app.ini rebuild
|
||||
release:
|
||||
name: gitea-unittests
|
||||
namespace: testing
|
||||
templates:
|
||||
- templates/deployment.yaml
|
||||
tests:
|
||||
- it: Disable app.ini rebuild by default
|
||||
asserts:
|
||||
- contains:
|
||||
path: spec.template.spec.initContainers[1].env
|
||||
content:
|
||||
name: GITEA_REBUILD_APP_INI
|
||||
value: "false"
|
||||
|
||||
- it: Enable app.ini rebuild when configured
|
||||
set:
|
||||
deployment.initAppIni.config.rebuild: true
|
||||
asserts:
|
||||
- contains:
|
||||
path: spec.template.spec.initContainers[1].env
|
||||
content:
|
||||
name: GITEA_REBUILD_APP_INI
|
||||
value: "true"
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
suite: sidecar container
|
||||
suite: Test deployment sidecar container
|
||||
release:
|
||||
name: gitea-unittests
|
||||
namespace: testing
|
||||
@@ -11,7 +11,7 @@ templates:
|
||||
- templates/secret_inlineConfig.yaml
|
||||
- templates/secret_metrics.yaml
|
||||
tests:
|
||||
- it: supports adding a sidecar container
|
||||
- it: "Render an additional sidecar container"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
extraContainers:
|
||||
+5
-5
@@ -1,4 +1,4 @@
|
||||
suite: deployment template (signing disabled)
|
||||
suite: Test deployment with signing disabled
|
||||
release:
|
||||
name: gitea-unittests
|
||||
namespace: testing
|
||||
@@ -11,7 +11,7 @@ templates:
|
||||
- templates/secret_inlineConfig.yaml
|
||||
- templates/secret_metrics.yaml
|
||||
tests:
|
||||
- it: skips gpg init container
|
||||
- it: "Skip the gpg init container"
|
||||
template: templates/deployment.yaml
|
||||
asserts:
|
||||
- notContains:
|
||||
@@ -19,7 +19,7 @@ tests:
|
||||
any: true
|
||||
content:
|
||||
name: configure-gpg
|
||||
- it: skips gpg env in `init-directories` init container
|
||||
- it: "Skip the gpg env of the `init-directories` init container"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
secrets.gpg.enabled: false
|
||||
@@ -28,14 +28,14 @@ tests:
|
||||
path: spec.template.spec.initContainers[0].env
|
||||
content:
|
||||
name: GNUPGHOME
|
||||
- it: skips gpg env in runtime container
|
||||
- it: "Skip the gpg env of the runtime container"
|
||||
template: templates/deployment.yaml
|
||||
asserts:
|
||||
- notContains:
|
||||
path: spec.template.spec.containers[0].env
|
||||
content:
|
||||
name: GNUPGHOME
|
||||
- it: skips gpg volume spec
|
||||
- it: "Skip the gpg volume spec"
|
||||
template: templates/deployment.yaml
|
||||
asserts:
|
||||
- notContains:
|
||||
+7
-7
@@ -1,4 +1,4 @@
|
||||
suite: deployment template (signing enabled)
|
||||
suite: Test deployment with signing enabled
|
||||
release:
|
||||
name: gitea-unittests
|
||||
namespace: testing
|
||||
@@ -11,7 +11,7 @@ templates:
|
||||
- templates/secret_inlineConfig.yaml
|
||||
- templates/secret_metrics.yaml
|
||||
tests:
|
||||
- it: adds gpg init container
|
||||
- it: "Add the gpg init container"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
secrets.gpg.enabled: true
|
||||
@@ -48,7 +48,7 @@ tests:
|
||||
- name: gpg-private-key
|
||||
mountPath: /raw
|
||||
readOnly: true
|
||||
- it: adds gpg env in `init-directories` init container
|
||||
- it: "Add the gpg env to the `init-directories` init container"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
secrets.gpg.enabled: true
|
||||
@@ -63,7 +63,7 @@ tests:
|
||||
secretKeyRef:
|
||||
name: custom-gpg-secret
|
||||
key: gpgHome
|
||||
- it: adds gpg env in runtime container
|
||||
- it: "Add the gpg env to the runtime container"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
secrets.gpg.enabled: true
|
||||
@@ -78,7 +78,7 @@ tests:
|
||||
secretKeyRef:
|
||||
name: custom-gpg-secret
|
||||
key: gpgHome
|
||||
- it: reads the gpg home from the configured key of an existing secret
|
||||
- it: "Read the gpg home from the configured key of an existing Secret"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
secrets.gpg.enabled: true
|
||||
@@ -94,7 +94,7 @@ tests:
|
||||
secretKeyRef:
|
||||
name: custom-gpg-secret
|
||||
key: custom-gpg-home
|
||||
- it: adds gpg volume spec
|
||||
- it: "Add the gpg volume spec"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
secrets.gpg.enabled: true
|
||||
@@ -110,7 +110,7 @@ tests:
|
||||
- key: privateKey
|
||||
path: private.asc
|
||||
defaultMode: 0100
|
||||
- it: supports gpg volume spec with external reference
|
||||
- it: "Render the gpg volume spec with an external reference"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
secrets.gpg.enabled: true
|
||||
+6
-6
@@ -1,4 +1,4 @@
|
||||
suite: deployment template (SSH configuration)
|
||||
suite: Test deployment SSH configuration
|
||||
release:
|
||||
name: gitea-unittests
|
||||
namespace: testing
|
||||
@@ -11,7 +11,7 @@ templates:
|
||||
- templates/secret_inlineConfig.yaml
|
||||
- templates/secret_metrics.yaml
|
||||
tests:
|
||||
- it: supports defining SSH log level for root based image
|
||||
- it: "Define the SSH log level for the root based image"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
deployment.gitea.image.rootless: false
|
||||
@@ -21,7 +21,7 @@ tests:
|
||||
content:
|
||||
name: SSH_LOG_LEVEL
|
||||
value: "INFO"
|
||||
- it: supports overriding SSH log level
|
||||
- it: "Override the SSH log level"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
deployment.gitea.image.rootless: false
|
||||
@@ -32,7 +32,7 @@ tests:
|
||||
content:
|
||||
name: SSH_LOG_LEVEL
|
||||
value: "DEBUG"
|
||||
- it: supports overriding SSH log level (even when image.fullOverride set)
|
||||
- it: "Override the SSH log level when image.fullOverride is set"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
deployment.gitea.image.fullOverride: docker.gitea.com/gitea:1.19.3
|
||||
@@ -44,7 +44,7 @@ tests:
|
||||
content:
|
||||
name: SSH_LOG_LEVEL
|
||||
value: "DEBUG"
|
||||
- it: skips SSH_LOG_LEVEL for rootless image
|
||||
- it: "Skip SSH_LOG_LEVEL for the rootless image"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
deployment.gitea.image.rootless: true
|
||||
@@ -55,7 +55,7 @@ tests:
|
||||
any: true
|
||||
content:
|
||||
name: SSH_LOG_LEVEL
|
||||
- it: skips SSH_LOG_LEVEL for rootless image (even when image.fullOverride set)
|
||||
- it: "Skip SSH_LOG_LEVEL for the rootless image when image.fullOverride is set"
|
||||
template: templates/deployment.yaml
|
||||
set:
|
||||
deployment.gitea.image.fullOverride: docker.gitea.com/gitea:1.19.3
|
||||
+71
-22
@@ -1,15 +1,15 @@
|
||||
suite: deprecation template (deployment)
|
||||
suite: Test deployment deprecations
|
||||
release:
|
||||
name: gitea-unittests
|
||||
namespace: testing
|
||||
templates:
|
||||
- templates/deprecation.yaml
|
||||
tests:
|
||||
- it: renders nothing with the default values
|
||||
- it: "Render nothing with the default values"
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 0
|
||||
- it: fails when the removed `affinity` value is set
|
||||
- it: "Fail when the removed `affinity` value is set"
|
||||
set:
|
||||
affinity:
|
||||
nodeAffinity:
|
||||
@@ -23,14 +23,14 @@ tests:
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: "`affinity` does no longer exist. Please refer to the changelog and configure `deployment.affinity` instead."
|
||||
- it: fails when the removed `containerSecurityContext` value is set
|
||||
- it: "Fail when the removed `containerSecurityContext` value is set"
|
||||
set:
|
||||
containerSecurityContext:
|
||||
runAsUser: 1000
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: "`containerSecurityContext` does no longer exist. Please refer to the changelog and configure `deployment.gitea.securityContext` instead."
|
||||
- it: fails when the removed `deployment.env` value is set
|
||||
- it: "Fail when the removed `deployment.env` value is set"
|
||||
set:
|
||||
deployment.env:
|
||||
- name: VARIABLE
|
||||
@@ -38,7 +38,7 @@ tests:
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: "`deployment.env` does no longer exist. Please refer to the changelog and configure `deployment.gitea.env` instead."
|
||||
- it: fails when the removed `dnsConfig` value is set
|
||||
- it: "Fail when the removed `dnsConfig` value is set"
|
||||
set:
|
||||
dnsConfig:
|
||||
nameservers:
|
||||
@@ -46,7 +46,7 @@ tests:
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: "`dnsConfig` does no longer exist. Please refer to the changelog and configure `deployment.dnsConfig` instead."
|
||||
- it: fails when the removed `extraContainerVolumeMounts` value is set
|
||||
- it: "Fail when the removed `extraContainerVolumeMounts` value is set"
|
||||
set:
|
||||
extraContainerVolumeMounts:
|
||||
- name: postgres-ssl-vol
|
||||
@@ -54,7 +54,23 @@ tests:
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: "`extraContainerVolumeMounts` does no longer exist. Please refer to the changelog and configure `deployment.gitea.volumeMounts` instead."
|
||||
- it: fails when the removed `extraVolumes` value is set
|
||||
- it: "Fail when the removed `extraInitVolumeMounts` value is set"
|
||||
set:
|
||||
extraInitVolumeMounts:
|
||||
- name: postgres-ssl-vol
|
||||
mountPath: /pg-ssl
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: "`extraInitVolumeMounts` does no longer exist. Please refer to the changelog and configure `deployment.<initContainer>.volumeMounts` instead."
|
||||
- it: "Fail when the removed `extraVolumeMounts` value is set"
|
||||
set:
|
||||
extraVolumeMounts:
|
||||
- name: postgres-ssl-vol
|
||||
mountPath: /pg-ssl
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: "`extraVolumeMounts` does no longer exist. Please refer to the changelog and configure `deployment.gitea.volumeMounts` and `deployment.<initContainer>.volumeMounts` instead."
|
||||
- it: "Fail when the removed `extraVolumes` value is set"
|
||||
set:
|
||||
extraVolumes:
|
||||
- name: postgres-ssl-vol
|
||||
@@ -63,33 +79,53 @@ tests:
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: "`extraVolumes` does no longer exist. Please refer to the changelog and configure `deployment.volumes` instead."
|
||||
- it: fails when the removed `nodeSelector` value is set
|
||||
- it: "Fail when the removed `ingress.className` value is set"
|
||||
set:
|
||||
ingress.className: ""
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: "`ingress.className` does no longer exist. Please refer to the changelog and configure `ingress.ingressClassName` instead."
|
||||
- it: "Fail when the removed `nodeSelector` value is set"
|
||||
set:
|
||||
nodeSelector:
|
||||
foo: bar
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: "`nodeSelector` does no longer exist. Please refer to the changelog and configure `deployment.nodeSelector` instead."
|
||||
- it: fails when the removed `openshift.hostUsers` value is set
|
||||
- it: "Fail when the removed `openshift.hostUsers` value is set"
|
||||
set:
|
||||
openshift.hostUsers: false
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: "`openshift.hostUsers` does no longer exist. Please refer to the changelog and configure `deployment.hostUsers` instead."
|
||||
- it: fails when the removed `priorityClassName` value is set
|
||||
- it: "Fail when the removed `postgresql` value is set"
|
||||
set:
|
||||
postgresql:
|
||||
enabled: true
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: "`postgresql` does no longer exist. Please refer to the changelog and configure `cloudnativePG` instead, which requires the CloudNativePG operator to be installed in the cluster."
|
||||
- it: "Fail when the removed `postgresql-ha` value is set"
|
||||
set:
|
||||
postgresql-ha:
|
||||
enabled: true
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: "`postgresql-ha` does no longer exist. Please refer to the changelog and configure `cloudnativePG` instead, which requires the CloudNativePG operator to be installed in the cluster."
|
||||
- it: "Fail when the removed `priorityClassName` value is set"
|
||||
set:
|
||||
priorityClassName: high-priority
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: "`priorityClassName` does no longer exist. Please refer to the changelog and configure `deployment.priorityClassName` instead."
|
||||
- it: fails when the removed `podSecurityContext` value is set
|
||||
- it: "Fail when the removed `podSecurityContext` value is set"
|
||||
set:
|
||||
podSecurityContext:
|
||||
fsGroup: 1000
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: "`podSecurityContext` does no longer exist. Please refer to the changelog and configure `deployment.securityContext` instead."
|
||||
- it: fails when the removed `postExtraInitContainers` value is set
|
||||
- it: "Fail when the removed `postExtraInitContainers` value is set"
|
||||
set:
|
||||
postExtraInitContainers:
|
||||
- name: post-init-container
|
||||
@@ -97,7 +133,7 @@ tests:
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: "`postExtraInitContainers` does no longer exist. Please refer to the changelog and append an entry with a `container` key to `deployment.initContainers` instead."
|
||||
- it: fails when the removed `preExtraInitContainers` value is set
|
||||
- it: "Fail when the removed `preExtraInitContainers` value is set"
|
||||
set:
|
||||
preExtraInitContainers:
|
||||
- name: pre-init-container
|
||||
@@ -105,7 +141,7 @@ tests:
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: "`preExtraInitContainers` does no longer exist. Please refer to the changelog and prepend an entry with a `container` key to `deployment.initContainers` instead."
|
||||
- it: fails when the removed `resources` value is set
|
||||
- it: "Fail when the removed `resources` value is set"
|
||||
set:
|
||||
resources:
|
||||
limits:
|
||||
@@ -113,33 +149,40 @@ tests:
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: "`resources` does no longer exist. Please refer to the changelog and configure `deployment.gitea.resources` instead."
|
||||
- it: fails when the removed `replicaCount` value is set
|
||||
- it: "Fail when the removed `replicaCount` value is set"
|
||||
set:
|
||||
replicaCount: 2
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: "`replicaCount` does no longer exist. Please refer to the changelog and configure `deployment.replicas` instead."
|
||||
- it: fails when the removed `schedulerName` value is set
|
||||
- it: "Fail when the removed `schedulerName` value is set"
|
||||
set:
|
||||
schedulerName: stork
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: "`schedulerName` does no longer exist. Please refer to the changelog and configure `deployment.schedulerName` instead."
|
||||
- it: fails when the removed `securityContext` value is set
|
||||
- it: "Fail when the removed `securityContext` value is set"
|
||||
set:
|
||||
securityContext:
|
||||
runAsUser: 1000
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: "`securityContext` does no longer exist. Please refer to the changelog and configure `deployment.securityContext` and `deployment.gitea.securityContext` instead."
|
||||
- it: fails when the removed `strategy` value is set
|
||||
- it: "Fail when the removed `strategy` value is set"
|
||||
set:
|
||||
strategy:
|
||||
type: Recreate
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: "`strategy` does no longer exist. Please refer to the changelog and configure `deployment.strategy` instead."
|
||||
- it: fails when the removed `tolerations` value is set
|
||||
- it: "Fail when the removed `test` value is set"
|
||||
set:
|
||||
test:
|
||||
enabled: false
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: "`test` does no longer exist. Please refer to the changelog. The `helm test` connection Pod has been removed without replacement."
|
||||
- it: "Fail when the removed `tolerations` value is set"
|
||||
set:
|
||||
tolerations:
|
||||
- key: database/type
|
||||
@@ -149,14 +192,14 @@ tests:
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: "`tolerations` does no longer exist. Please refer to the changelog and configure `deployment.tolerations` instead."
|
||||
- it: fails when the removed `topologySpreadConstraints` value is set
|
||||
- it: "Fail when the removed `topologySpreadConstraints` value is set"
|
||||
set:
|
||||
topologySpreadConstraints:
|
||||
- topologyKey: kubernetes.io/hostname
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: "`topologySpreadConstraints` does no longer exist. Please refer to the changelog and configure `deployment.topologySpreadConstraints` instead."
|
||||
- it: skips the deprecation checks when `checkDeprecation` is disabled
|
||||
- it: "Skip the deprecation checks when `checkDeprecation` is disabled"
|
||||
set:
|
||||
checkDeprecation: false
|
||||
affinity:
|
||||
@@ -172,6 +215,12 @@ tests:
|
||||
extraContainerVolumeMounts:
|
||||
- name: postgres-ssl-vol
|
||||
mountPath: /pg-ssl
|
||||
extraInitVolumeMounts:
|
||||
- name: postgres-ssl-vol
|
||||
mountPath: /pg-ssl
|
||||
extraVolumeMounts:
|
||||
- name: postgres-ssl-vol
|
||||
mountPath: /pg-ssl
|
||||
extraVolumes:
|
||||
- name: postgres-ssl-vol
|
||||
secret:
|
||||
@@ -1,11 +1,11 @@
|
||||
suite: Test Gateway API backendTLSPolicy.yaml
|
||||
suite: Test gateway API backendTLSPolicy
|
||||
release:
|
||||
name: gitea-unittests
|
||||
namespace: testing
|
||||
templates:
|
||||
- templates/backendTLSPolicy.yaml
|
||||
tests:
|
||||
- it: should not render when gatewayAPI.enabled is false
|
||||
- it: "Skip rendering when gatewayAPI.enabled is false"
|
||||
set:
|
||||
gatewayAPI:
|
||||
enabled: false
|
||||
@@ -22,7 +22,7 @@ tests:
|
||||
- hasDocuments:
|
||||
count: 0
|
||||
|
||||
- it: should not render when backendTLSPolicy.enabled is false
|
||||
- it: "Skip rendering when backendTLSPolicy.enabled is false"
|
||||
set:
|
||||
gatewayAPI:
|
||||
enabled: true
|
||||
@@ -31,7 +31,7 @@ tests:
|
||||
- hasDocuments:
|
||||
count: 0
|
||||
|
||||
- it: should render a BackendTLSPolicy targeting the http Service by default
|
||||
- it: "Render a BackendTLSPolicy targeting the HTTP Service by default"
|
||||
set:
|
||||
gatewayAPI:
|
||||
enabled: true
|
||||
@@ -65,7 +65,7 @@ tests:
|
||||
path: spec.validation.hostname
|
||||
value: git.internal
|
||||
|
||||
- it: should fail when validation is missing
|
||||
- it: "Fail when the validation is missing"
|
||||
set:
|
||||
gatewayAPI:
|
||||
enabled: true
|
||||
@@ -76,7 +76,7 @@ tests:
|
||||
- failedTemplate:
|
||||
errorMessage: gatewayAPI.core.backendTLSPolicy.validation is required
|
||||
|
||||
- it: should fail when validation is an empty dict
|
||||
- it: "Fail when the validation is an empty dict"
|
||||
set:
|
||||
gatewayAPI:
|
||||
enabled: true
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
suite: Test Gateway API clientSettingsPolicy.yaml
|
||||
suite: Test gateway API clientSettingsPolicy
|
||||
release:
|
||||
name: gitea-unittests
|
||||
namespace: testing
|
||||
templates:
|
||||
- templates/clientSettingsPolicy.yaml
|
||||
tests:
|
||||
- it: should not render when gatewayAPI.enabled is false
|
||||
- it: "Skip rendering when gatewayAPI.enabled is false"
|
||||
set:
|
||||
gatewayAPI:
|
||||
enabled: false
|
||||
@@ -18,7 +18,7 @@ tests:
|
||||
- hasDocuments:
|
||||
count: 0
|
||||
|
||||
- it: should not render when clientSettingsPolicies.enabled is false
|
||||
- it: "Skip rendering when clientSettingsPolicies.enabled is false"
|
||||
set:
|
||||
gatewayAPI:
|
||||
enabled: true
|
||||
@@ -27,7 +27,7 @@ tests:
|
||||
- hasDocuments:
|
||||
count: 0
|
||||
|
||||
- it: should render a ClientSettingsPolicy targeting the HTTPRoute by default
|
||||
- it: "Render a ClientSettingsPolicy targeting the HTTPRoute by default"
|
||||
set:
|
||||
gatewayAPI:
|
||||
enabled: true
|
||||
@@ -60,7 +60,7 @@ tests:
|
||||
path: spec.body.maxSize
|
||||
value: 100m
|
||||
|
||||
- it: should honor a custom targetRef
|
||||
- it: "Render a custom targetRef"
|
||||
set:
|
||||
gatewayAPI:
|
||||
enabled: true
|
||||
@@ -81,7 +81,7 @@ tests:
|
||||
path: spec.targetRef.name
|
||||
value: shared-gateway
|
||||
|
||||
- it: should fail when body is missing
|
||||
- it: "Fail when the body is missing"
|
||||
set:
|
||||
gatewayAPI:
|
||||
enabled: true
|
||||
@@ -92,7 +92,7 @@ tests:
|
||||
- failedTemplate:
|
||||
errorMessage: gatewayAPI.nginx.clientSettingsPolicies.body is required
|
||||
|
||||
- it: should fail when body is an empty dict
|
||||
- it: "Fail when the body is an empty dict"
|
||||
set:
|
||||
gatewayAPI:
|
||||
enabled: true
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
suite: Test Gateway API httpRoute.yaml
|
||||
suite: Test gateway API httpRoute
|
||||
release:
|
||||
name: gitea-unittests
|
||||
namespace: testing
|
||||
templates:
|
||||
- templates/httpRoute.yaml
|
||||
tests:
|
||||
- it: should not render when gatewayAPI.enabled is false
|
||||
- it: "Skip rendering when gatewayAPI.enabled is false"
|
||||
set:
|
||||
gatewayAPI:
|
||||
enabled: false
|
||||
@@ -20,7 +20,7 @@ tests:
|
||||
- hasDocuments:
|
||||
count: 0
|
||||
|
||||
- it: should not render when httpRoute.enabled is false
|
||||
- it: "Skip rendering when httpRoute.enabled is false"
|
||||
set:
|
||||
gatewayAPI:
|
||||
enabled: true
|
||||
@@ -29,7 +29,7 @@ tests:
|
||||
- hasDocuments:
|
||||
count: 0
|
||||
|
||||
- it: should render a single HTTPRoute with default rule
|
||||
- it: "Render a single HTTPRoute with the default rule"
|
||||
set:
|
||||
gatewayAPI:
|
||||
enabled: true
|
||||
@@ -85,7 +85,7 @@ tests:
|
||||
path: spec.rules[0].backendRefs[0].weight
|
||||
value: 1
|
||||
|
||||
- it: should fail when parentRefs missing
|
||||
- it: "Fail when the parentRefs are missing"
|
||||
set:
|
||||
gatewayAPI:
|
||||
enabled: true
|
||||
@@ -98,7 +98,7 @@ tests:
|
||||
- failedTemplate:
|
||||
errorMessage: gatewayAPI.core.httpRoute.parentRefs is required
|
||||
|
||||
- it: hostname tpl rendering
|
||||
- it: "Render the hostnames via tpl"
|
||||
set:
|
||||
global:
|
||||
giteaHostName: gitea.tpl.example.com
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
suite: Test Gateway API tcpRoute.yaml
|
||||
suite: Test gateway API tcpRoute
|
||||
release:
|
||||
name: gitea-unittests
|
||||
namespace: testing
|
||||
templates:
|
||||
- templates/tcpRoute.yaml
|
||||
tests:
|
||||
- it: should not render when gatewayAPI.enabled is false
|
||||
- it: "Skip rendering when gatewayAPI.enabled is false"
|
||||
set:
|
||||
gatewayAPI:
|
||||
enabled: false
|
||||
@@ -18,7 +18,7 @@ tests:
|
||||
- hasDocuments:
|
||||
count: 0
|
||||
|
||||
- it: should not render when tcpRoute.enabled is false
|
||||
- it: "Skip rendering when tcpRoute.enabled is false"
|
||||
set:
|
||||
gatewayAPI:
|
||||
enabled: true
|
||||
@@ -27,7 +27,7 @@ tests:
|
||||
- hasDocuments:
|
||||
count: 0
|
||||
|
||||
- it: should render a TCPRoute defaulting to the SSH service
|
||||
- it: "Render a TCPRoute defaulting to the SSH Service"
|
||||
set:
|
||||
gatewayAPI:
|
||||
enabled: true
|
||||
@@ -67,7 +67,7 @@ tests:
|
||||
path: spec.rules[0].backendRefs[0].weight
|
||||
value: 1
|
||||
|
||||
- it: should fail when parentRefs missing
|
||||
- it: "Fail when the parentRefs are missing"
|
||||
set:
|
||||
gatewayAPI:
|
||||
enabled: true
|
||||
|
||||
+2
-2
@@ -1,11 +1,11 @@
|
||||
suite: GPG secret template (signing disabled)
|
||||
suite: Test gpg secret with signing disabled
|
||||
release:
|
||||
name: gitea-unittests
|
||||
namespace: testing
|
||||
templates:
|
||||
- templates/secret_gpg.yaml
|
||||
tests:
|
||||
- it: renders nothing
|
||||
- it: "Skip rendering when signing is disabled"
|
||||
set:
|
||||
secrets.gpg.enabled: false
|
||||
asserts:
|
||||
+4
-4
@@ -1,17 +1,17 @@
|
||||
suite: GPG secret template (signing enabled)
|
||||
suite: Test gpg secret with signing enabled
|
||||
release:
|
||||
name: gitea-unittests
|
||||
namespace: testing
|
||||
templates:
|
||||
- templates/secret_gpg.yaml
|
||||
tests:
|
||||
- it: fails rendering when nothing is configured
|
||||
- it: "Fail when no gpg key is configured"
|
||||
set:
|
||||
secrets.gpg.enabled: true
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorMessage: Either specify `secrets.gpg.new.privateKey` or reference an existing Secret via `secrets.gpg.existingSecret`
|
||||
- it: skips rendering using external secret reference
|
||||
- it: "Skip rendering when an existing Secret is referenced"
|
||||
set:
|
||||
secrets.gpg.enabled: true
|
||||
secrets.gpg.existingSecret.enabled: true
|
||||
@@ -19,7 +19,7 @@ tests:
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 0
|
||||
- it: renders secret specification using inline gpg key
|
||||
- it: "Render the Secret with an inline gpg key"
|
||||
set:
|
||||
secrets.gpg.enabled: true
|
||||
secrets.gpg.new.privateKey: "gpg-key-placeholder"
|
||||
@@ -3,7 +3,7 @@ chart:
|
||||
release:
|
||||
name: gitea-unittests
|
||||
namespace: testing
|
||||
suite: Test ingress.yaml
|
||||
suite: Test ingress
|
||||
templates:
|
||||
- templates/ingress.yaml
|
||||
tests:
|
||||
@@ -90,6 +90,18 @@ tests:
|
||||
- git.example.com
|
||||
secretName: tls-secret
|
||||
|
||||
- it: Render ingress with a custom ingressClassName
|
||||
set:
|
||||
ingress.enabled: true
|
||||
ingress.ingressClassName: traefik
|
||||
service.http.enabled: true
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 1
|
||||
- equal:
|
||||
path: spec.ingressClassName
|
||||
value: traefik
|
||||
|
||||
- it: Render ingress with custom HTTP service spec
|
||||
set:
|
||||
ingress.enabled: true
|
||||
@@ -0,0 +1,100 @@
|
||||
chart:
|
||||
appVersion: 1.27.3
|
||||
release:
|
||||
name: gitea-unittests
|
||||
namespace: testing
|
||||
suite: Test ingress
|
||||
templates:
|
||||
- templates/ingress.yaml
|
||||
tests:
|
||||
- it: Render ingress ingressClassName with paramater injection
|
||||
set:
|
||||
ingress.enabled: true
|
||||
service.http.enabled: true
|
||||
global.ingress.class: "my-ingress-class"
|
||||
ingress.ingressClassName: "{{ .Values.global.ingress.class }}"
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 1
|
||||
- containsDocument:
|
||||
kind: Ingress
|
||||
apiVersion: networking.k8s.io/v1
|
||||
name: gitea-unittests
|
||||
namespace: testing
|
||||
- notExists:
|
||||
path: metadata.annotations
|
||||
- isSubset:
|
||||
path: metadata.labels
|
||||
content:
|
||||
app: gitea
|
||||
app.kubernetes.io/instance: gitea-unittests
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/name: gitea
|
||||
app.kubernetes.io/version: 1.27.3
|
||||
helm.sh/chart: gitea-0.0.0
|
||||
version: 1.27.3
|
||||
- equal:
|
||||
path: spec.ingressClassName
|
||||
value: my-ingress-class
|
||||
- contains:
|
||||
path: spec.rules
|
||||
content:
|
||||
host: git.example.com
|
||||
http:
|
||||
paths:
|
||||
- backend:
|
||||
service:
|
||||
name: gitea-unittests-http
|
||||
port:
|
||||
number: 3000
|
||||
path: /
|
||||
pathType: Prefix
|
||||
|
||||
- it: Render ingress annotations with paramater injection
|
||||
set:
|
||||
global.ingress.class: "my-ingress-class"
|
||||
global.certificate.issuer: "my-issuer"
|
||||
ingress.enabled: true
|
||||
service.http.enabled: true
|
||||
ingress.ingressClassName: "{{ .Values.global.ingress.class }}"
|
||||
ingress.annotations:
|
||||
cert-manager.io/issuer: "{{ .Values.global.certificate.issuer }}"
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 1
|
||||
- containsDocument:
|
||||
kind: Ingress
|
||||
apiVersion: networking.k8s.io/v1
|
||||
name: gitea-unittests
|
||||
namespace: testing
|
||||
- exists:
|
||||
path: metadata.annotations
|
||||
- equal:
|
||||
path: "metadata.annotations['cert-manager.io/issuer']"
|
||||
value: "my-issuer"
|
||||
- isSubset:
|
||||
path: metadata.labels
|
||||
content:
|
||||
app: gitea
|
||||
app.kubernetes.io/instance: gitea-unittests
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/name: gitea
|
||||
app.kubernetes.io/version: 1.27.3
|
||||
helm.sh/chart: gitea-0.0.0
|
||||
version: 1.27.3
|
||||
- equal:
|
||||
path: spec.ingressClassName
|
||||
value: my-ingress-class
|
||||
- contains:
|
||||
path: spec.rules
|
||||
content:
|
||||
host: git.example.com
|
||||
http:
|
||||
paths:
|
||||
- backend:
|
||||
service:
|
||||
name: gitea-unittests-http
|
||||
port:
|
||||
number: 3000
|
||||
path: /
|
||||
pathType: Prefix
|
||||
@@ -1,11 +1,11 @@
|
||||
suite: Init template (basic)
|
||||
suite: Test init secret basics
|
||||
release:
|
||||
name: gitea-unittests
|
||||
namespace: testing
|
||||
templates:
|
||||
- templates/secret_init.yaml
|
||||
tests:
|
||||
- it: renders a secret
|
||||
- it: "Render the Secret"
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 1
|
||||
+18
-7
@@ -1,11 +1,11 @@
|
||||
suite: Init template
|
||||
suite: Test init directory structure script
|
||||
release:
|
||||
name: gitea-unittests
|
||||
namespace: testing
|
||||
templates:
|
||||
- templates/secret_init.yaml
|
||||
tests:
|
||||
- it: runs gpg in batch mode
|
||||
- it: "Run gpg in batch mode"
|
||||
set:
|
||||
deployment.gitea.image.rootless: false
|
||||
secrets.gpg.enabled: true
|
||||
@@ -15,18 +15,20 @@ tests:
|
||||
-----END PGP PRIVATE KEY BLOCK-----
|
||||
asserts:
|
||||
- equal:
|
||||
path: stringData["configure_gpg_environment.sh"]
|
||||
path: data["configure_gpg_environment.sh"]
|
||||
decodeBase64: true
|
||||
value: |
|
||||
#!/usr/bin/env bash
|
||||
set -eu
|
||||
|
||||
gpg --batch --import "$TMP_RAW_GPG_KEY"
|
||||
- it: skips gpg script block for disabled signing
|
||||
- it: "Skip the gpg script block when signing is disabled"
|
||||
set:
|
||||
deployment.gitea.image.rootless: false
|
||||
asserts:
|
||||
- equal:
|
||||
path: stringData["init_directory_structure.sh"]
|
||||
path: data["init_directory_structure.sh"]
|
||||
decodeBase64: true
|
||||
value: |-
|
||||
#!/usr/bin/env bash
|
||||
|
||||
@@ -40,7 +42,7 @@ tests:
|
||||
mkdir -pv "${GITEA_TEMP}"
|
||||
chown -v 1000:1000 "${GITEA_TEMP}"
|
||||
chmod -v ug+rwx "${GITEA_TEMP}"
|
||||
- it: adds gpg script block for enabled signing
|
||||
- it: "Add the gpg script block when signing is enabled"
|
||||
set:
|
||||
deployment.gitea.image.rootless: false
|
||||
secrets.gpg.enabled: true
|
||||
@@ -50,7 +52,8 @@ tests:
|
||||
-----END PGP PRIVATE KEY BLOCK-----
|
||||
asserts:
|
||||
- equal:
|
||||
path: stringData["init_directory_structure.sh"]
|
||||
path: data["init_directory_structure.sh"]
|
||||
decodeBase64: true
|
||||
value: |-
|
||||
#!/usr/bin/env bash
|
||||
|
||||
@@ -70,3 +73,11 @@ tests:
|
||||
chmod -v 700 "${GNUPGHOME}"
|
||||
chown -v 1000:1000 "${GNUPGHOME}"
|
||||
fi
|
||||
- it: "Render data instead of stringData so removed keys are pruned on upgrade"
|
||||
set:
|
||||
deployment.gitea.image.rootless: false
|
||||
asserts:
|
||||
- notExists:
|
||||
path: stringData
|
||||
- exists:
|
||||
path: data["init_directory_structure.sh"]
|
||||
+19
-9
@@ -1,11 +1,11 @@
|
||||
suite: Init template
|
||||
suite: Test init directory structure script for the rootless image
|
||||
release:
|
||||
name: gitea-unittests
|
||||
namespace: testing
|
||||
templates:
|
||||
- templates/secret_init.yaml
|
||||
tests:
|
||||
- it: runs gpg in batch mode
|
||||
- it: "Run gpg in batch mode"
|
||||
set:
|
||||
secrets.gpg.enabled: true
|
||||
secrets.gpg.new.privateKey: |-
|
||||
@@ -14,16 +14,18 @@ tests:
|
||||
-----END PGP PRIVATE KEY BLOCK-----
|
||||
asserts:
|
||||
- equal:
|
||||
path: stringData["configure_gpg_environment.sh"]
|
||||
path: data["configure_gpg_environment.sh"]
|
||||
decodeBase64: true
|
||||
value: |
|
||||
#!/usr/bin/env bash
|
||||
set -eu
|
||||
|
||||
gpg --batch --import "$TMP_RAW_GPG_KEY"
|
||||
- it: skips gpg script block for disabled signing
|
||||
- it: "Skip the gpg script block when signing is disabled"
|
||||
asserts:
|
||||
- equal:
|
||||
path: stringData["init_directory_structure.sh"]
|
||||
path: data["init_directory_structure.sh"]
|
||||
decodeBase64: true
|
||||
value: |-
|
||||
#!/usr/bin/env bash
|
||||
|
||||
@@ -35,7 +37,7 @@ tests:
|
||||
# prepare temp directory structure
|
||||
mkdir -pv "${GITEA_TEMP}"
|
||||
chmod -v ug+rwx "${GITEA_TEMP}"
|
||||
- it: adds gpg script block for enabled signing
|
||||
- it: "Add the gpg script block when signing is enabled"
|
||||
set:
|
||||
secrets.gpg.enabled: true
|
||||
secrets.gpg.new.privateKey: |-
|
||||
@@ -44,7 +46,8 @@ tests:
|
||||
-----END PGP PRIVATE KEY BLOCK-----
|
||||
asserts:
|
||||
- equal:
|
||||
path: stringData["init_directory_structure.sh"]
|
||||
path: data["init_directory_structure.sh"]
|
||||
decodeBase64: true
|
||||
value: |-
|
||||
#!/usr/bin/env bash
|
||||
|
||||
@@ -62,13 +65,14 @@ tests:
|
||||
chmod -v 700 "${GNUPGHOME}"
|
||||
chown -v 1000:1000 "${GNUPGHOME}"
|
||||
fi
|
||||
- it: it does not chown /data even when image.fullOverride is set
|
||||
- it: "Skip the chown of /data even when image.fullOverride is set"
|
||||
template: templates/secret_init.yaml
|
||||
set:
|
||||
deployment.gitea.image.fullOverride: docker.gitea.com/gitea:1.20.5
|
||||
asserts:
|
||||
- equal:
|
||||
path: stringData["init_directory_structure.sh"]
|
||||
path: data["init_directory_structure.sh"]
|
||||
decodeBase64: true
|
||||
value: |-
|
||||
#!/usr/bin/env bash
|
||||
|
||||
@@ -80,3 +84,9 @@ tests:
|
||||
# prepare temp directory structure
|
||||
mkdir -pv "${GITEA_TEMP}"
|
||||
chmod -v ug+rwx "${GITEA_TEMP}"
|
||||
- it: "Render data instead of stringData so removed keys are pruned on upgrade"
|
||||
asserts:
|
||||
- notExists:
|
||||
path: stringData
|
||||
- exists:
|
||||
path: data["init_directory_structure.sh"]
|
||||
+3
-3
@@ -1,11 +1,11 @@
|
||||
suite: Metrics secret template (monitoring disabled)
|
||||
suite: Test metrics secret with monitoring disabled
|
||||
release:
|
||||
name: gitea-unittests
|
||||
namespace: testing
|
||||
templates:
|
||||
- templates/secret_metrics.yaml
|
||||
tests:
|
||||
- it: renders nothing if monitoring disabled and gitea.metrics.token empty
|
||||
- it: "Skip rendering when monitoring is disabled and gitea.metrics.token is empty"
|
||||
set:
|
||||
gitea.metrics.enabled: false
|
||||
gitea.metrics.serviceMonitor.enabled: false
|
||||
@@ -13,7 +13,7 @@ tests:
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 0
|
||||
- it: renders nothing if monitoring disabled and gitea.metrics.token not empty
|
||||
- it: "Skip rendering when monitoring is disabled and gitea.metrics.token is not empty"
|
||||
set:
|
||||
gitea.metrics.enabled: false
|
||||
gitea.metrics.serviceMonitor.enabled: false
|
||||
+3
-3
@@ -1,11 +1,11 @@
|
||||
suite: Metrics secret template (monitoring enabled)
|
||||
suite: Test metrics secret with monitoring enabled
|
||||
release:
|
||||
name: gitea-unittests
|
||||
namespace: testing
|
||||
templates:
|
||||
- templates/secret_metrics.yaml
|
||||
tests:
|
||||
- it: renders nothing if monitoring enabled and gitea.metrics.token empty
|
||||
- it: "Skip rendering when monitoring is enabled and gitea.metrics.token is empty"
|
||||
set:
|
||||
gitea.metrics.enabled: true
|
||||
gitea.metrics.serviceMonitor.enabled: true
|
||||
@@ -13,7 +13,7 @@ tests:
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 0
|
||||
- it: renders Secret if monitoring enabled and gitea.metrics.token not empty
|
||||
- it: "Render the Secret when monitoring is enabled and gitea.metrics.token is not empty"
|
||||
set:
|
||||
gitea.metrics.enabled: true
|
||||
gitea.metrics.serviceMonitor.enabled: true
|
||||
+1
-1
@@ -3,7 +3,7 @@ chart:
|
||||
release:
|
||||
name: gitea-unittests
|
||||
namespace: testing
|
||||
suite: PVC template
|
||||
suite: Test persistentVolumeClaim
|
||||
templates:
|
||||
- templates/persistentVolumeClaim.yaml
|
||||
tests:
|
||||
+2
-2
@@ -3,11 +3,11 @@ chart:
|
||||
release:
|
||||
name: gitea-unittests
|
||||
namespace: testing
|
||||
suite: Storage class configuration tests
|
||||
suite: Test persistentVolumeClaim storage class
|
||||
templates:
|
||||
- templates/persistentVolumeClaim.yaml
|
||||
tests:
|
||||
- it: Set storageClassName when persistence.new.storageClassName is defined
|
||||
- it: "Render the storageClassName when persistence.new.storageClassName is defined"
|
||||
set:
|
||||
persistence.enabled: true
|
||||
persistence.new.storageClassName: my-storage-class
|
||||
@@ -1,11 +1,11 @@
|
||||
suite: Test route.yaml
|
||||
suite: Test route
|
||||
release:
|
||||
name: gitea-unittests
|
||||
namespace: testing
|
||||
templates:
|
||||
- templates/route.yaml
|
||||
tests:
|
||||
- it: should create route when route.enabled is true
|
||||
- it: "Render the Route when route.enabled is true"
|
||||
set:
|
||||
route:
|
||||
enabled: true
|
||||
@@ -50,7 +50,7 @@ tests:
|
||||
path: spec.tls.insecureEdgeTerminationPolicy
|
||||
value: Redirect
|
||||
|
||||
- it: should not create route when route.enabled is false
|
||||
- it: "Skip rendering when route.enabled is false"
|
||||
set:
|
||||
route.enabled: false
|
||||
asserts:
|
||||
+9
-9
@@ -1,4 +1,4 @@
|
||||
suite: sshService / httpService template (Services configuration)
|
||||
suite: Test httpService and sshService configuration
|
||||
release:
|
||||
name: gitea-unittests
|
||||
namespace: testing
|
||||
@@ -6,7 +6,7 @@ templates:
|
||||
- templates/service_ssh.yaml
|
||||
- templates/service_http.yaml
|
||||
tests:
|
||||
- it: supports adding custom labels to sshService
|
||||
- it: "Add custom labels to the SSH Service"
|
||||
template: templates/service_ssh.yaml
|
||||
set:
|
||||
service:
|
||||
@@ -18,7 +18,7 @@ tests:
|
||||
path: metadata.labels["gitea/testkey"]
|
||||
value: "testvalue"
|
||||
|
||||
- it: keeps existing labels (ssh)
|
||||
- it: "Keep the existing labels of the SSH Service"
|
||||
template: templates/service_ssh.yaml
|
||||
set:
|
||||
service:
|
||||
@@ -28,7 +28,7 @@ tests:
|
||||
- exists:
|
||||
path: metadata.labels["app"]
|
||||
|
||||
- it: supports adding custom labels to httpService
|
||||
- it: "Add custom labels to the HTTP Service"
|
||||
template: templates/service_http.yaml
|
||||
set:
|
||||
service:
|
||||
@@ -40,7 +40,7 @@ tests:
|
||||
path: metadata.labels["gitea/testkey"]
|
||||
value: "testvalue"
|
||||
|
||||
- it: keeps existing labels (http)
|
||||
- it: "Keep the existing labels of the HTTP Service"
|
||||
template: templates/service_http.yaml
|
||||
set:
|
||||
service:
|
||||
@@ -50,7 +50,7 @@ tests:
|
||||
- exists:
|
||||
path: metadata.labels["app"]
|
||||
|
||||
- it: render service.ssh.loadBalancerClass if set and type is LoadBalancer
|
||||
- it: "Render service.ssh.loadBalancerClass when the type is LoadBalancer"
|
||||
template: templates/service_ssh.yaml
|
||||
set:
|
||||
service:
|
||||
@@ -72,7 +72,7 @@ tests:
|
||||
path: spec.loadBalancerSourceRanges
|
||||
value: ["1.2.3.4/32", "5.6.7.8/32"]
|
||||
|
||||
- it: does not render when loadbalancer properties are set but type is not loadBalancerClass
|
||||
- it: "Skip the loadBalancer properties when the type is not LoadBalancer"
|
||||
template: templates/service_http.yaml
|
||||
set:
|
||||
service:
|
||||
@@ -91,7 +91,7 @@ tests:
|
||||
- notExists:
|
||||
path: spec.loadBalancerSourceRanges
|
||||
|
||||
- it: does not render loadBalancerClass by default even when type is LoadBalancer
|
||||
- it: "Skip loadBalancerClass by default even when the type is LoadBalancer"
|
||||
template: templates/service_http.yaml
|
||||
set:
|
||||
service:
|
||||
@@ -105,7 +105,7 @@ tests:
|
||||
path: spec.loadBalancerIP
|
||||
value: "1.2.3.4"
|
||||
|
||||
- it: both ssh and http services exist
|
||||
- it: "Render both the SSH and the HTTP Service"
|
||||
templates:
|
||||
- templates/service_ssh.yaml
|
||||
- templates/service_http.yaml
|
||||
+1
-1
@@ -3,7 +3,7 @@ chart:
|
||||
release:
|
||||
name: gitea-unittests
|
||||
namespace: testing
|
||||
suite: ServiceAccount template
|
||||
suite: Test serviceAccount
|
||||
templates:
|
||||
- templates/serviceAccount.yaml
|
||||
tests:
|
||||
+7
-7
@@ -1,27 +1,27 @@
|
||||
suite: ServiceMonitor template (basic)
|
||||
suite: Test serviceMonitor basics
|
||||
release:
|
||||
name: gitea-unittests
|
||||
namespace: testing
|
||||
templates:
|
||||
- templates/serviceMonitor.yaml
|
||||
tests:
|
||||
- it: skips rendering by default
|
||||
- it: "Skip rendering by default"
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 0
|
||||
- it: renders default ServiceMonitor object with gitea.metrics.enabled=true
|
||||
- it: "Render the ServiceMonitor when gitea.metrics.enabled is true"
|
||||
set:
|
||||
gitea.metrics.enabled: true
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 0
|
||||
- it: renders default ServiceMonitor object with gitea.metrics.serviceMonitor.enabled=true
|
||||
- it: "Render the ServiceMonitor when gitea.metrics.serviceMonitor.enabled is true"
|
||||
set:
|
||||
gitea.metrics.serviceMonitor.enabled: true
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 0
|
||||
- it: renders defaults
|
||||
- it: "Render the default ServiceMonitor spec"
|
||||
set:
|
||||
gitea.metrics.enabled: true
|
||||
gitea.metrics.serviceMonitor.enabled: true
|
||||
@@ -45,7 +45,7 @@ tests:
|
||||
path: spec.endpoints[0].scrapeTimeout
|
||||
- notExists:
|
||||
path: spec.endpoints[0].tlsConfig
|
||||
- it: renders custom scrape interval
|
||||
- it: "Render a custom scrape interval"
|
||||
set:
|
||||
gitea.metrics.enabled: true
|
||||
gitea.metrics.serviceMonitor.enabled: true
|
||||
@@ -58,7 +58,7 @@ tests:
|
||||
- equal:
|
||||
path: spec.endpoints[0].scrapeTimeout
|
||||
value: 5s
|
||||
- it: renders custom tls config
|
||||
- it: "Render a custom tls config"
|
||||
set:
|
||||
gitea.metrics.enabled: true
|
||||
gitea.metrics.serviceMonitor.enabled: true
|
||||
+3
-3
@@ -1,11 +1,11 @@
|
||||
suite: ServiceMonitor template (monitoring disabled)
|
||||
suite: Test serviceMonitor with monitoring disabled
|
||||
release:
|
||||
name: gitea-unittests
|
||||
namespace: testing
|
||||
templates:
|
||||
- templates/serviceMonitor.yaml
|
||||
tests:
|
||||
- it: renders nothing if gitea.metrics.serviceMonitor disabled and gitea.metrics.token empty
|
||||
- it: "Skip rendering when the ServiceMonitor is disabled and gitea.metrics.token is empty"
|
||||
set:
|
||||
gitea.metrics.enabled: false
|
||||
gitea.metrics.token: ""
|
||||
@@ -13,7 +13,7 @@ tests:
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 0
|
||||
- it: renders nothing if gitea.metrics.serviceMonitor disabled and gitea.metrics.token not empty
|
||||
- it: "Skip rendering when the ServiceMonitor is disabled and gitea.metrics.token is not empty"
|
||||
set:
|
||||
gitea.metrics.enabled: false
|
||||
gitea.metrics.token: "test-token"
|
||||
+4
-4
@@ -1,11 +1,11 @@
|
||||
suite: ServiceMonitor template (monitoring enabled)
|
||||
suite: Test serviceMonitor with monitoring enabled
|
||||
release:
|
||||
name: gitea-unittests
|
||||
namespace: testing
|
||||
templates:
|
||||
- templates/serviceMonitor.yaml
|
||||
tests:
|
||||
- it: renders unsecure ServiceMonitor if gitea.metrics.token nil
|
||||
- it: "Render an unsecured ServiceMonitor when gitea.metrics.token is nil"
|
||||
set:
|
||||
gitea.metrics.enabled: true
|
||||
gitea.metrics.token:
|
||||
@@ -24,7 +24,7 @@ tests:
|
||||
path: spec.endpoints
|
||||
value:
|
||||
- port: http
|
||||
- it: renders unsecure ServiceMonitor if gitea.metrics.token empty
|
||||
- it: "Render an unsecured ServiceMonitor when gitea.metrics.token is empty"
|
||||
set:
|
||||
gitea.metrics.enabled: true
|
||||
gitea.metrics.token: ""
|
||||
@@ -43,7 +43,7 @@ tests:
|
||||
path: spec.endpoints
|
||||
value:
|
||||
- port: http
|
||||
- it: renders secure ServiceMonitor if gitea.metrics.token not empty
|
||||
- it: "Render a secured ServiceMonitor when gitea.metrics.token is not empty"
|
||||
set:
|
||||
gitea.metrics.enabled: true
|
||||
gitea.metrics.token: "test-token"
|
||||
@@ -1,34 +0,0 @@
|
||||
suite: test connection template
|
||||
release:
|
||||
name: gitea-unittests
|
||||
namespace: testing
|
||||
templates:
|
||||
- templates/tests/test-http-connection.yaml
|
||||
tests:
|
||||
- it: renders openshift-compatible defaults for the test pod
|
||||
set:
|
||||
openshift.enabled: true
|
||||
asserts:
|
||||
- notExists:
|
||||
path: spec.hostUsers
|
||||
- equal:
|
||||
path: spec.containers[0].securityContext
|
||||
value:
|
||||
allowPrivilegeEscalation: false
|
||||
capabilities:
|
||||
drop:
|
||||
- ALL
|
||||
runAsNonRoot: true
|
||||
seccompProfile:
|
||||
type: RuntimeDefault
|
||||
|
||||
- it: renders an explicit hostUsers=false override for the test pod
|
||||
set:
|
||||
openshift:
|
||||
enabled: true
|
||||
deployment:
|
||||
hostUsers: false
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.hostUsers
|
||||
value: false
|
||||
+91
-136
@@ -97,12 +97,12 @@ deployment:
|
||||
# - name: ""
|
||||
# request: ""
|
||||
# limits:
|
||||
# ephemeral: 100Mi
|
||||
# cpu: 100m
|
||||
# ephemeral: 100Mi
|
||||
# memory: 128Mi
|
||||
# requests:
|
||||
# ephemeral: 100Mi
|
||||
# cpu: 100m
|
||||
# ephemeral: 100m
|
||||
# memory: 128Mi
|
||||
|
||||
## @param deployment.gitea.securityContext Security context of the Gitea container. Used as fallback for the chart-managed init containers.
|
||||
@@ -220,6 +220,10 @@ deployment:
|
||||
# readOnly: true
|
||||
|
||||
initAppIni:
|
||||
## @param deployment.initAppIni.config.rebuild Rebuild app.ini on startup, preserving Gitea secret keys but removing unmanaged settings.
|
||||
config:
|
||||
rebuild: false
|
||||
|
||||
## @param deployment.initAppIni.env Additional environment variables to pass to the init container.
|
||||
env: []
|
||||
# - name: VARIABLE
|
||||
@@ -587,7 +591,7 @@ gatewayAPI:
|
||||
## @param ingress.enabled Enable ingress.
|
||||
## @param ingress.annotations Additional annotations.
|
||||
## @param ingress.labels Additional labels.
|
||||
## @param ingress.className DEPRECATED: Ingress class name.
|
||||
## @param ingress.ingressClassName Name of the IngressClass which backs the Ingress.
|
||||
## @param ingress.pathType Ingress Path Type.
|
||||
## @param ingress.hosts[0].host Default Ingress host.
|
||||
## @param ingress.hosts[0].paths[0].path Default Ingress path.
|
||||
@@ -596,7 +600,7 @@ ingress:
|
||||
enabled: false
|
||||
annotations: {}
|
||||
labels: {}
|
||||
className: "nginx"
|
||||
ingressClassName: "nginx"
|
||||
pathType: Prefix
|
||||
hosts:
|
||||
- host: git.example.com
|
||||
@@ -924,23 +928,6 @@ extraContainers: []
|
||||
# image: busybox
|
||||
# command: [/bin/sh, -c, 'echo "Hello world"']
|
||||
|
||||
## @deprecated The preExtraInitContainers and postExtraInitContainers variables have been replaced by
|
||||
## deployment.initContainers. Add an entry with a `container` key before or after the linked
|
||||
## chart-managed init containers to achieve the same result.
|
||||
|
||||
## @param extraInitVolumeMounts Mounts that are only mapped into the init-containers. Can be used for additional preconfiguration.
|
||||
extraInitVolumeMounts: []
|
||||
|
||||
## @deprecated The extraVolumeMounts variable has been split two:
|
||||
## - deployment.gitea.volumeMounts
|
||||
## - extraInitVolumeMounts
|
||||
## As an example, can be used to mount a client cert when connecting to an external Postgres server.
|
||||
## @param extraVolumeMounts **DEPRECATED** Additional volume mounts for init containers and the Gitea main container.
|
||||
extraVolumeMounts: []
|
||||
# - name: postgres-ssl-vol
|
||||
# readOnly: true
|
||||
# mountPath: "/pg-ssl"
|
||||
|
||||
## @section Init
|
||||
## @param initPreScript Bash shell script copied verbatim to the start of the init-container.
|
||||
initPreScript: ""
|
||||
@@ -1129,6 +1116,89 @@ gitea:
|
||||
successThreshold: 1
|
||||
failureThreshold: 10
|
||||
|
||||
## @section CloudNativePG
|
||||
# The CloudNativePG operator itself is not part of this chart. It must be installed cluster-wide beforehand:
|
||||
# https://cloudnative-pg.io/documentation/current/installation_upgrade/
|
||||
cloudnativePG:
|
||||
## @param cloudnativePG.enabled Provision a CloudNativePG `Cluster` for Gitea. Requires the CloudNativePG operator to be installed in the cluster.
|
||||
enabled: false
|
||||
|
||||
## @param cloudnativePG.annotations Annotations for the CloudNativePG `Cluster`.
|
||||
## @param cloudnativePG.labels Additional labels for the CloudNativePG `Cluster`.
|
||||
annotations: {}
|
||||
labels: {}
|
||||
|
||||
## @param cloudnativePG.image.registry Image registry.
|
||||
## @param cloudnativePG.image.repository Image repository.
|
||||
## @param cloudnativePG.image.tag Image tag.
|
||||
image:
|
||||
registry: ghcr.io
|
||||
repository: cloudnative-pg/postgresql
|
||||
tag: "18.0"
|
||||
|
||||
## @param cloudnativePG.instances Number of PostgreSQL instances. Values greater than `1` provision a HA-ready cluster with streaming replication.
|
||||
instances: 3
|
||||
|
||||
credentials:
|
||||
## @param cloudnativePG.credentials.addSHASumAnnotation Add a pod annotation with the SHA sum of the credentials Secret to trigger a rollout on change. Further information can be found in the [documentation](./README.md#secret-checksum-annotation).
|
||||
addSHASumAnnotation: false
|
||||
|
||||
## @param cloudnativePG.credentials.database Name of the database to create. CloudNativePG requires it as a literal in the `Cluster`, hence it cannot be sourced from a Secret.
|
||||
## @param cloudnativePG.credentials.username Name of the database owner to create. CloudNativePG requires it as a literal in the `Cluster`, hence it cannot be sourced from a Secret.
|
||||
database: gitea
|
||||
username: gitea
|
||||
|
||||
## @param cloudnativePG.credentials.existingSecret.enabled Use an already existing Secret instead of creating the credentials Secret.
|
||||
## @param cloudnativePG.credentials.existingSecret.secretName Name of the already existing credentials Secret. Must be of type `kubernetes.io/basic-auth` and its `username` must match `cloudnativePG.credentials.username`.
|
||||
## @param cloudnativePG.credentials.existingSecret.passwordKey Key of the password in the existing credentials Secret.
|
||||
existingSecret:
|
||||
enabled: false
|
||||
secretName: ""
|
||||
passwordKey: password
|
||||
|
||||
## @param cloudnativePG.credentials.new.annotations Annotations for the credentials Secret.
|
||||
## @param cloudnativePG.credentials.new.labels Labels for the credentials Secret.
|
||||
## @param cloudnativePG.credentials.new.password Password of the database owner.
|
||||
new:
|
||||
annotations: {}
|
||||
labels: {}
|
||||
password: gitea
|
||||
|
||||
## @param cloudnativePG.postgresql.parameters Custom PostgreSQL configuration parameters.
|
||||
postgresql:
|
||||
parameters: {}
|
||||
|
||||
## @param cloudnativePG.storage.size Size of the data volume.
|
||||
## @param cloudnativePG.storage.storageClass Storage class of the data volume. Defaults to the cluster's default storage class.
|
||||
storage:
|
||||
size: 10Gi
|
||||
storageClass: ""
|
||||
|
||||
## @param cloudnativePG.walStorage.enabled Store the write-ahead log on a dedicated volume.
|
||||
## @param cloudnativePG.walStorage.size Size of the write-ahead log volume.
|
||||
## @param cloudnativePG.walStorage.storageClass Storage class of the write-ahead log volume. Defaults to the cluster's default storage class.
|
||||
walStorage:
|
||||
enabled: false
|
||||
size: 2Gi
|
||||
storageClass: ""
|
||||
|
||||
## @param cloudnativePG.affinity Affinity for the PostgreSQL pods. CloudNativePG nests `nodeSelector` and `tolerations` below this key as well.
|
||||
affinity: {}
|
||||
|
||||
## @param cloudnativePG.priorityClassName Priority class name for the PostgreSQL pods.
|
||||
priorityClassName: ""
|
||||
|
||||
## @param cloudnativePG.monitoring.enablePodMonitor Create a `PodMonitor` for the CloudNativePG `Cluster`.
|
||||
monitoring:
|
||||
enablePodMonitor: false
|
||||
|
||||
## @param cloudnativePG.resources Kubernetes resources for the PostgreSQL containers.
|
||||
resources: {}
|
||||
|
||||
## @param cloudnativePG.topologySpreadConstraints Topology spread constraints for the PostgreSQL pods.
|
||||
topologySpreadConstraints: []
|
||||
|
||||
|
||||
## @section valkey
|
||||
valkey:
|
||||
## @param valkey.enabled Enable valkey standalone or replicated.
|
||||
@@ -1187,127 +1257,12 @@ valkey:
|
||||
repository: oliver006/redis_exporter
|
||||
tag: ""
|
||||
|
||||
## @section PostgreSQL HA
|
||||
postgresql-ha:
|
||||
## @param postgresql-ha.enabled Enable PostgreSQL HA.
|
||||
enabled: true
|
||||
|
||||
## @param postgresql-ha.global.postgresql.database Name for a custom database to create (overrides `auth.database`).
|
||||
## @param postgresql-ha.global.postgresql.username Name for a custom user to create (overrides `auth.username`).
|
||||
## @param postgresql-ha.global.postgresql.password Name for a custom password to create (overrides `auth.password`).
|
||||
global:
|
||||
postgresql:
|
||||
database: gitea
|
||||
password: gitea
|
||||
username: gitea
|
||||
|
||||
## @param postgresql-ha.metrics.image.repository Image repository, eg. `bitnamilegacy/postgres-exporter`.
|
||||
metrics:
|
||||
image:
|
||||
repository: bitnamilegacy/postgres-exporter
|
||||
|
||||
## @param postgresql-ha.postgresql.image.repository Image repository, eg. `bitnamilegacy/postgresql-repmgr`.
|
||||
## @param postgresql-ha.postgresql.repmgrPassword Repmgr Password.
|
||||
## @param postgresql-ha.postgresql.postgresPassword postgres Password.
|
||||
## @param postgresql-ha.postgresql.password Password for the `gitea` user (overrides `auth.password`).
|
||||
postgresql:
|
||||
image:
|
||||
repository: bitnamilegacy/postgresql-repmgr
|
||||
repmgrPassword: changeme2
|
||||
postgresPassword: changeme1
|
||||
password: changeme4
|
||||
|
||||
## @param postgresql-ha.pgpool.adminPassword pgpool adminPassword.
|
||||
## @param postgresql-ha.pgpool.image.repository Image repository, eg. `bitnamilegacy/pgpool`.
|
||||
## @param postgresql-ha.pgpool.srCheckPassword pgpool srCheckPassword.
|
||||
pgpool:
|
||||
adminPassword: changeme3
|
||||
image:
|
||||
repository: bitnamilegacy/pgpool
|
||||
srCheckPassword: changeme4
|
||||
|
||||
## @param postgresql-ha.service.ports.postgresql PostgreSQL service port (overrides `service.ports.postgresql`).
|
||||
service:
|
||||
ports:
|
||||
postgresql: 5432
|
||||
|
||||
## @param postgresql-ha.persistence.enabled Enable persistence.
|
||||
## @param postgresql-ha.persistence.storageClass Persistent Volume Storage Class.
|
||||
## @param postgresql-ha.persistence.size PVC Storage Request for PostgreSQL HA volume.
|
||||
persistence:
|
||||
enabled: true
|
||||
storageClass: ""
|
||||
size: 10Gi
|
||||
|
||||
## @param postgresql-ha.volumePermissions.image.repository Image repository, eg. `bitnamilegacy/os-shell`.
|
||||
volumePermissions:
|
||||
image:
|
||||
repository: bitnamilegacy/os-shell
|
||||
|
||||
## @section PostgreSQL
|
||||
postgresql:
|
||||
## @param postgresql.enabled Enable PostgreSQL.
|
||||
enabled: false
|
||||
|
||||
## @param postgresql.global.postgresql.auth.password Password for the `gitea` user (overrides `auth.password`).
|
||||
## @param postgresql.global.postgresql.auth.database Name for a custom database to create (overrides `auth.database`).
|
||||
## @param postgresql.global.postgresql.auth.username Name for a custom user to create (overrides `auth.username`).
|
||||
## @param postgresql.global.postgresql.service.ports.postgresql PostgreSQL service port (overrides `service.ports.postgresql`).
|
||||
global:
|
||||
postgresql:
|
||||
auth:
|
||||
password: gitea
|
||||
database: gitea
|
||||
username: gitea
|
||||
service:
|
||||
ports:
|
||||
postgresql: 5432
|
||||
|
||||
## @param postgresql.image.repository Image repository, eg. `bitnamilegacy/postgresql`.
|
||||
image:
|
||||
repository: bitnamilegacy/postgresql
|
||||
|
||||
primary:
|
||||
## @param postgresql.primary.persistence.enabled Enable persistence.
|
||||
## @param postgresql.primary.persistence.storageClass Persistent Volume storage class.
|
||||
## @param postgresql.primary.persistence.size PVC Storage Request for PostgreSQL volume.
|
||||
persistence:
|
||||
enabled: true
|
||||
storageClass: ""
|
||||
size: 10Gi
|
||||
|
||||
readReplicas:
|
||||
## @param postgresql.readReplicas.persistence.enabled Enable PostgreSQL read only data persistence using PVC.
|
||||
## @param postgresql.readReplicas.persistence.storageClass Persistent Volume storage class.
|
||||
## @param postgresql.readReplicas.persistence.size PVC Storage Request for PostgreSQL volume.
|
||||
persistence:
|
||||
enabled: true
|
||||
storageClass: ""
|
||||
size: ""
|
||||
|
||||
## @param postgresql.metrics.image.repository Image repository, eg. `bitnamilegacy/postgres-exporter`.
|
||||
metrics:
|
||||
image:
|
||||
repository: bitnamilegacy/postgres-exporter
|
||||
|
||||
## @param postgresql.volumePermissions.image.repository Image repository, eg. `bitnamilegacy/os-shell`.
|
||||
volumePermissions:
|
||||
image:
|
||||
repository: bitnamilegacy/os-shell
|
||||
|
||||
# By default, removed or moved settings that still remain in a user defined values.yaml will cause Helm to fail running the install/update.
|
||||
# Set it to false to skip this basic validation check.
|
||||
## @section Advanced
|
||||
## @param checkDeprecation Set it to false to skip this basic validation check.
|
||||
## @param test.enabled Set it to false to disable test-connection Pod.
|
||||
## @param test.image.name Image name for the wget container used in the test-connection Pod.
|
||||
## @param test.image.tag Image tag for the wget container used in the test-connection Pod.
|
||||
checkDeprecation: true
|
||||
test:
|
||||
enabled: true
|
||||
image:
|
||||
name: busybox
|
||||
tag: latest
|
||||
|
||||
## @param extraDeploy Array of extra objects to deploy with the release.
|
||||
##
|
||||
|
||||
Reference in new issue
Block a user