fix(init): fixed init logic #310
Reference in New Issue
Block a user
No description provided.
Delete Branch "fix-issue-296"
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
Checking the existence of the config directory should be done with the directory path itself. Not its parent directory.
This simple fix addresses that by using the config directory for its existence check.
Benefits
Prior to #337 there was no other way to install this helm chart using the
extraVolumeMounts
setting with these values:Without this fix, the Gitea pod would never initialize, and would crashloop with the same error in #296.
Additional information
Mounting a configMap to
/data/gitea/templates/custom
causes the/data/gitea
folder to exist even though the/data/gitea/conf
had not been initialized yet. The initialization script saw that the/data/gitea
dir existed and exited early without initializing/data/gitea/conf
.@viceice Does this break your environment regarding #210 and #211?
Hi @cboin1996. Sorry for not responding earlier. I wasn't sure if it actually fixes the root cause and not only a symptom. IMO, the issue is that mount points which are only relevant during Gitea runtime are also mounted into the initialization phase of the Helm Chart. I've created PR #337 which splits the
extraVolumeMounts
into two different mount point settings. Doing so ensures that the init scripts are not interfered by customization mount points.If it's OK for you, I'd like to close your PR in favor of #337.Not sure if this breakes me. I've now migrated to chart v6 and don't see any issues yet.
My only last workaround is this:
Not sure if it's still required.
@viceice
I guess it shouldn't be necessary anymore when using the different volumeMount definitions. The need of such workaround makes sense when already having a directory structure next to the config directory. Which is the case when having template mounts or something similar.
Thinking about the setup workflow and reviewing #337, your suggested change is still a valid one - LGTM.
I've restructured the description to take both the PR template and #337 into account.
This is also related to #296 and might have helped there by exiting early.
Checking for the final dir with
test -d
makes sense to me, don't see anything troublesome in this change.thanks guys!