Gitea configuration values containing spaces breaks the init-app-ini initContainer #260

Closed
opened 2021-12-09 10:24:56 +00:00 by nmasse-itix · 0 comments
nmasse-itix commented 2021-12-09 10:24:56 +00:00 (Migrated from gitea.com)

Hello,

I'm using this helm chart to deploy a Gitea instance with the following configuration.

gitea:
  config:
    cron.update_mirrors:
      SCHEDULE: "@every 24h"

The gitea "init-app-ini" initContainer fails with the following error:

bash: export: `24h': not a valid identifier

The error can be fixed by enclosing the value in single quotes in templates/gitea/config.yaml:

- export ENV_TO_INI__{{ $key | upper | replace "." "_0X2E_" | replace "-" "_0X2D_" }}__{{ $n_key | upper }}={{ $n_value }}
+ export ENV_TO_INI__{{ $key | upper | replace "." "_0X2E_" | replace "-" "_0X2D_" }}__{{ $n_key | upper }}='{{ $n_value }}'

[...]

-export ENV_TO_INI__{{ $key | upper | replace "." "_0X2E_" | replace "-" "_0X2D_" }}__{{ $key | upper }}={{ $value }}
+export ENV_TO_INI__{{ $key | upper | replace "." "_0X2E_" | replace "-" "_0X2D_" }}__{{ $key | upper }}='{{ $value }}'
Hello, I'm using this helm chart to deploy a Gitea instance with the following configuration. ```yaml gitea: config: cron.update_mirrors: SCHEDULE: "@every 24h" ``` The gitea "init-app-ini" initContainer fails with the following error: ``` bash: export: `24h': not a valid identifier ``` The error can be fixed by enclosing the value in single quotes in templates/gitea/config.yaml: ```diff - export ENV_TO_INI__{{ $key | upper | replace "." "_0X2E_" | replace "-" "_0X2D_" }}__{{ $n_key | upper }}={{ $n_value }} + export ENV_TO_INI__{{ $key | upper | replace "." "_0X2E_" | replace "-" "_0X2D_" }}__{{ $n_key | upper }}='{{ $n_value }}' [...] -export ENV_TO_INI__{{ $key | upper | replace "." "_0X2E_" | replace "-" "_0X2D_" }}__{{ $key | upper }}={{ $value }} +export ENV_TO_INI__{{ $key | upper | replace "." "_0X2E_" | replace "-" "_0X2D_" }}__{{ $key | upper }}='{{ $value }}' ```
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: lunny/helm-chart#260
No description provided.