-
-
Notifications
You must be signed in to change notification settings - Fork 538
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deprecate FileStore engine support #2119
Conversation
The codebase has been refactored to remove support for JSON file store storage engine, with SQLite serving as the default store engine. New functions have been added to handle unsupported store engines and to migrate data from file store to SQLite.
b4d88cc
to
940aac2
Compare
940aac2
to
14639af
Compare
af06be4
to
0143afe
Compare
0143afe
to
64909be
Compare
if err := checkFileStoreEngine(kind, dataDir); err != nil { | ||
return nil, err | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not clear the case handleUnsupportedStoreEngine
and the checkFileStoreEngine
The handleUnsupportedStoreEngine
tries to migrate the json file to SQL. But before that, the checkFileStoreEngine will return with error because the JSON file exists.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
checkFileStoreEngine
only checks if store.json
exists and jsonfile
is set as the store engine in management.json
. It then returns an error with a link pointing to the steps for migrating from jsonfile to SQLite.
handleUnsupportedStoreEngine
handles the case when the store engine is not supported. If there is an existing store.json
, it automatically migrates to SQLite, but the user will need to update the store engine to SQLite. If there is no existing store.json, it returns an error indicating an unsupported store engine
// if store engine is not set in the config we first try to evaluate NETBIRD_STORE_ENGINE | ||
kind := getStoreEngineFromEnv() | ||
if kind == "" { | ||
// NETBIRD_STORE_ENGINE is not set we evaluate default based on dataDir | ||
kind = getStoreEngineFromDatadir(dataDir) | ||
kind = SqliteStoreEngine |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment is not valid any more above this line
Quality Gate passedIssues Measures |
Describe your changes
Deprecates support for JSON file storage.
Issue ticket number and link
Checklist