kubernetes-client
kubernetes-client copied to clipboard
Added Kubectl equivalent example for Creating Resource Quota
Description
Fix #4267
Type of change
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] Feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change
- [x] Chore (non-breaking change which doesn't affect codebase; test, version modification, documentation, etc.)
Checklist
- [x] Code contributed by me aligns with current project license: Apache 2.0
- [ ] I Added CHANGELOG entry regarding this change
- [x] I have implemented unit tests to cover my changes
- [ ] I have added/updated the javadocs and other documentation accordingly
- [x] No new bugs, code smells, etc. in SonarCloud report
- [ ] I tested my code in Kubernetes
- [ ] I tested my code in OpenShift
In ref. to issue #4267
@Ananya2001-an : Could you please address build failures?
@rohanKanojia yeah I will surely look into it but can u guide me regarding these tests because I am not well versed with it.
@Ananya2001-an : Build failure isn't caused by failing tests. It seems to be a compilation issue:
Caused by: org.apache.maven.plugin.compiler.CompilationFailureException: Compilation failure
/home/runner/work/kubernetes-client/kubernetes-client/kubernetes-examples/src/main/java/io/fabric8/kubernetes/examples/kubectl/equivalents/CreateResourceQuotaInNamespaceYamlEquivalent.java:[33,83] cannot find symbol
symbol: variable myspace
@rohanKanojia Made requested changes.
@Ananya2001-an : You still haven't addressed compilation failures. Build is going to fail again. Have you verified your changes build okay using mvn clean install as mentioned in Contributions Guide?
@rohanKanojia No I didn't. I am really sorry for the inconvenience. I will properly test everything now and then push commits.
@rohanKanojia I have solved the compilation issue but after running tests I am still getting build failure due to some serialization test. The only problem with my changes was the variable myspace which I have now converted to a string. And I feel it should work now.
@Ananya2001-an : Could you please push your changes?
@rohanKanojia yes I will
@rohanKanojia Pushed changes. Kindly check.
@rohanKanojia Why are the tests still failing? Are there still some compilation issues?
Yes, I don't think you verified your changes. If you check builg logs you should be able to see them
How to check the build logs after running mvn clean install?
I'm not able to understand your question. Are you asking how to check build job logs?
https://github.com/fabric8io/kubernetes-client/runs/7447480859?check_suite_focus=true
@rohanKanojia I have not rebased my PR till now. Do u think that's the cause for compilation error? I ran the tests again after changing namespace to "default" but still got the same error. I have done the formatting of files as well by calling mvn spotless:apply which resulted in success but other tests were failing as usual.
I'm not sure how to make myself more clear. Build is failing because you're missing an import. It's just a minor compilation issue:
Error: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.10.1:compile (default-compile) on project kubernetes-examples: Compilation failure
Error: /home/runner/work/kubernetes-client/kubernetes-client/kubernetes-examples/src/main/java/io/fabric8/kubernetes/examples/kubectl/equivalents/CreateResourceQuotaInNamespaceYamlEquivalent.java:[35,50] cannot find symbol
Error: symbol: class Quantity
Error: location: class io.fabric8.kubernetes.examples.kubectl.equivalents.CreateResourceQuotaInNamespaceYamlEquivalent
Error: -> [Help 1]
Okay got it. Sorry for the trouble.
Kudos, SonarCloud Quality Gate passed! 
0 Bugs
0 Vulnerabilities
0 Security Hotspots
1 Code Smell
No Coverage information
0.0% Duplication
Kudos, SonarCloud Quality Gate passed! 
0 Bugs
0 Vulnerabilities
0 Security Hotspots
1 Code Smell
No Coverage information
0.0% Duplication
@Ananya2001-an : polite ping, are you still working on this?
@rohanKanojia Hey. Sorry for the late response. I do want to continue working on this. I am actually bit occupied with some work which will take 2 more weeks to finish. But after that I will definitely make the suggested changes. I hope it's fine.
Hi @Ananya2001-an This PR is becoming stale, are you still working on this?
Hi @manusa I will do it within 3 days. Really sorry for the delay. Got caught up in some work.
Kudos, SonarCloud Quality Gate passed! 
0 Bugs
0 Vulnerabilities
0 Security Hotspots
0 Code Smells
No Coverage information
0.0% Duplication