-
Notifications
You must be signed in to change notification settings - Fork 933
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
DB: Fix update-schema to support lxd in non-GOPATH locations #14704
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Oops, something went wrong.
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.
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.
Honestly I'm finding it strange that this is required at all.
As far as I can tell, schema generation is only used by LXD and not any consumers or
lxd-generate
(microcloud, microceph, etc.), they only use it for query generation.lxd-generate
is directly importingto call
cluster.SchemaDotGo
andnode.SchemaDotGo
for generating schemas.I think it'd be easier to reason about if we take this out of
lxd-generate
and have a small go program call these functions and input the exact filepath we want.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.
@markylaing @masnax tells me that its used by micro* too.
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.
I'm happy to have it reworked, but we need it to be working now (its broken right now and blocking a PR), and I dont have time to focus on a larger rework right now im afraid. But we can follow up with a better refactor if you have time for it?
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.
@markylaing for context it was broken in this commit 63b017e
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.
I dont follow you. It's lxd-generate's job to update these files?
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.
We could increase the specificity of
if strings.HasPrefix(filename, "github.com") {
to check forgithub.com/canonical/lxd/lxd/db/
if you think that would help with microcloud usage?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.
micro*
may be using query generation but I don't see how it's possible that they're usinglxd-generate
schema since it doesn't take any arguments, it only generates the LXD schema.I've just seen the thread for this (I didn't realise it was blocking a PR) so will approve for now and we can discuss more in the new year :)
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 happened tail end of yesterday in https://chat.canonical.com/canonical/pl/f1cqkxqdcpnojcu9zi45ie9fkw
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.
You may well be right, all I got from @masnax so far that gave me that impression was: