-
Notifications
You must be signed in to change notification settings - Fork 6
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
fix cleanup of resources #81
Conversation
Signed-off-by: Matthias Bertschy <[email protected]>
Summary:
|
PR Description updated to latest commit (d2d9042) |
PR Analysis
PR Feedback💡 General suggestions: It would be beneficial to add unit tests for the new functionalities introduced in this PR. This will help ensure the correctness of the code and prevent potential regressions in the future. Also, consider using constants for string literals that are used multiple times in the code, such as "CLEANUP_INTERVAL". 🤖 Code feedback:
✨ Usage tips:
|
Summary:
|
pkg/cleanup/discovery.go
Outdated
"job", | ||
"lease", | ||
"namespace", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure about this?
Summary:
|
Signed-off-by: Matthias Bertschy <[email protected]>
ad5e438
to
f5e4e15
Compare
Signed-off-by: Matthias Bertschy <[email protected]>
Summary:
|
Type
bug_fix, enhancement
Description
PR changes walkthrough
1 files
main.go
main.go
The cleanup interval for resources is now configurable
through an environment variable. If the environment variable
is not set or cannot be parsed, a default value of 24 hours
is used. The cleanup handler is updated to use the new
configurable interval.
1 files
cleanup.go
pkg/cleanup/cleanup.go
The cleanup handler's logging has been improved to include
the cleanup interval when a cleanup task starts and to log
deletions at the debug level. The metadata loading function
has been updated to also load labels from the metadata file.
The function to delete resources by template hash or wlid
has been updated to look for the template hash in the labels
instead of the annotations. Some unused code has been
removed.
1 files
discovery.go
pkg/cleanup/discovery.go
The list of workloads to cleanup has been reduced to only
include cronjob, daemonset, deployment, job, pod,
replicaset, and statefulset. The functions to fetch wlids
from running workloads and to fetch instance IDs and image
IDs and replicas from running pods have been updated to
improve logging and remove unused code.