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

Excluding labels doesn't work #384

Closed
nemcikjan opened this issue Dec 2, 2024 · 3 comments · Fixed by #387
Closed

Excluding labels doesn't work #384

nemcikjan opened this issue Dec 2, 2024 · 3 comments · Fixed by #387
Assignees
Labels
bug Something isn't working

Comments

@nemcikjan
Copy link
Contributor

nemcikjan commented Dec 2, 2024

Describe the bug
If using cli with -l/--exclude-labels flag, the filtering is not working

To Reproduce
Steps to reproduce the behavior:
Resource labels:

kubectl get pvc -n default pvc-claim-2 -o jsonpath={.metadata.labels}

{"kor/report":"false","reporting":"no"}

Command:

kor -l reporting=no persistentvolumeclaim

Output:

kor version: vdev

  _  _____  ____
 | |/ / _ \|  _ \
 | ' / | | | |_) |
 | . \ |_| |  _ <
 |_|\_\___/|_| \_\

Unused resources in namespace: "default"
+---+---------------+---------------+
| # | RESOURCE TYPE | RESOURCE NAME |
+---+---------------+---------------+
| 1 | Pvc           | pvc-claim-2   |
+---+---------------+---------------+

Expected behavior
The resources shouldn't be matched but the output is the following:

kor --exclude-labels reporting=no persistentvolumeclaim
kor version: vdev

  _  _____  ____
 | |/ / _ \|  _ \
 | ' / | | | |_) |
 | . \ |_| |  _ <
 |_|\_\___/|_| \_\

Unused resources in namespace: "default"
+---+---------------+---------------+
| # | RESOURCE TYPE | RESOURCE NAME |
+---+---------------+---------------+
| 1 | Pvc           | pvc-claim-2   |
+---+---------------+---------------+

OS version, architecture and kor version
Darwin_arm64
Kor version: vdev (brew installation of stable version 0.5.6)

@yonahd
Copy link
Owner

yonahd commented Dec 2, 2024

Marking this as a bug
@nemcikjan in the meantime can you try this https://github.com/yonahd/kor?tab=readme-ov-file#ignore-resources
This should help exclude the resource

@yonahd yonahd added the bug Something isn't working label Dec 2, 2024
@nemcikjan
Copy link
Contributor Author

Marking this as a bug @nemcikjan in the meantime can you try this https://github.com/yonahd/kor?tab=readme-ov-file#ignore-resources This should help exclude the resource

@yonahd the default label for excluding is working

@doronkg
Copy link
Contributor

doronkg commented Dec 3, 2024

/assign
Not all resources were refactored with the new filtering interface, I'll create a PR for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants