Skip to content

Commit 58dbd1f

Browse files
author
Valentin REJAUNIER
committed
fix: use locationIDs list
1 parent 88b9fb9 commit 58dbd1f

3 files changed

Lines changed: 206 additions & 92 deletions

File tree

pkg/api/escape/integrations.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,23 @@ package escape
33
import (
44
"context"
55
"fmt"
6+
"strings"
67

78
v3 "github.com/Escape-Technologies/cli/pkg/api/v3"
89
"github.com/Escape-Technologies/cli/pkg/log"
910
)
1011

1112
// ListKubernetesIntegrationsFilters holds optional filters for listing Kubernetes integrations
1213
type ListKubernetesIntegrationsFilters struct {
13-
ProjectIDs []string
14-
LocationID string
15-
Search string
14+
ProjectIDs []string
15+
LocationIDs string
16+
Search string
1617
}
1718

1819
// UpsertKubernetesIntegration creates a Kubernetes integration if it doesn't exist
1920
func UpsertKubernetesIntegration(ctx context.Context, req v3.CreatekubernetesIntegrationRequest) (*v3.CreatekubernetesIntegration200Response, error) {
2021
list, _, err := listKubernetesIntegrations(ctx, "", &ListKubernetesIntegrationsFilters{
21-
LocationID: *req.ProxyId,
22+
LocationIDs: strings.Join([]string{*req.ProxyId}, ","),
2223
})
2324
if err != nil {
2425
return nil, fmt.Errorf("api error: %w", err)
@@ -69,8 +70,8 @@ func listKubernetesIntegrations(ctx context.Context, next string, filters *ListK
6970
if len(filters.ProjectIDs) > 0 {
7071
req = req.ProjectIds(filters.ProjectIDs)
7172
}
72-
if len(filters.LocationID) > 0 {
73-
req = req.LocationId(filters.LocationID)
73+
if len(filters.LocationIDs) > 0 {
74+
req = req.LocationIds([]string{filters.LocationIDs})
7475
}
7576
if filters.Search != "" {
7677
req = req.Search(filters.Search)

0 commit comments

Comments
 (0)