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

Limit output during environment scan #17

Open
muse-sisay opened this issue Sep 24, 2024 · 1 comment
Open

Limit output during environment scan #17

muse-sisay opened this issue Sep 24, 2024 · 1 comment
Assignees

Comments

@muse-sisay
Copy link

Running dropkick with --name-contains arguments prints out every resource, one's that don't even match the string. I understand this might be helpful during debugging but when you're trying list or nuke resources it makes it difficult to identify the resource being matched.

I would like to request a --verbose option that limits the information displayed to the user. By default it should print matched resources. Maybe we can add a list and nuke sub commands.

Eg: current output is as follows ( minus the color) : P

$ ./dropkick civo --name-contains pfs-gitops --region nyc1
2024/09/23 21:29:45 listing Kubernetes clusters
2024/09/23 21:29:46 found 9 clusters
2024/09/23 21:29:46 found cluster: name: "mgmt-evn" - ID: ""
2024/09/23 21:29:46 skipping cluster "mgmt-evn": name does not match filter
2024/09/23 21:29:46 found cluster: name: "sept6" - ID: ""
2024/09/23 21:29:46 skipping cluster "sept6": name does not match filter
2024/09/23 21:29:46 found cluster: name: "navigate-berlin" - ID: "0"
2024/09/23 21:29:46 skipping cluster "navigate-berlin": name does not match filter
2024/09/23 21:29:46 found cluster: name: "navigate" - ID: ""
2024/09/23 21:29:46 skipping cluster "navigate": name does not match filter
2024/09/23 21:29:46 found cluster: name: "fancy-marsh-0399a027" - ID: ""
2024/09/23 21:29:46 skipping cluster "fancy-marsh-0399a027": name does not match filter
2024/09/23 21:29:46 found cluster: name: "civo" - ID: ""
2024/09/23 21:29:46 skipping cluster "civo": name does not match filter
2024/09/23 21:29:46 found cluster: name: "bill3" - ID: ""
2024/09/23 21:29:46 skipping cluster "bill3": name does not match filter
2024/09/23 21:29:46 found cluster: name: "patrickdap" - ID: ""
2024/09/23 21:29:46 skipping cluster "patrickdap": name does not match filter
2024/09/23 21:29:46 found cluster: name: "rr41" - ID: ""
2024/09/23 21:29:46 skipping cluster "rr41": name does not match filter
2024/09/23 20:28:28 found cluster: name: "pfs-gitops-catalog" - ID: ""
2024/09/23 20:28:30 refusing to delete cluster "pfs-gitops-catalog": nuke is not enabled
@muse-sisay muse-sisay added enhancement New feature or request feature request and removed enhancement New feature or request labels Sep 24, 2024
@patrickdappollonio
Copy link
Member

Yeah so this is a bit built-in. The printing to the terminal is stderr directly while the log printing is through a library. I'm not really done wrapping up some stuff (in fact, I need to make sure the deletions do show up in the stderr and not just via logs, and not everything right now prints there).

Adding the feature would be as simple as configuring the logger to io.Discard unless you have verbose mode enabled. Want to do the honours?

@muse-sisay muse-sisay self-assigned this Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants