3cf91bf6e7
### Description of the change This PR is a continuation of the work done by @dgershman in [534](https://gitea.com/gitea/helm-chart/pulls/534), to allow users to override the image from the default rootless behavior of appending `-rootless` to the end of the image tag. ### Benefits Allows more flexibility to use externally maintained images that are rootless but don't follow the `-rootless` tag convention. ### Applicable issues - fixes #532 ### Additional information No breaking changes. This does not affect the `image.rootless` conditional checks or the current behavior if someone still wants to rely on the chart to append `-rootless`. ### Checklist - [x] Parameters are documented in the `values.yaml` and added to the `README.md` using [readme-generator-for-helm](https://github.com/bitnami-labs/readme-generator-for-helm) - [x] Breaking changes are documented in the `README.md` - [x] Templating unittests are added Co-authored-by: TristanHoladay <40547442+TristanHoladay@users.noreply.github.com> Co-authored-by: pat-s <pat-s@noreply.gitea.com> Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/550 Reviewed-by: justusbunsi <justusbunsi@noreply.gitea.com> Reviewed-by: pat-s <pat-s@noreply.gitea.com> Co-authored-by: TristanHoladay <tristanholaday@noreply.gitea.com> Co-committed-by: TristanHoladay <tristanholaday@noreply.gitea.com>
89 lines
2.5 KiB
YAML
89 lines
2.5 KiB
YAML
suite: Init template
|
|
release:
|
|
name: gitea-unittests
|
|
namespace: testing
|
|
templates:
|
|
- templates/gitea/init.yaml
|
|
tests:
|
|
- it: runs gpg in batch mode
|
|
set:
|
|
signing.enabled: true
|
|
signing.privateKey: |-
|
|
-----BEGIN PGP PRIVATE KEY BLOCK-----
|
|
{placeholder}
|
|
-----END PGP PRIVATE KEY BLOCK-----
|
|
asserts:
|
|
- equal:
|
|
path: stringData["configure_gpg_environment.sh"]
|
|
value: |-
|
|
#!/usr/bin/env bash
|
|
set -eu
|
|
|
|
gpg --batch --import /raw/private.asc
|
|
- it: skips gpg script block for disabled signing
|
|
asserts:
|
|
- equal:
|
|
path: stringData["init_directory_structure.sh"]
|
|
value: |-
|
|
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
|
|
set -x
|
|
mkdir -p /data/git/.ssh
|
|
chmod -R 700 /data/git/.ssh
|
|
[ ! -d /data/gitea/conf ] && mkdir -p /data/gitea/conf
|
|
|
|
# prepare temp directory structure
|
|
mkdir -p "${GITEA_TEMP}"
|
|
chmod ug+rwx "${GITEA_TEMP}"
|
|
- it: adds gpg script block for enabled signing
|
|
set:
|
|
signing.enabled: true
|
|
signing.privateKey: |-
|
|
-----BEGIN PGP PRIVATE KEY BLOCK-----
|
|
{placeholder}
|
|
-----END PGP PRIVATE KEY BLOCK-----
|
|
asserts:
|
|
- equal:
|
|
path: stringData["init_directory_structure.sh"]
|
|
value: |-
|
|
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
|
|
set -x
|
|
mkdir -p /data/git/.ssh
|
|
chmod -R 700 /data/git/.ssh
|
|
[ ! -d /data/gitea/conf ] && mkdir -p /data/gitea/conf
|
|
|
|
# prepare temp directory structure
|
|
mkdir -p "${GITEA_TEMP}"
|
|
chmod ug+rwx "${GITEA_TEMP}"
|
|
|
|
if [ ! -d "${GNUPGHOME}" ]; then
|
|
mkdir -p "${GNUPGHOME}"
|
|
chmod 700 "${GNUPGHOME}"
|
|
chown 1000:1000 "${GNUPGHOME}"
|
|
fi
|
|
- it: it does not chown /data even when image.fullOverride is set
|
|
template: templates/gitea/init.yaml
|
|
set:
|
|
image.fullOverride: gitea/gitea:1.20.5
|
|
asserts:
|
|
- equal:
|
|
path: stringData["init_directory_structure.sh"]
|
|
value: |-
|
|
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
|
|
set -x
|
|
mkdir -p /data/git/.ssh
|
|
chmod -R 700 /data/git/.ssh
|
|
[ ! -d /data/gitea/conf ] && mkdir -p /data/gitea/conf
|
|
|
|
# prepare temp directory structure
|
|
mkdir -p "${GITEA_TEMP}"
|
|
chmod ug+rwx "${GITEA_TEMP}"
|