feat: adding dry support to gitea additional config from envs parameter #840
Reference in New Issue
Block a user
No description provided.
Delete Branch "Ceddaerrix/gitea-helm-chart:additionalConfigFromEnvs-DRY"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description of the change
Based on the discussion under #60, it is possible to use
gitea.additionalConfigFromEnvsto provide variables in order to override configurations fromapp.ini.Especially when using gitea as a dependency of an umbrella, some values may need to be repeated in multiple places (such has database configuration). Hence, introducing the
tplfunction ongitea.additionalConfigFromEnvswill simplify such repetition by having the value only set in one place...Benefits
With the same intentions as #759, #664, #529 or #498, this change will allow reusing the value from other value parameters to avoid duplicating the same value in multiple places.
Possible drawbacks
N/A
Applicable issues
N/A
Additional information
N/A
⚠ BREAKING
N/A
Checklist
templatesfolder)additionalConfigFromEnvs-DRYto feat{\(): Adding DRY support to 'gitea.additionalConfigFromEnvs'feat{\(): Adding DRY support to 'gitea.additionalConfigFromEnvs'to feat(): Adding DRY support to 'gitea.additionalConfigFromEnvs'feat(): Adding DRY support to 'gitea.additionalConfigFromEnvs'to feat: Adding DRY support to 'gitea.additionalConfigFromEnvs'feat: Adding DRY support to 'gitea.additionalConfigFromEnvs'to feat: adding dry support to gitea additional config from envs parameterAs I mentioned in #60, instead of the environment variable approach, I would rather use the approach of storing the credentials in the container file system to enable a reconnect in case of changed database credentials and to avoid missuse before accessing the environment variables.
Let's wait and see if gitea has such a hotreload or not. I think we will get an answer from the devs soon.
@volker.raschek Gitea doesn't have a hot-reloading unfortunately. This has been discussed in multiple issues in the upstream repo.
LGTM overall, thanks also for adding tests directly.
LGTM as well. By the way, you can also use yaml anchors to not repeat yourself:
giteabot referenced this pull request2025-03-30 14:32:13 +00:00 @@ -257,3 +257,3 @@{{- $_ := set $inlines "_generals_" (join "\n" $generals) -}}{{- toYaml $inlines -}}{{- tpl (toYaml $inlines) $ -}}‼️ Oh dear, I completely missed this change. It breaks configuring
log.ACCESS_LOG_TEMPLATEas mentioned here: #747 (comment).Before this PR was merged a few minutes ago, I was able to configure following values so that
helm template gitea .succeeds:With these changes, the same values result in following error:
This is the kind of breaking change I wanted to prevent when posting #759 (comment). I think we should make the inline value templating "opt-in".
My bad! This one is on me; having providing some input on #759, I missed resetting my local clone on the matter
Reverting the use if
{{- tpl (toYaml $inlines) $ -}}under #846@Ceddaerrix Can you take a look at the most recent comment and maybe come up with a workaround for
helm template?