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

Side by Side Diff: go/src/infra/monitoring/dispatcher/dispatcher.go

Issue 1881383005: [alerts-dispatcher] switch to OptionalLogin (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Created 4 years, 8 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 Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Dispatcher usage: 5 // Dispatcher usage:
6 // go run infra/monitoring/dispatcher 6 // go run infra/monitoring/dispatcher
7 // Expects gatekeeper.json to be in the current directory. 7 // Expects gatekeeper.json to be in the current directory.
8 8
9 package main 9 package main
10 10
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 flag.Parse() 225 flag.Parse()
226 226
227 authOptions := auth.Options{ 227 authOptions := auth.Options{
228 ServiceAccountJSONPath: *serviceAccountJSON, 228 ServiceAccountJSONPath: *serviceAccountJSON,
229 Scopes: []string{ 229 Scopes: []string{
230 auth.OAuthScopeEmail, 230 auth.OAuthScopeEmail,
231 "https://www.googleapis.com/auth/projecthosting", 231 "https://www.googleapis.com/auth/projecthosting",
232 }, 232 },
233 } 233 }
234 234
235 » mode := auth.SilentLogin 235 » mode := auth.OptionalLogin
236 if *login { 236 if *login {
237 mode = auth.InteractiveLogin 237 mode = auth.InteractiveLogin
238 } 238 }
239 239
240 transport, err := auth.NewAuthenticator(mode, authOptions).Transport() 240 transport, err := auth.NewAuthenticator(mode, authOptions).Transport()
241 if err != nil { 241 if err != nil {
242 log.Errorf("AuthenticatedTransport: %v", err) 242 log.Errorf("AuthenticatedTransport: %v", err)
243 if !*login { 243 if !*login {
244 log.Errorf("Consider re-running with -login") 244 log.Errorf("Consider re-running with -login")
245 } 245 }
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 logging.Set(ctx, log) 361 logging.Set(ctx, log)
362 defer cancel() 362 defer cancel()
363 363
364 loopResults := looper.Run(ctx, f, cycle, *maxErrs, clock.GetSystemClock( )) 364 loopResults := looper.Run(ctx, f, cycle, *maxErrs, clock.GetSystemClock( ))
365 365
366 if !loopResults.Success { 366 if !loopResults.Success {
367 log.Errorf("Failed to run loop, %v errors", loopResults.Errs) 367 log.Errorf("Failed to run loop, %v errors", loopResults.Errs)
368 os.Exit(1) 368 os.Exit(1)
369 } 369 }
370 } 370 }
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