Code Monkey home page Code Monkey logo

dropkick's Introduction

dropkick

a utility cli for cleaning up cloud resources

run it

brew tap konstructio/taps
brew install konstructio/taps/dropkick

# run binary to look at what resources will be deleted
dropkick civo --region fra1 

# delete all those resources
dropkick civo --region fra1 --nuke

dropkick's People

Contributors

jarededwards avatar johndietz avatar kube1st avatar patrickdappollonio avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

dropkick's Issues

Civo: Some paginated functions don't "paginate"

It seems that some API endpoints that expect pagination don't take it in as pagination.

For example, /v2/objectstores expects a page and perPage params. However the SDK does not support passing it, the ListObjectStores() receives no arguments, essentially grabbing page 1 only.

https://github.com/civo/civogo/blob/v0.3.79/objectstore.go#L58-L71

Compare that function to ListObjectStoreCredentials that does take a page and perPage:

https://github.com/civo/civogo/blob/v0.3.79/objectstore_credential.go#L46-L64

I naively thought they were using some sort of magic when setting the Page value of the returned output (since it was a pointer) but realized that couldn't have worked if it would've got a copy of the pointer instead.

It's possible to use civogo's SendXXXRequest() functions and craft our own URLs:

https://pkg.go.dev/github.com/civo/civogo#Client.SendGetRequest
https://pkg.go.dev/github.com/civo/civogo#Client.SendPostRequest

Limit output during environment scan

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.