1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
11 "git.arvados.org/arvados.git/lib/cmd"
12 "git.arvados.org/arvados.git/lib/service"
13 "git.arvados.org/arvados.git/sdk/go/arvados"
14 "github.com/prometheus/client_golang/prometheus"
17 var Command cmd.Handler = service.Command(arvados.ServiceNameDispatchCloud, newHandler)
19 func newHandler(ctx context.Context, cluster *arvados.Cluster, token string, reg *prometheus.Registry) service.Handler {
20 ac, err := arvados.NewClientFromConfig(cluster)
22 return service.ErrorHandler(ctx, cluster, fmt.Errorf("error initializing client from cluster config: %s", err))
24 // Disable auto-retry. We have transient failure recovery at
25 // the application level, so we would rather receive/report
26 // upstream errors right away.