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

Side by Side Diff: logdog/client/cmd/logdog_annotee/main.go

Issue 2714443002: Annotee: Automatically infer host from bootstrap. (Closed)
Patch Set: Created 3 years, 10 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The LUCI Authors. All rights reserved. 1 // Copyright 2015 The LUCI Authors. All rights reserved.
2 // Use of this source code is governed under the Apache License, Version 2.0 2 // Use of this source code is governed under the Apache License, Version 2.0
3 // that can be found in the LICENSE file. 3 // that can be found in the LICENSE file.
4 4
5 package main 5 package main
6 6
7 import ( 7 import (
8 "encoding/json" 8 "encoding/json"
9 "errors" 9 "errors"
10 "flag" 10 "flag"
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 183
184 // Get the annotation project. This must be non-empty. 184 // Get the annotation project. This must be non-empty.
185 if a.project == "" && a.bootstrap != nil { 185 if a.project == "" && a.bootstrap != nil {
186 a.project = a.bootstrap.Project 186 a.project = a.bootstrap.Project
187 } 187 }
188 if err := a.project.Validate(); err != nil { 188 if err := a.project.Validate(); err != nil {
189 log.WithError(err).Errorf(a, "Invalid project (-project).") 189 log.WithError(err).Errorf(a, "Invalid project (-project).")
190 return configErrorReturnCode 190 return configErrorReturnCode
191 } 191 }
192 192
193 if a.logdogHost == "" && a.bootstrap != nil {
194 a.logdogHost = a.bootstrap.CoordinatorHost
195 }
196
193 args = fs.Args() 197 args = fs.Args()
194 if a.jsonArgsPath != "" { 198 if a.jsonArgsPath != "" {
195 if len(args) > 0 { 199 if len(args) > 0 {
196 log.Fields{ 200 log.Fields{
197 "commandLineArgs": args, 201 "commandLineArgs": args,
198 "jsonArgsPath": a.jsonArgsPath, 202 "jsonArgsPath": a.jsonArgsPath,
199 }.Errorf(a, "Cannot specify both JSON and command-line a rguments.") 203 }.Errorf(a, "Cannot specify both JSON and command-line a rguments.")
200 return configErrorReturnCode 204 return configErrorReturnCode
201 } 205 }
202 206
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 if err := a.maybeWriteResult(&br); err != nil { 289 if err := a.maybeWriteResult(&br); err != nil {
286 log.WithError(err).Warningf(a, "Failed to write bootstrap result .") 290 log.WithError(err).Warningf(a, "Failed to write bootstrap result .")
287 } 291 }
288 return e.ReturnCode() 292 return e.ReturnCode()
289 } 293 }
290 294
291 func main() { 295 func main() {
292 mathrand.SeedRandomly() 296 mathrand.SeedRandomly()
293 os.Exit(mainImpl(os.Args[1:])) 297 os.Exit(mainImpl(os.Args[1:]))
294 } 298 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698