From e4719a0a72c86cf8589d2f5691a0a1be5ac7d23a Mon Sep 17 00:00:00 2001 From: jonmv Date: Tue, 7 Nov 2023 11:06:43 +0100 Subject: Filter out token endpoints in Vespa CLI --- client/go/internal/vespa/target_cloud.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/client/go/internal/vespa/target_cloud.go b/client/go/internal/vespa/target_cloud.go index 31108dae51f..4a6bc384bd6 100644 --- a/client/go/internal/vespa/target_cloud.go +++ b/client/go/internal/vespa/target_cloud.go @@ -42,9 +42,10 @@ type cloudTarget struct { } type deploymentEndpoint struct { - Cluster string `json:"cluster"` - URL string `json:"url"` - Scope string `json:"scope"` + Cluster string `json:"cluster"` + URL string `json:"url"` + Scope string `json:"scope"` + AuthMethod string `json:"authMethod"` } type deploymentResponse struct { @@ -370,6 +371,9 @@ func (t *cloudTarget) discoverEndpoints(timeout time.Duration) (map[string]strin if endpoint.Scope != "zone" { continue } + if endpoint.AuthMethod == "token" { + continue + } urlsByCluster[endpoint.Cluster] = endpoint.URL } return true, nil -- cgit v1.2.3 From 270a494ec39c09c5edfe277dc753adbb0ab36872 Mon Sep 17 00:00:00 2001 From: jonmv Date: Tue, 7 Nov 2023 11:21:33 +0100 Subject: go fmt --- client/go/internal/vespa/target_cloud.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/go/internal/vespa/target_cloud.go b/client/go/internal/vespa/target_cloud.go index 4a6bc384bd6..708810061d2 100644 --- a/client/go/internal/vespa/target_cloud.go +++ b/client/go/internal/vespa/target_cloud.go @@ -372,7 +372,7 @@ func (t *cloudTarget) discoverEndpoints(timeout time.Duration) (map[string]strin continue } if endpoint.AuthMethod == "token" { - continue + continue } urlsByCluster[endpoint.Cluster] = endpoint.URL } -- cgit v1.2.3