From 57a1cd27d9a6cc014f425fabeadb0db34f242b0e Mon Sep 17 00:00:00 2001 From: dajoen74 Date: Tue, 18 Oct 2022 13:47:21 +0800 Subject: [PATCH] Gpg init fails to import key (#371) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### Description of the change The init container for gpg key import doesn´t work. There is a not a tty error. ### Benefits This will run gpg in batch mode. Eliminating the tty error. ### Possible drawbacks None that I can think off. ### Applicable issues - fixes #370 ### 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` Co-authored-by: Jeroen Verhoeven Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/371 Reviewed-by: techknowlogick Reviewed-by: justusbunsi Co-authored-by: dajoen74 Co-committed-by: dajoen74 --- templates/gitea/init.yaml | 2 +- unittests/init/init_directory_structure.sh.yaml | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/templates/gitea/init.yaml b/templates/gitea/init.yaml index 0337388..838460b 100644 --- a/templates/gitea/init.yaml +++ b/templates/gitea/init.yaml @@ -10,7 +10,7 @@ stringData: #!/usr/bin/env bash set -eu - gpg --import /raw/private.asc + gpg --batch --import /raw/private.asc init_directory_structure.sh: |- #!/usr/bin/env bash diff --git a/unittests/init/init_directory_structure.sh.yaml b/unittests/init/init_directory_structure.sh.yaml index 75b43ea..7be2336 100644 --- a/unittests/init/init_directory_structure.sh.yaml +++ b/unittests/init/init_directory_structure.sh.yaml @@ -5,6 +5,17 @@ release: templates: - templates/gitea/init.yaml tests: + - it: runs gpg in batch mode + set: + signing.enabled: true + 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: