Embed mycnf files and init_db#5654
Merged
sougou merged 5 commits intovitessio:masterfrom Jan 11, 2020
Merged
Conversation
Signed-off-by: Morgan Tocker <tocker@gmail.com>
Signed-off-by: Morgan Tocker <tocker@gmail.com>
Hooks will just not be supported if VTROOT is not specified. Signed-off-by: Morgan Tocker <tocker@gmail.com>
Signed-off-by: Morgan Tocker <tocker@gmail.com>
Contributor
|
Shouldn't there be a generated file somewhere, like rice-box.go? |
Contributor
Author
It is produced in the Makefile on build, and added to gitignore. I took this direction because there are not many config files (vs. web files), and the generation time is quick. |
Contributor
|
Go recommends that all generated files be pre-generated and be part of the repo. The main goal is that you should be able to just |
Signed-off-by: Morgan Tocker <tocker@gmail.com>
Contributor
Author
|
@sougou makes sense. Feedback addressed. |
sougou
approved these changes
Jan 11, 2020
morgo
added a commit
to planetscale/vitess
that referenced
this pull request
Jan 15, 2020
Regression of vitessio#5654 Signed-off-by: Morgan Tocker <tocker@gmail.com>
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.
Fixes #5502
This embeds the my.cnf files for a MySQL flavor, as well as the init_db.sql file.
The examples have also been modified to search for vitess binaries in the PATH, and no longer specify an init-db file. They can now completely standalone from the vitess root, as long as the binaries are in the path:
The linter also reported that the contains function and mycnfTemplateFile variable of mysqld.go are unused.
I introduced DefaultVtRoot so that there will not be an error if
VTROOTis not defined. This means that if you want to use hooks, you will need to set aVTROOT, unless you are okay with the default of/usr/local/vitess/vthook(eventually I'd like to move binary instructions to use /usr/local/vitess as the install PATH similar to how golang installs.. it's not important to switch right now, and I could have equally specified /dev/null.)In #5502 @enisoc commented that he was concerned that embedding init_db.sql creates a security risk. In this implementation, it is still possible to overwrite with a new init_db.sql file.. so it is possible to deploy securely.
Signed-off-by: Morgan Tocker tocker@gmail.com