Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

show addons: fix cluster filter #212

Merged
merged 1 commit into from
Feb 14, 2024

Conversation

gianlucam76
Copy link
Member

When displaying deployed add-ons, command allows filtering by namespace and cluster name.
Because of an issue, filtering by cluster name was returning no result.

This PR fixes it.

sveltosctl show addons
+-----------------------------+---------------+-----------+----------------+---------+-------------------------------+------------------------+
|           CLUSTER           | RESOURCE TYPE | NAMESPACE |      NAME      | VERSION |             TIME              |        PROFILES        |
+-----------------------------+---------------+-----------+----------------+---------+-------------------------------+------------------------+
| default/clusterapi-workload | helm chart    | kyverno   | kyverno-latest | 3.0.1   | 2024-02-14 16:12:47 +0100 CET | ClusterProfile/kyverno |
| default/clusterapi-workload | helm chart    | nginx     | nginx-latest   | 0.14.0  | 2024-02-14 16:14:50 +0100 CET | ClusterProfile/kyverno |
+-----------------------------+---------------+-----------+----------------+---------+-------------------------------+------------------------+

Filter by namespace

sveltosctl show addons --namespace=default
+-----------------------------+---------------+-----------+----------------+---------+-------------------------------+------------------------+
|           CLUSTER           | RESOURCE TYPE | NAMESPACE |      NAME      | VERSION |             TIME              |        PROFILES        |
+-----------------------------+---------------+-----------+----------------+---------+-------------------------------+------------------------+
| default/clusterapi-workload | helm chart    | kyverno   | kyverno-latest | 3.0.1   | 2024-02-14 16:12:47 +0100 CET | ClusterProfile/kyverno |
| default/clusterapi-workload | helm chart    | nginx     | nginx-latest   | 0.14.0  | 2024-02-14 16:14:50 +0100 CET | ClusterProfile/kyverno |
+-----------------------------+---------------+-----------+----------------+---------+-------------------------------+------------------------+

Filter by namespace and cluster name

sveltosctl show addons --namespace=default  --cluster=clusterapi-workload
+-----------------------------+---------------+-----------+----------------+---------+-------------------------------+------------------------+
|           CLUSTER           | RESOURCE TYPE | NAMESPACE |      NAME      | VERSION |             TIME              |        PROFILES        |
+-----------------------------+---------------+-----------+----------------+---------+-------------------------------+------------------------+
| default/clusterapi-workload | helm chart    | kyverno   | kyverno-latest | 3.0.1   | 2024-02-14 16:12:47 +0100 CET | ClusterProfile/kyverno |
| default/clusterapi-workload | helm chart    | nginx     | nginx-latest   | 0.14.0  | 2024-02-14 16:14:50 +0100 CET | ClusterProfile/kyverno |
+-----------------------------+---------------+-----------+----------------+---------+-------------------------------+------------------------+

Fixes #210

When displaying deployed add-ons, command allows filtering
by namespace and cluster name.
Because of an issue, filtering by cluster name was returning no result.

This PR fixes it.

```
sveltosctl show addons
+-----------------------------+---------------+-----------+----------------+---------+-------------------------------+------------------------+
|           CLUSTER           | RESOURCE TYPE | NAMESPACE |      NAME      | VERSION |             TIME              |        PROFILES        |
+-----------------------------+---------------+-----------+----------------+---------+-------------------------------+------------------------+
| default/clusterapi-workload | helm chart    | kyverno   | kyverno-latest | 3.0.1   | 2024-02-14 16:12:47 +0100 CET | ClusterProfile/kyverno |
| default/clusterapi-workload | helm chart    | nginx     | nginx-latest   | 0.14.0  | 2024-02-14 16:14:50 +0100 CET | ClusterProfile/kyverno |
+-----------------------------+---------------+-----------+----------------+---------+-------------------------------+------------------------+
```

Filter by namespace

```
sveltosctl show addons --namespace=default
+-----------------------------+---------------+-----------+----------------+---------+-------------------------------+------------------------+
|           CLUSTER           | RESOURCE TYPE | NAMESPACE |      NAME      | VERSION |             TIME              |        PROFILES        |
+-----------------------------+---------------+-----------+----------------+---------+-------------------------------+------------------------+
| default/clusterapi-workload | helm chart    | kyverno   | kyverno-latest | 3.0.1   | 2024-02-14 16:12:47 +0100 CET | ClusterProfile/kyverno |
| default/clusterapi-workload | helm chart    | nginx     | nginx-latest   | 0.14.0  | 2024-02-14 16:14:50 +0100 CET | ClusterProfile/kyverno |
+-----------------------------+---------------+-----------+----------------+---------+-------------------------------+------------------------+
```

Filter by namespace and cluster name

```
sveltosctl show addons --namespace=default  --cluster=clusterapi-workload
+-----------------------------+---------------+-----------+----------------+---------+-------------------------------+------------------------+
|           CLUSTER           | RESOURCE TYPE | NAMESPACE |      NAME      | VERSION |             TIME              |        PROFILES        |
+-----------------------------+---------------+-----------+----------------+---------+-------------------------------+------------------------+
| default/clusterapi-workload | helm chart    | kyverno   | kyverno-latest | 3.0.1   | 2024-02-14 16:12:47 +0100 CET | ClusterProfile/kyverno |
| default/clusterapi-workload | helm chart    | nginx     | nginx-latest   | 0.14.0  | 2024-02-14 16:14:50 +0100 CET | ClusterProfile/kyverno |
+-----------------------------+---------------+-----------+----------------+---------+-------------------------------+------------------------+
```
@gianlucam76 gianlucam76 changed the base branch from main to dev February 14, 2024 17:39
@gianlucam76 gianlucam76 merged commit 6290a28 into projectsveltos:dev Feb 14, 2024
4 checks passed
@gianlucam76 gianlucam76 deleted the fix-filter branch February 14, 2024 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: sveltosctl cannot filte addon results based on clustername
1 participant