-
Notifications
You must be signed in to change notification settings - Fork 2k
Added support for passing delete options when using kubectlDelete.#3463 #3572
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
Added support for passing delete options when using kubectlDelete.#3463 #3572
Conversation
@@ -207,6 +209,9 @@ void kubectlDelete() throws KubectlException, ApiException { | |||
KubectlDelete<V1Job> kubectlDelete = Kubectl.delete(V1Job.class); | |||
kubectlDelete.apiClient(apiClient); | |||
kubectlDelete.namespace("foo").name("bar"); | |||
DeleteOptions deleteOptions = new DeleteOptions(); | |||
deleteOptions.setPropagationPolicy("Foreground"); | |||
kubectlDelete.deleteOptions(deleteOptions); |
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.
Can you add validation that this worked correctly to the URL validation below
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.
Added check below for URL validation and you were correct it was not passing deleteOptions, hence modified GenericKubernetesApi to pass it further
Thanks for the PR. I think you need to run |
…e testcase to check for url verify
@@ -1159,6 +1159,7 @@ private CallBuilder makeNamespacedDeleteCallBuilder( | |||
namespace, | |||
this.resourcePlural, | |||
name) | |||
.body(deleteOptions) | |||
// TODO: fill/convert the option |
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.
Should we remove this TODO as this is no more valid?
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.
Yes, please delete this now.
Done both the changes, please review |
Thanks for adding the test, and fixing the code. I think it still needs formatting, and that TODO removed, but then I think it's good to merge. |
Removed the TODO, and also rerun mvn spotless:apply to make sure formatting apply. |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: brendandburns, callingmahendra The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
closes: #3463
Added an option to pass deleteOptions in kubectlDelete.