elastic / elastic/ecctl

Region filtering for ecl deployment list does not filter

Open
#490 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
58
Forks
61
PR merge metrics
No merged PRs in 30d

Description

@PedroPerezElastic commented on [Thu Apr 09 2020](https://github.com/elastic/cloud-cli/issues/1149)

## Readiness Checklist

- [x] I am running the latest version
- [x] I checked the documentation and found no answer
- [x] I checked to make sure that this issue has not already been filed
- [x] I am reporting the issue to the correct repository (for multi-repository projects)

## Expected Behavior

`ecl --config foundit deployment list --region azure-japaneast` should return deployments from `azure-japaneast` region **only.**

## Current Behavior

The aforementioned command returns deployments not only from `azure-japaneast`. This can be reproed with any region name in the filter as long as the region exists. If you use a non-existent region name the output is as expected:

```sh
▶ ecl --config foundit deployment list --region panete
panete is not a valid region in this environment
```

## Possible Solution

## Steps to Reproduce

1. `ecl --config foundit deployment list --region azure-japaneast`

Contents of my `foundit.yaml`:

```yaml
host: https://adminconsole.found.no
region: aws-eu-central-1
user: myuser
pass: mypassword
secrets: /Users/pjperez/Projects/found-secrets/bundles.yaml
```

## Context

I just wanted to get a list of deployments in a specific region. This is not a blocker to my work.

## Your Environment

* Version used:

```
▶ ecl version
ecl 1.0.0-bc8 (build 243d0857b73c22940a2c66713f5ce228b35352e2)
```

* Environment name and version (e.g. Go 1.9):

```
▶ go version
go version go1.13.4 darwin/amd64
```

* Operating System and version:

MacOS Mojave 10.14.6

---

@marclop commented on [Tue Apr 14 2020](https://github.com/elastic/cloud-cli/issues/1149#issuecomment-613215801)

This affects SaaS only.

---

@marclop commented on [Thu Jul 09 2020](https://github.com/elastic/cloud-cli/issues/1149#issuecomment-655880668)

the deployments API is a global API rather than a region scoped API, the current behaviour is expected and the `--region` flag won't limit the results per region, we could add a `--region-filter` flag which would act like this.

---

@PedroPerezElastic commented on [Thu Jul 09 2020](https://github.com/elastic/cloud-cli/issues/1149#issuecomment-656057882)

Fair enough. A new flag could indeed be useful, however maybe it makes sense to emulate the same filtering we have in the UI? so you could for example pass a filter expression with `--filter`

e.g. `ecl --config foundit deployment list --filter 'region:(azure-japaneast) logging'`

![image](https://user-images.githubusercontent.com/51089640/87031276-2d4d5080-c1e3-11ea-8eab-c76f47e7098d.png)

Thoughts?

---

@victorgs commented on [Thu Sep 17 2020](https://github.com/elastic/cloud-cli/issues/1149#issuecomment-694192810)

i found this issue today. just fyi

---

@marclop commented on [Mon Sep 21 2020](https://github.com/elastic/cloud-cli/issues/1149#issuecomment-695917616)

We could add `--filter` which calls the `/search` endpoint instead of just using a GET, which is what the UI does.

For planning and know how many people would love to see this, I'd appreciate some 👍 on the issue description. I can also change the name of this issue to better reflect what's asked here :)

---

@ppapapetrou76 commented on [Fri Apr 09 2021](https://github.com/elastic/cloud-cli/issues/1149#issuecomment-816503213)

@marclop this is on the `ecctl` side right?

---

@marclop commented on [Wed Apr 14 2021](https://github.com/elastic/cloud-cli/issues/1149#issuecomment-819435807)

yeah

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.