-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Embed mycnf files and init_db #5654
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>
Shouldn't there be a generated file somewhere, like rice-box.go? |
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. |
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>
@sougou makes sense. Feedback addressed. |
Regression of vitessio#5654 Signed-off-by: Morgan Tocker <tocker@gmail.com>
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
VTROOT
is 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