Properly distinguish predefined and custom env vars in environment-to-ini (#586)

### Description of the change

https://gitea.com/gitea/helm-chart/pulls/464#issuecomment-744656 was never taken into account. Somehow I missed that the PR was already merged when I replied.

### Benefits

Without this fix:

```text
Reloading preset envs...
  + 'GITEA_POSTGRESQL_HA_PGPOOL_SERVICE_PORT'
  + 'GITEA_POSTGRESQL_HA_POSTGRESQL_PORT_5432_TCP_PROTO'
  + 'GITEA_POSTGRESQL_HA_PGPOOL_PORT_5432_TCP_PROTO'
  + 'GITEA_POSTGRESQL_HA_PGPOOL_PORT'
  + 'GITEA_POSTGRESQL_HA_POSTGRESQL_PORT_5432_TCP_PORT'
  + 'GITEA_APP_INI'
  + 'GITEA_POSTGRESQL_HA_PGPOOL_PORT_5432_TCP_ADDR'
  + 'GITEA_POSTGRESQL_HA_POSTGRESQL_SERVICE_HOST'
  + 'GITEA_WORK_DIR'
  + 'GITEA_POSTGRESQL_HA_POSTGRESQL_PORT'
  + 'GITEA_POSTGRESQL_HA_POSTGRESQL_PORT_5432_TCP_ADDR'
  + 'GITEA_POSTGRESQL_HA_POSTGRESQL_SERVICE_PORT_POSTGRESQL'
  + 'GITEA_TEMP'
  + 'GITEA_POSTGRESQL_HA_PGPOOL_PORT_5432_TCP_PORT'
  + 'GITEA_POSTGRESQL_HA_PGPOOL_SERVICE_PORT_POSTGRESQL'
  + 'GITEA_POSTGRESQL_HA_POSTGRESQL_SERVICE_PORT'
  + 'GITEA_POSTGRESQL_HA_POSTGRESQL_PORT_5432_TCP'
  + 'GITEA_POSTGRESQL_HA_PGPOOL_PORT_5432_TCP'
  + 'GITEA_CUSTOM'
  + 'GITEA_POSTGRESQL_HA_PGPOOL_SERVICE_HOST'
  + 'GITEA__metrics__ENABLED'
=== All configuration sources loaded ===
```

With this fix:

```text
Reloading preset envs...
  + 'GITEA__metrics__ENABLED'
=== All configuration sources loaded ===
```

Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/586
Reviewed-by: techknowlogick <techknowlogick@noreply.gitea.com>
Reviewed-by: pat-s <pat-s@noreply.gitea.com>
Co-authored-by: justusbunsi <sk.bunsenbrenner@gmail.com>
Co-committed-by: justusbunsi <sk.bunsenbrenner@gmail.com>
This commit is contained in:
justusbunsi 2023-12-18 08:44:51 +00:00 committed by pat-s
parent 223069d042
commit 59b246302b
1 changed files with 1 additions and 1 deletions

View File

@ -174,7 +174,7 @@ stringData:
}
# save existing envs prior to script execution. Necessary to keep order of preexisting and custom envs
env | (grep GITEA || [[ $? == 1 ]]) > /tmp/existing-envs
env | (grep -e '^GITEA__' || [[ $? == 1 ]]) > /tmp/existing-envs
# MUST BE CALLED BEFORE OTHER CONFIGURATION
env2ini::generate_initial_secrets