kubernetes-client icon indicating copy to clipboard operation
kubernetes-client copied to clipboard

Added Kubectl equivalent example for Creating Resource Quota

Open Ananya2001-an opened this issue 3 years ago • 21 comments

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 avatar Jul 10 '22 06:07 Ananya2001-an

@Ananya2001-an : Could you please address build failures?

rohanKanojia avatar Jul 20 '22 14:07 rohanKanojia

@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 avatar Jul 20 '22 15:07 Ananya2001-an

@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 avatar Jul 20 '22 17:07 rohanKanojia

@rohanKanojia Made requested changes.

Ananya2001-an avatar Jul 20 '22 18:07 Ananya2001-an

@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 avatar Jul 21 '22 05:07 rohanKanojia

@rohanKanojia No I didn't. I am really sorry for the inconvenience. I will properly test everything now and then push commits.

Ananya2001-an avatar Jul 21 '22 06:07 Ananya2001-an

@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 avatar Jul 21 '22 08:07 Ananya2001-an

@Ananya2001-an : Could you please push your changes?

rohanKanojia avatar Jul 21 '22 09:07 rohanKanojia

@rohanKanojia yes I will

Ananya2001-an avatar Jul 21 '22 09:07 Ananya2001-an

@rohanKanojia Pushed changes. Kindly check.

Ananya2001-an avatar Jul 21 '22 10:07 Ananya2001-an

@rohanKanojia Why are the tests still failing? Are there still some compilation issues?

Ananya2001-an avatar Jul 21 '22 14:07 Ananya2001-an

Yes, I don't think you verified your changes. If you check builg logs you should be able to see them

rohanKanojia avatar Jul 21 '22 14:07 rohanKanojia

How to check the build logs after running mvn clean install?

Ananya2001-an avatar Jul 21 '22 15:07 Ananya2001-an

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 avatar Jul 21 '22 16:07 rohanKanojia

@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.

Ananya2001-an avatar Jul 21 '22 18:07 Ananya2001-an

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]

rohanKanojia avatar Jul 22 '22 05:07 rohanKanojia

Okay got it. Sorry for the trouble.

Ananya2001-an avatar Jul 22 '22 06:07 Ananya2001-an

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

sonarqubecloud[bot] avatar Jul 25 '22 06:07 sonarqubecloud[bot]

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

sonarqubecloud[bot] avatar Aug 26 '22 10:08 sonarqubecloud[bot]

@Ananya2001-an : polite ping, are you still working on this?

rohanKanojia avatar Sep 09 '22 12:09 rohanKanojia

@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.

Ananya2001-an avatar Sep 09 '22 13:09 Ananya2001-an

Hi @Ananya2001-an This PR is becoming stale, are you still working on this?

manusa avatar Oct 19 '22 07:10 manusa

Hi @manusa I will do it within 3 days. Really sorry for the delay. Got caught up in some work.

Ananya2001-an avatar Oct 19 '22 07:10 Ananya2001-an

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

sonarqubecloud[bot] avatar Feb 28 '23 05:02 sonarqubecloud[bot]