Do not log errors in init-directories container during Gitea launch (#708)
When the _init-directories_ container runs, the shell script _init_directory_structure.sh_ logs to _stderr_ because debugging is enabled with _set -x_. The output from the script, should be logged to _stdout_ instead. The issue is discussed here: https://gitea.com/gitea/helm-chart/issues/701 ### Description of the change This PR uses the _verbose_ flag with all commands in the script to log what the script is doing. ### Benefits Log entries with incorrect severity _ERROR_ will no longer be logged in _Kubernetes_. ### Possible drawbacks Log output will change. If someone had a check for certain log entries from the _init container_, that check would break. ### Checklist Updated unit tests. Co-authored-by: tobias.petersen <tobias.petersen@unity3d.com> Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/708 Reviewed-by: techknowlogick <techknowlogick@noreply.gitea.com> Reviewed-by: pat-s <pat-s@noreply.gitea.com> Co-authored-by: tobiasbp <tobiasbp@noreply.gitea.com> Co-committed-by: tobiasbp <tobiasbp@noreply.gitea.com>
This commit is contained in:
parent
9dc3f7c086
commit
3fdb39df68
@ -24,27 +24,25 @@ stringData:
|
|||||||
# END: initPreScript
|
# END: initPreScript
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
set -x
|
|
||||||
|
|
||||||
{{- if not .Values.image.rootless }}
|
{{- if not .Values.image.rootless }}
|
||||||
chown 1000:1000 /data
|
chown -v 1000:1000 /data
|
||||||
{{- end }}
|
{{- end }}
|
||||||
mkdir -p /data/git/.ssh
|
mkdir -pv /data/git/.ssh
|
||||||
chmod -R 700 /data/git/.ssh
|
chmod -Rv 700 /data/git/.ssh
|
||||||
[ ! -d /data/gitea/conf ] && mkdir -p /data/gitea/conf
|
[ ! -d /data/gitea/conf ] && mkdir -pv /data/gitea/conf
|
||||||
|
|
||||||
# prepare temp directory structure
|
# prepare temp directory structure
|
||||||
mkdir -p "${GITEA_TEMP}"
|
mkdir -pv "${GITEA_TEMP}"
|
||||||
{{- if not .Values.image.rootless }}
|
{{- if not .Values.image.rootless }}
|
||||||
chown 1000:1000 "${GITEA_TEMP}"
|
chown -v 1000:1000 "${GITEA_TEMP}"
|
||||||
{{- end }}
|
{{- end }}
|
||||||
chmod ug+rwx "${GITEA_TEMP}"
|
chmod -v ug+rwx "${GITEA_TEMP}"
|
||||||
|
|
||||||
{{ if .Values.signing.enabled -}}
|
{{ if .Values.signing.enabled -}}
|
||||||
if [ ! -d "${GNUPGHOME}" ]; then
|
if [ ! -d "${GNUPGHOME}" ]; then
|
||||||
mkdir -p "${GNUPGHOME}"
|
mkdir -pv "${GNUPGHOME}"
|
||||||
chmod 700 "${GNUPGHOME}"
|
chmod -v 700 "${GNUPGHOME}"
|
||||||
chown 1000:1000 "${GNUPGHOME}"
|
chown -v 1000:1000 "${GNUPGHOME}"
|
||||||
fi
|
fi
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
|
@ -28,15 +28,13 @@ tests:
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
mkdir -pv /data/git/.ssh
|
||||||
set -x
|
chmod -Rv 700 /data/git/.ssh
|
||||||
mkdir -p /data/git/.ssh
|
[ ! -d /data/gitea/conf ] && mkdir -pv /data/gitea/conf
|
||||||
chmod -R 700 /data/git/.ssh
|
|
||||||
[ ! -d /data/gitea/conf ] && mkdir -p /data/gitea/conf
|
|
||||||
|
|
||||||
# prepare temp directory structure
|
# prepare temp directory structure
|
||||||
mkdir -p "${GITEA_TEMP}"
|
mkdir -pv "${GITEA_TEMP}"
|
||||||
chmod ug+rwx "${GITEA_TEMP}"
|
chmod -v ug+rwx "${GITEA_TEMP}"
|
||||||
- it: adds gpg script block for enabled signing
|
- it: adds gpg script block for enabled signing
|
||||||
set:
|
set:
|
||||||
signing.enabled: true
|
signing.enabled: true
|
||||||
@ -51,20 +49,18 @@ tests:
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
mkdir -pv /data/git/.ssh
|
||||||
set -x
|
chmod -Rv 700 /data/git/.ssh
|
||||||
mkdir -p /data/git/.ssh
|
[ ! -d /data/gitea/conf ] && mkdir -pv /data/gitea/conf
|
||||||
chmod -R 700 /data/git/.ssh
|
|
||||||
[ ! -d /data/gitea/conf ] && mkdir -p /data/gitea/conf
|
|
||||||
|
|
||||||
# prepare temp directory structure
|
# prepare temp directory structure
|
||||||
mkdir -p "${GITEA_TEMP}"
|
mkdir -pv "${GITEA_TEMP}"
|
||||||
chmod ug+rwx "${GITEA_TEMP}"
|
chmod -v ug+rwx "${GITEA_TEMP}"
|
||||||
|
|
||||||
if [ ! -d "${GNUPGHOME}" ]; then
|
if [ ! -d "${GNUPGHOME}" ]; then
|
||||||
mkdir -p "${GNUPGHOME}"
|
mkdir -pv "${GNUPGHOME}"
|
||||||
chmod 700 "${GNUPGHOME}"
|
chmod -v 700 "${GNUPGHOME}"
|
||||||
chown 1000:1000 "${GNUPGHOME}"
|
chown -v 1000:1000 "${GNUPGHOME}"
|
||||||
fi
|
fi
|
||||||
- it: it does not chown /data even when image.fullOverride is set
|
- it: it does not chown /data even when image.fullOverride is set
|
||||||
template: templates/gitea/init.yaml
|
template: templates/gitea/init.yaml
|
||||||
@ -77,12 +73,10 @@ tests:
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
mkdir -pv /data/git/.ssh
|
||||||
set -x
|
chmod -Rv 700 /data/git/.ssh
|
||||||
mkdir -p /data/git/.ssh
|
[ ! -d /data/gitea/conf ] && mkdir -pv /data/gitea/conf
|
||||||
chmod -R 700 /data/git/.ssh
|
|
||||||
[ ! -d /data/gitea/conf ] && mkdir -p /data/gitea/conf
|
|
||||||
|
|
||||||
# prepare temp directory structure
|
# prepare temp directory structure
|
||||||
mkdir -p "${GITEA_TEMP}"
|
mkdir -pv "${GITEA_TEMP}"
|
||||||
chmod ug+rwx "${GITEA_TEMP}"
|
chmod -v ug+rwx "${GITEA_TEMP}"
|
||||||
|
@ -31,17 +31,15 @@ tests:
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
chown -v 1000:1000 /data
|
||||||
set -x
|
mkdir -pv /data/git/.ssh
|
||||||
chown 1000:1000 /data
|
chmod -Rv 700 /data/git/.ssh
|
||||||
mkdir -p /data/git/.ssh
|
[ ! -d /data/gitea/conf ] && mkdir -pv /data/gitea/conf
|
||||||
chmod -R 700 /data/git/.ssh
|
|
||||||
[ ! -d /data/gitea/conf ] && mkdir -p /data/gitea/conf
|
|
||||||
|
|
||||||
# prepare temp directory structure
|
# prepare temp directory structure
|
||||||
mkdir -p "${GITEA_TEMP}"
|
mkdir -pv "${GITEA_TEMP}"
|
||||||
chown 1000:1000 "${GITEA_TEMP}"
|
chown -v 1000:1000 "${GITEA_TEMP}"
|
||||||
chmod ug+rwx "${GITEA_TEMP}"
|
chmod -v ug+rwx "${GITEA_TEMP}"
|
||||||
- it: adds gpg script block for enabled signing
|
- it: adds gpg script block for enabled signing
|
||||||
set:
|
set:
|
||||||
image.rootless: false
|
image.rootless: false
|
||||||
@ -57,20 +55,18 @@ tests:
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
chown -v 1000:1000 /data
|
||||||
set -x
|
mkdir -pv /data/git/.ssh
|
||||||
chown 1000:1000 /data
|
chmod -Rv 700 /data/git/.ssh
|
||||||
mkdir -p /data/git/.ssh
|
[ ! -d /data/gitea/conf ] && mkdir -pv /data/gitea/conf
|
||||||
chmod -R 700 /data/git/.ssh
|
|
||||||
[ ! -d /data/gitea/conf ] && mkdir -p /data/gitea/conf
|
|
||||||
|
|
||||||
# prepare temp directory structure
|
# prepare temp directory structure
|
||||||
mkdir -p "${GITEA_TEMP}"
|
mkdir -pv "${GITEA_TEMP}"
|
||||||
chown 1000:1000 "${GITEA_TEMP}"
|
chown -v 1000:1000 "${GITEA_TEMP}"
|
||||||
chmod ug+rwx "${GITEA_TEMP}"
|
chmod -v ug+rwx "${GITEA_TEMP}"
|
||||||
|
|
||||||
if [ ! -d "${GNUPGHOME}" ]; then
|
if [ ! -d "${GNUPGHOME}" ]; then
|
||||||
mkdir -p "${GNUPGHOME}"
|
mkdir -pv "${GNUPGHOME}"
|
||||||
chmod 700 "${GNUPGHOME}"
|
chmod -v 700 "${GNUPGHOME}"
|
||||||
chown 1000:1000 "${GNUPGHOME}"
|
chown -v 1000:1000 "${GNUPGHOME}"
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user