14714: Sets the token on the arvados client
authorEric Biagiotti <ebiagiotti@veritasgenetics.com>
Thu, 26 Sep 2019 15:22:18 +0000 (11:22 -0400)
committerEric Biagiotti <ebiagiotti@veritasgenetics.com>
Thu, 26 Sep 2019 18:18:47 +0000 (14:18 -0400)
Arvados-DCO-1.1-Signed-off-by: Eric Biagiotti <ebiagiotti@veritasgenetics.com>

services/keep-balance/main.go

index 92ed644b5986c0679e37d5bf5e4ae0f50652db0d..779614df04304866a4e0323c8c011015bffe784c 100644 (file)
@@ -26,13 +26,14 @@ var (
        options RunOptions
 )
 
-func newHandler(ctx context.Context, cluster *arvados.Cluster, _ string) service.Handler {
+func newHandler(ctx context.Context, cluster *arvados.Cluster, token string) service.Handler {
        if !options.Once && cluster.Collections.BalancePeriod == arvados.Duration(0) {
                return service.ErrorHandler(ctx, cluster, fmt.Errorf("You must either run keep-balance with the -once flag, or set Collections.BalancePeriod in the config. "+
                        "If using the legacy keep-balance.yml config, RunPeriod is the equivalant of Collections.BalancePeriod."))
        }
 
        ac, err := arvados.NewClientFromConfig(cluster)
+       ac.AuthToken = token
        if err != nil {
                return service.ErrorHandler(ctx, cluster, fmt.Errorf("error initializing client from cluster config: %s", err))
        }