Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(127)

Unified Diff: common/tsmon/iface.go

Issue 2225933003: tsmon: read hostname and region from config file (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-go@master
Patch Set: Fixed error in test Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « common/tsmon/config_test.go ('k') | common/tsmon/iface_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: common/tsmon/iface.go
diff --git a/common/tsmon/iface.go b/common/tsmon/iface.go
index 90559043aec0eb76fb554a9a685b9e45b0d6cb32..25d85f862ad370eb3db944f1d643c3867d5eef95 100644
--- a/common/tsmon/iface.go
+++ b/common/tsmon/iface.go
@@ -99,6 +99,22 @@ func InitializeFromFlags(c context.Context, fl *Flags) error {
if config.AutoGenHostname {
fl.Target.AutoGenHostname = true
}
+ if config.Hostname != "" {
+ if fl.Target.DeviceHostname == "" {
+ fl.Target.DeviceHostname = config.Hostname
+ }
+ if fl.Target.TaskHostname == "" {
+ fl.Target.TaskHostname = config.Hostname
+ }
+ }
+ if config.Region != "" {
+ if fl.Target.DeviceRegion == "" {
+ fl.Target.DeviceRegion = config.Region
+ }
+ if fl.Target.TaskRegion == "" {
+ fl.Target.TaskRegion = config.Region
+ }
+ }
fl.Target.SetDefaultsFromHostname()
t, err := target.NewFromFlags(&fl.Target)
if err != nil {
« no previous file with comments | « common/tsmon/config_test.go ('k') | common/tsmon/iface_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698