-
Notifications
You must be signed in to change notification settings - Fork 115
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
Global prune 2 #612
Global prune 2 #612
Conversation
62c4cdc
to
3cc40d8
Compare
For sanity checking purposes, can you please post what this list actually is in the oldest and newest k8s versions we currently support? |
We intentionally black list Node and Namespace. I can't really see a reason where pruning a Node is a good idea. Pruning a Namespace is more reasonable but really dangerous. 1.11.10"/v1/PersistentVolume", 1.16.1"/v1/PersistentVolume", |
7b616f1
to
fa17169
Compare
d4244b8
to
7c85a9f
Compare
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.
One question but I think this looks pretty good to me.
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.
I'd also like to see a test that shows pruning behaves correctly with custom resources, when both a namespaced and a global CR exist.
@@ -116,4 +126,54 @@ def test_global_deploy_task_failure | |||
"Template validation failed", | |||
]) | |||
end | |||
|
|||
def test_global_deploy_prune_black_box_success | |||
assert_deploy_success(deploy_global_fixtures('globals', clean_up: false, selector: 'test=prune1')) |
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.
same question, should we be adding this selector to the generated one so we don't have to hope future contributors won't reuse this manual selector?
"Successful resources", | ||
"StorageClass/testing-storage-class", | ||
]) | ||
assert_deploy_success(deploy_global_fixtures('globals', selector: 'test=prune2')) |
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.
we should refute that the logs include "[pP]rune[d]"
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.
We use the test name to modify the fixture name, so if we refute 'prune' we can't use 'prune' in the test name. Instead I'm refuting 'pruned'.
5310285
to
afcff78
Compare
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.
I added a small question, but this makes sense to me. 👍
@@ -103,6 +103,14 @@ def build_storage_v1_kubeclient(context) | |||
) | |||
end | |||
|
|||
def build_scheduling_v1beta1_kubeclient(context) |
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.
Is this actually necessary? I tried removing this and running tests but they keep passing; I tested with the tests modified/added in this PR:
$ alias rt="bundle exec ruby -I test"
$ rt test/integration-serial/serial_deploy_test.rb --name test_global_deploy_prune_black_box_success
$ rt test/integration/global_deploy_test.rb
$ rt test/unit/cluster_resource_discovery_test.rb
Am I missing anything?
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.
build_scheduling_v1beta1_kubeclient
are mostly used in the tests to allow for manual interaction with resources, usually to delete them in an ensure block. They aren't being used but seemed less than ideal to add a new kind to the fixtures but not add its helper methods.
What are you trying to accomplish with this PR?
Add pruning by default to global deploy
How is this accomplished?
Fetch a list of global resources that are pruneable (everything that supports delete) exclude node and namespace since I can't image we'd actually want to ever prune these and then pass them as the list of resources to prune.
What could go wrong?
Worst case is that we are including something in the prune list we shouldn't