-
Notifications
You must be signed in to change notification settings - Fork 312
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
cluster/import: read and set deploy_dir properly on import #704
Conversation
@@ -59,6 +66,7 @@ monitoring_servers: [] | |||
`) | |||
|
|||
topo, err := yaml.Marshal(clsMeta.Topology) | |||
fmt.Printf("Got initial topo:\n%s\n", topo) |
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.
For debug?
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.
Yes, it won't output anything if the test passes.
// subdirs of deploy_dir in global options | ||
clsMeta.Topology.MonitoredOptions.DeployDir = clsMeta.Topology.GlobalOptions.DeployDir | ||
clsMeta.Topology.MonitoredOptions.DataDir = filepath.Join( | ||
clsMeta.Topology.MonitoredOptions.DeployDir, |
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.
Is there risk is the user doesn't set the global deploy_dir
?
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's not possible for tidb-ansible
, in that case the deploy process could not be finished.
Codecov Report
@@ Coverage Diff @@
## master #704 +/- ##
==========================================
+ Coverage 57.64% 57.65% +0.01%
==========================================
Files 254 254
Lines 18433 18447 +14
==========================================
+ Hits 10626 10636 +10
- Misses 6410 6412 +2
- Partials 1397 1399 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
c65df41
to
20fdc0d
Compare
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.
LGTM
What problem does this PR solve?
The global
deploy_dir
is not set during the process of importing from ansible deployed cluster, however, as we detect and set deploy dir for each instance individually, this only affect monitoring agents (node_exporter and blackbox_exporter).What is changed and how it works?
Read the value of
deploy_dir
ininventory.ini
and set it toglobal.deploy_dir
andmonitored.deploy_dir
global variables.Note that as we read and set dirs for each instance individually, this change does not effect them.
Check List
Tests
Code changes
Side effects
None
Related changes
Release notes: