summaryrefslogtreecommitdiffstats
path: root/client/go
diff options
context:
space:
mode:
authorJon Marius Venstad <venstad@gmail.com>2021-11-23 18:25:01 +0100
committerJon Marius Venstad <venstad@gmail.com>2021-11-23 18:25:01 +0100
commitd1f4b6ab1f8c22a55e0e2a66e313c98f0a274394 (patch)
treea9a97c88d4237d8ac5d73fd4c7c980921955298d /client/go
parentef49f70486d2404cd83e0d13cd4890a106be4f2d (diff)
No need for API key if endpoints are overridden
Diffstat (limited to 'client/go')
-rw-r--r--client/go/cmd/helpers.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/client/go/cmd/helpers.go b/client/go/cmd/helpers.go
index 9ccc4513ce3..89ea87f198e 100644
--- a/client/go/cmd/helpers.go
+++ b/client/go/cmd/helpers.go
@@ -184,10 +184,11 @@ func getTarget() vespa.Target {
return nil
}
deployment := deploymentFromArgs()
+ endpoints := getEndpointsFromEnv()
var apiKey []byte = nil
apiKey, err = ioutil.ReadFile(cfg.APIKeyPath(deployment.Application.Tenant))
- if !vespa.Auth0AccessTokenEnabled() {
+ if !vespa.Auth0AccessTokenEnabled() && endpoints == nil {
if err != nil {
fatalErrHint(err, "Deployment to cloud requires an API key. Try 'vespa api-key'")
}
@@ -233,7 +234,7 @@ func getTarget() vespa.Target {
cfg.AuthConfigPath(),
getSystemName(),
cloudAuth,
- getEndpointsFromEnv())
+ endpoints)
}
fatalErrHint(fmt.Errorf("Invalid target: %s", targetType), "Valid targets are 'local', 'cloud' or an URL")
return nil