Skip to content
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

Fix #1053: Add ocHelm task to OpenShift Gradle Plugin #1072

Merged
merged 5 commits into from
Oct 27, 2021

Conversation

rohanKanojia
Copy link
Member

Description

Fix #1053

Ported OpenShiftHelmMojo to openshift gradle plugin .Implement oc:helm equivalent functionality ocHelm for OpenShift
Gradle Plugin.

Signed-off-by: Rohan Kumar [email protected]

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
  • Chore (non-breaking change which doesn't affect codebase;
    test, version modification, documentation, etc.)

Checklist

@codecov
Copy link

codecov bot commented Oct 27, 2021

Codecov Report

Merging #1072 (0fa094e) into master (4848968) will increase coverage by 0.02%.
The diff coverage is 86.36%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1072      +/-   ##
============================================
+ Coverage     48.95%   48.98%   +0.02%     
- Complexity     3630     3634       +4     
============================================
  Files           455      456       +1     
  Lines         20738    20752      +14     
  Branches       2827     2827              
============================================
+ Hits          10153    10165      +12     
- Misses         9499     9501       +2     
  Partials       1086     1086              
Impacted Files Coverage Δ
...kube/gradle/plugin/task/OpenShiftUndeployTask.java 100.00% <ø> (ø)
...ube/maven/plugin/mojo/build/OpenshiftHelmMojo.java 0.00% <0.00%> (ø)
...clipse/jkube/gradle/plugin/OpenShiftExtension.java 86.36% <80.00%> (+2.15%) ⬆️
...e/jkube/gradle/plugin/task/KubernetesHelmTask.java 93.75% <100.00%> (+0.89%) ⬆️
...ube/gradle/plugin/task/KubernetesUndeployTask.java 86.36% <100.00%> (-0.60%) ⬇️
...g/eclipse/jkube/gradle/plugin/OpenShiftPlugin.java 100.00% <100.00%> (ø)
...se/jkube/gradle/plugin/task/OpenShiftHelmTask.java 100.00% <100.00%> (ø)
...clipse/jkube/maven/plugin/mojo/build/HelmMojo.java 84.21% <100.00%> (+1.85%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4848968...0fa094e. Read the comment docs.

Move manifest not found warning message into a method so that it can be
overridden in case of OpenShiftHelmMojo

Signed-off-by: Rohan Kumar <[email protected]>
…fests and template

The property name seems to be a typo and openshiftManifest field should
have `jkube.openshiftManifest` as property name instead of
`jkube.kubernetesManifest`

Signed-off-by: Rohan Kumar <[email protected]>
Implement `oc:helm` equivalent functionality `ocHelm` for OpenShift
Gradle Plugin.

Signed-off-by: Rohan Kumar <[email protected]>
We had getOpenShiftManifestOrDefault method in OpenShiftExtension which
was used for getting openshift manifests in case of OpenShift. However,
this seemed redundant as we had getManifest method in
KubernetesExtension(overridden in OpenShiftExtension) for same task.

To keep it simple, remove getOpenShiftManifstOrDefault method from
OpenShiftExtension and override getKubernetesManifestOrDefault method
in OpenShiftExtension

Signed-off-by: Rohan Kumar <[email protected]>
Comment on lines +119 to +121
public File getKubernetesTemplateOrDefault() {
return getOrDefaultFile("jkube.kubernetesTemplate", this::getKubernetesTemplate, javaProject.getOutputDirectory().toPath().resolve(DEFAULT_OPENSHIFT_TEMPLATE).toFile());
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a test for this in KubernetesExtensionPropertyTest + OpenShiftExtensionPropertyTest

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a test already in KubernetesExtensionPropertyTest, I'll add the test in OpenShiftExtensionPropertyTest

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 I was checking on an outdated branch

…efault

Add test for getKubernetesTemplateOrDefault's overridden implementation
in OpenShiftExtension

Signed-off-by: Rohan Kumar <[email protected]>
@rohanKanojia rohanKanojia marked this pull request as ready for review October 27, 2021 11:52
@sonarcloud
Copy link

sonarcloud bot commented Oct 27, 2021

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

85.0% 85.0% Coverage
1.2% 1.2% Duplication

@manusa manusa merged commit bcadf0d into eclipse-jkube:master Oct 27, 2021
@rohanKanojia rohanKanojia deleted the pr/issue1053 branch October 27, 2021 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OpenShiftHelmTask: Implement oc:helm equivalent functionality ocHelm for OpenShift Gradle Plugin
2 participants