lwolf / kube-cleanup-operator

Kubernetes Operator to automatically delete completed Jobs and their Pods
MIT License
503 stars 109 forks source link

Feature/keepfilters #7

Closed aalubin closed 6 years ago

aalubin commented 6 years ago

Added two parameters and the login to handle them

  1. keep-successful - Number of days to keep successful pods. -1 forever, 0 never, >0 number of days
  2. keep-failed - Number of days to keep failed pods (same values)

Defaults were set to maintain current behavior.

Note that I changed the static linking of pkg/controller to aalubin and it should be returned to lwolf.

lwolf commented 6 years ago

Thanks @aalubin for your work. This looks like a good start for making operator more configurable.

I think defaults should be reversed (forever for failed and never for successful), it would then behave as it is now.

May be it will be more useful to use hours instead of days as a minimum unit?

aalubin commented 6 years ago

I agree to both. I will update on Sunday.

lwolf commented 6 years ago

great, could you also change linking to this repo, so I could merge it

aalubin commented 6 years ago

Both changes pushed in addition to a new flag "dry-run" that enables...dry run :)