-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Add Kubectl delete tests #2906
Add Kubectl delete tests #2906
Conversation
/cc @brendandburns Hi, whenever you're free, can you give me your feedback on my changes? |
I have hard coded more http returns, but now it passes even when it should error for the second call. I am able to get it to error if I create a normal file that isn't a test and use Kubectl there. I feel like I am missing a crucial part of mocking these http calls |
new File( | ||
KubectlDeleteTest.class | ||
.getClassLoader() | ||
.getResource("discovery-api-v1.json") |
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 use getResourceAsStream()
and load this into a byte array instead of the File
stuff, I find it confusing to read.
.willReturn( | ||
aResponse() | ||
.withStatus(201) | ||
.withBody(new String(Files.readAllBytes(Paths.get(ADD_JOB)))))); |
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.
Once you convert to byte array/string above, you can simplify this code.
Thanks for adding tests!! One small comment on simplifying the way resources are loaded, then LGTM. |
fafd4d7
to
fc32b50
Compare
/lgtm Thanks for the quick changes! |
|
verified that the code does compile on Java 8 and 17, should work now |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: awesominat, brendandburns 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 |
this PR aims to add tests to Kubectl.delete and its ignoreNotFound method.
I'm currently having issues getting it to work. I can't get Kubect.delete to recognize V1Job as a namespaced class if I setKubectlDelete\<V1Job>
's ApiClient. If I don't set the ApiClient, then executing delete fails to connect to local host.I'm considering executingModelMapper.addModelMap
to add V1Job as namespaced class for Kubectl.delete to execute, but I'd like feedback on whether the changes I've made make sense or should be refactored.