summaryrefslogtreecommitdiffstats
path: root/client/go/cmd/root.go
diff options
context:
space:
mode:
Diffstat (limited to 'client/go/cmd/root.go')
-rw-r--r--client/go/cmd/root.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/client/go/cmd/root.go b/client/go/cmd/root.go
index 0557248cedf..e88398a7fde 100644
--- a/client/go/cmd/root.go
+++ b/client/go/cmd/root.go
@@ -324,9 +324,11 @@ func (c *CLI) createCloudTarget(targetType string, opts targetOptions) (vespa.Ta
)
switch targetType {
case vespa.TargetCloud:
- apiKey, err = c.config.readAPIKey(c, system, deployment.Application.Tenant)
- if err != nil {
- return nil, err
+ if c.config.useAPIKey(c, system, deployment.Application.Tenant) {
+ apiKey, err = c.config.readAPIKey(deployment.Application.Tenant)
+ if err != nil {
+ return nil, err
+ }
}
authConfigPath = c.config.authConfigPath()
deploymentTLSOptions = vespa.TLSOptions{}