X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/8cc6fc047506e3bead524f18416b78fe068c70fd..1a6a840d3bad6c28d8fa4c04a7610fbb8bf8423f:/tools/keep-rsync/keep-rsync.go diff --git a/tools/keep-rsync/keep-rsync.go b/tools/keep-rsync/keep-rsync.go index c6e7665caa..a299d17feb 100644 --- a/tools/keep-rsync/keep-rsync.go +++ b/tools/keep-rsync/keep-rsync.go @@ -1,3 +1,7 @@ +// Copyright (C) The Arvados Authors. All rights reserved. +// +// SPDX-License-Identifier: AGPL-3.0 + package main import ( @@ -6,15 +10,15 @@ import ( "errors" "flag" "fmt" - "git.curoverse.com/arvados.git/sdk/go/arvadosclient" - "git.curoverse.com/arvados.git/sdk/go/keepclient" "io/ioutil" "log" "net/http" "os" - "regexp" "strings" "time" + + "git.curoverse.com/arvados.git/sdk/go/arvadosclient" + "git.curoverse.com/arvados.git/sdk/go/keepclient" ) func main() { @@ -119,8 +123,6 @@ func loadConfig(configFile string) (config apiConfig, blobSigningKey string, err return } -var matchTrue = regexp.MustCompile("^(?i:1|yes|true)$") - // Read config from file func readConfigFromFile(filename string) (config apiConfig, blobSigningKey string, err error) { if !strings.Contains(filename, "/") { @@ -149,9 +151,9 @@ func readConfigFromFile(filename string) (config apiConfig, blobSigningKey strin case "ARVADOS_API_HOST": config.APIHost = value case "ARVADOS_API_HOST_INSECURE": - config.APIHostInsecure = matchTrue.MatchString(value) + config.APIHostInsecure = arvadosclient.StringBool(value) case "ARVADOS_EXTERNAL_CLIENT": - config.ExternalClient = matchTrue.MatchString(value) + config.ExternalClient = arvadosclient.StringBool(value) case "ARVADOS_BLOB_SIGNING_KEY": blobSigningKey = value } @@ -170,7 +172,7 @@ func setupKeepClient(config apiConfig, keepServicesJSON string, isDst bool, repl External: config.ExternalClient, } - // if keepServicesJSON is provided, use it to load services; else, use DiscoverKeepServers + // If keepServicesJSON is provided, use it instead of service discovery if keepServicesJSON == "" { kc, err = keepclient.MakeKeepClient(&arv) if err != nil {