X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/47a79960c81ea689445f2040b24cb76729afab06..0f644e242ef37c911ad3dc25aca8135c339de349:/tools/keep-block-check/keep-block-check.go diff --git a/tools/keep-block-check/keep-block-check.go b/tools/keep-block-check/keep-block-check.go index 6cf11a7280..7dca3293d2 100644 --- a/tools/keep-block-check/keep-block-check.go +++ b/tools/keep-block-check/keep-block-check.go @@ -1,3 +1,7 @@ +// Copyright (C) The Arvados Authors. All rights reserved. +// +// SPDX-License-Identifier: AGPL-3.0 + package main import ( @@ -5,15 +9,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() { @@ -99,8 +103,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, "/") { @@ -130,9 +132,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 } @@ -153,7 +155,7 @@ func setupKeepClient(config apiConfig, keepServicesJSON string, blobSignatureTTL 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 {