-
Notifications
You must be signed in to change notification settings - Fork 60
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
Genericize and consolidate kubectl delete
operations
#198
Genericize and consolidate kubectl delete
operations
#198
Conversation
Codecov Report
@@ Coverage Diff @@
## master #198 +/- ##
==========================================
- Coverage 43.60% 42.94% -0.67%
==========================================
Files 28 28
Lines 1509 1474 -35
==========================================
- Hits 658 633 -25
+ Misses 851 841 -10
Continue to review full report at Codecov.
|
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.
Great!
Relates to #69.
Currently, we define one function for
delete
-ing all entities of a given resource type, for each of a finite set of resources, e.g.k8s-kubectl-delete-{pods, nodes, ...}
. All of these functions are identical save for the resource type that they retrieve.As such, we generalize to a single implementation—
k8s-kubectl-delete
—that accepts the resource type name and performs thedelete
accordingly.We additionally clean up unit tests and, finally, remove the granular, per-type
get
functions.In particular, with regards to unit tests, we observe that, once the resource type name is abstracted away, there's no practical reason to have one test case for each resource type. As such, rather than consolidate all per-type test cases into a single test function, we simply keep one case for each of the two scenarios "delete success" and "delete fail," and remove the rest of the test functions as superfluous.