fix(semaphore): support sqlite as database.type - #32
Open
fabiofilz wants to merge 2 commits into
Open
Conversation
|
Wanted to chime in and say that I was able to test this, that it works, and has unblocked me. I hope this gets merged! About the question of |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I ran into this exact problem deploying to a fresh k8s environment (chart 16.2.2 / app v2.18.3). Since the app itself already supports
sqliteas a validdialect(seeutil/config.go:DbDriverSQLite = "sqlite"), the gap is entirely in the chart. Thevalues.schema.jsonenum still only allowsbolt|mysql|postgres, and more importantlytemplates/deployment.yamlandtemplates/pvc.yamlonly create the persistent volume/mount fordatabase.type == "bolt". Settingtype: sqlitewithout a chart fix silently loses persistence (no PVC/volume is mounted at all) and also breakstemplates/secret-database.yaml, which tries tob64encan unsetdatabase.passwordfor any non-bolttype.I patched this by treating
sqlitethe same way asbolteverywhere those three files branch ondatabase.type == "bolt"(reusingdatabase.pathfor the file location, mounting the same persisted volume, and skipping the credentials Secret since file-based DBs don't need one). I also renamed the volume/PVC fromboltdbtodbfilesince it's no longer bolt-specific. Tested end-to-end: pod starts, logs showSQLite <name>@<path>, no more BoltDB deprecation warning.I deliberately did NOT change the default
database.type(stillbolt), to avoid breaking existing installs that rely on the implicit default during ahelm upgrade. Instead, I updated the docs to make sqlite the clearly recommended path going forward:database.path/persistence.*field descriptions (previously worded as bolt-only) invalues.yamland the generatedREADME.mdtable.semaphore migrate --from-boltdbcommand (available in v2.17/v2.18 only) and theSEMAPHORE_MIGRATE_FROM_BOLTDBenv var for Kubernetes, plus a note that this tooling was removed in v2.19 and what to do if you're already past that.Open to feedback on the approach. e.g. if you'd rather introduce a dedicated
database.sqlite.pathfield instead of reusingdatabase.path, or change the default, happy to rework it.Fixes #31