Skip to content

Commit

Permalink
Merge branch 'eclipse-jkube:master' into sonar-ai-codefix
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanvila authored Dec 3, 2024
2 parents 6517df5 + 4ad83f7 commit 6c33674
Show file tree
Hide file tree
Showing 37 changed files with 153 additions and 252 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: Setup Java 17
uses: actions/setup-java@b36c23c0d998641eff861008f374ee103c25ac73
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b
with:
java-version: '17'
distribution: 'temurin'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: Setup Java 17
uses: actions/setup-java@b36c23c0d998641eff861008f374ee103c25ac73
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b
with:
java-version: '17'
distribution: 'temurin'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/license.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: Setup Java 11
uses: actions/setup-java@b36c23c0d998641eff861008f374ee103c25ac73
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b
with:
java-version: '11'
distribution: 'adopt'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/quickstarts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: Setup Java 17
uses: actions/setup-java@b36c23c0d998641eff861008f374ee103c25ac73
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b
with:
java-version: '17'
distribution: 'temurin'
Expand Down
4 changes: 2 additions & 2 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.6/apache-maven-3.8.6-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.1/maven-wrapper-3.1.1.jar
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.3.2/maven-wrapper-3.3.2.jar
2 changes: 0 additions & 2 deletions gradle-plugin/it/src/it/helidon-properties/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ ext {
}

repositories {
mavenLocal()
mavenCentral()
gradlePluginPortal()
}

dependencies {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class DependencyResourcesIT {
void k8sResource_whenRun_generatesK8sManifestsIncludingDependencies() throws IOException, ParseException {
// When
final BuildResult result = gradleRunner.withITProject("dependency-resources")
.withArguments("clean", "jar", "k8sResource", "--stacktrace")
.withArguments("jar", "k8sResource", "--stacktrace")
.build();
// Then
ResourceVerify.verifyResourceDescriptors(
Expand All @@ -49,12 +49,12 @@ void k8sResource_whenRun_generatesK8sManifestsIncludingDependencies() throws IOE
void k8sResource_whenRunWithReplicas_generatesK8sManifestsIncludingDependencies() throws IOException, ParseException {
// When
final BuildResult result = gradleRunner.withITProject("dependency-resources")
.withArguments("-Pjkube.replicas=1337", "clean", "jar", "k8sResource", "--stacktrace")
.withArguments("-Pjkube.targetDir=build/classes/java/main/META-INF/jkube-replicas-override", "-Pjkube.replicas=1337", "jar", "k8sResource", "--stacktrace")
.build();
// Then
ResourceVerify.verifyResourceDescriptors(
gradleRunner.resolveFile("dependent", "build", "classes", "java", "main",
"META-INF", "jkube", "kubernetes.yml"),
"META-INF", "jkube-replicas-override", "kubernetes.yml"),
gradleRunner.resolveFile("expected", "kubernetes-with-replica-override.yml"));
assertThat(result).extracting(BuildResult::getOutput).asString()
.contains("Using resource templates from")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/
package org.eclipse.jkube.gradle.plugin.tests;

import net.minidev.json.parser.ParseException;

import org.eclipse.jkube.kit.common.ResourceVerify;
import org.gradle.testkit.runner.BuildResult;
import org.junit.jupiter.api.Test;
Expand Down
54 changes: 2 additions & 52 deletions gradle-plugin/kubernetes/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,9 @@
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
<version>${version.groovy}</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gradle</groupId>
Expand Down Expand Up @@ -206,56 +208,4 @@
It's unrealistic to add a dependency for each of the gradle subprojects
-->
</dependencies>

<!-- TODO: Remove once JMockit is no longer in the project -->
<profiles>
<profile>
<id>jacoco</id>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${version.jacoco}</version>
<executions>
<execution>
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>default-report</id>
<goals>
<goal>report</goal>
</goals>
</execution>
<execution>
<id>instrument</id>
<phase>none</phase>
</execution>
<execution>
<id>restore</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<systemPropertyVariables>
<!-- JaCoCo runtime must know where to dump coverage: -->
<jacoco-agent.destfile>target/jacoco.exec</jacoco-agent.destfile>
</systemPropertyVariables>
<environmentVariables>
<LC_ALL>en_EN.UTF-8</LC_ALL>
</environmentVariables>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<!-- ///////////////////////////////////////////////////// -->
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ private static List<Dependency> extractDependenciesWithTransitive(Project gradle

private static List<Dependency> extractDependencies(Project gradleProject,
Function<ResolutionResult, Set<? extends DependencyResult>> resolutionToDependency) {
return new ArrayList<Configuration>(gradleProject.getConfigurations()).stream()
return new ArrayList<>(gradleProject.getConfigurations()).stream()
.filter(GradleUtil::canBeResolved)
.flatMap(c -> {
final Map<ComponentIdentifier, ResolvedArtifactResult> artifacts = artifactMap(c);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
package org.eclipse.jkube.gradle.plugin.task;

import org.eclipse.jkube.gradle.plugin.KubernetesExtension;
import org.eclipse.jkube.kit.resource.helm.HelmConfig;


import javax.inject.Inject;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
package org.eclipse.jkube.gradle.plugin.task;

import org.eclipse.jkube.gradle.plugin.KubernetesExtension;
import org.eclipse.jkube.kit.resource.helm.HelmConfig;

import javax.inject.Inject;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
package org.eclipse.jkube.gradle.plugin.task;

import org.eclipse.jkube.gradle.plugin.KubernetesExtension;
import org.eclipse.jkube.kit.resource.helm.HelmConfig;

import javax.inject.Inject;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
package org.eclipse.jkube.gradle.plugin.task;

import org.eclipse.jkube.gradle.plugin.KubernetesExtension;
import org.eclipse.jkube.kit.resource.helm.HelmConfig;

import javax.inject.Inject;
import java.io.File;
Expand Down
54 changes: 2 additions & 52 deletions gradle-plugin/openshift/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
<version>${version.groovy}</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gradle</groupId>
Expand Down Expand Up @@ -103,56 +105,4 @@
It's unrealistic to add a dependency for each of the gradle subprojects
-->
</dependencies>

<!-- TODO: Remove once JMockit is no longer in the project -->
<profiles>
<profile>
<id>jacoco</id>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${version.jacoco}</version>
<executions>
<execution>
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>default-report</id>
<goals>
<goal>report</goal>
</goals>
</execution>
<execution>
<id>instrument</id>
<phase>none</phase>
</execution>
<execution>
<id>restore</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<systemPropertyVariables>
<!-- JaCoCo runtime must know where to dump coverage: -->
<jacoco-agent.destfile>target/jacoco.exec</jacoco-agent.destfile>
</systemPropertyVariables>
<environmentVariables>
<LC_ALL>en_EN.UTF-8</LC_ALL>
</environmentVariables>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<!-- ///////////////////////////////////////////////////// -->
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
package org.eclipse.jkube.kit.build.api.auth.handler;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

import java.io.IOException;
import java.net.InetAddress;
import java.net.UnknownHostException;

import org.eclipse.jkube.kit.common.KitLogger;
import org.apache.http.config.Registry;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ final class NpipeConnectionSocketFactory extends AbstractNativeSocketFactory {
}

@Override
public Socket createSocket(HttpContext context) throws IOException {
public Socket createSocket(HttpContext context) {
return new NamedPipe(log);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ private Git createDummyGitRepository(File gitFolder) throws GitAPIException, URI
Git git = Git.init().setDirectory(gitFolder).setInitialBranch("test-branch").call();
git.add().addFilepattern(".").call();
git.remoteAdd().setName("origin").setUri(new URIish("https://example.com/origin.git")).call();
git.commit().setMessage("Initial commit").call();
git.commit().setMessage("Initial commit").setSign(false).call();
return git;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@
import org.eclipse.jkube.kit.common.JKubeException;
import org.eclipse.jkube.kit.common.KitLogger;
import org.eclipse.jkube.kit.common.util.KubernetesHelper;
import org.eclipse.jkube.kit.config.image.build.JKubeBuildStrategy;
import org.eclipse.jkube.kit.config.service.portforward.PortForwardPodWatcher;

import io.fabric8.kubernetes.api.model.Container;
import io.fabric8.kubernetes.api.model.ContainerPort;
import io.fabric8.kubernetes.api.model.EnvVar;
Expand Down
3 changes: 0 additions & 3 deletions jkube-kit/doc/src/main/asciidoc/inc/_introduction.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,3 @@ This repository covers the following abstraction which helps you to flexibly cre
* **Profiles** combine a set of generator and enrichers with a configuration and give it a name so that the used generators and enrichers can be tuned to the details.

[plantuml,jkube-kit-components]
....
include::diagrams/overview.plantuml[tags=uml]
....
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
import java.util.Arrays;
import java.util.Properties;


import io.fabric8.kubernetes.api.model.ServicePort;
import org.assertj.core.api.InstanceOfAssertFactories;
import org.eclipse.jkube.kit.common.JavaProject;
import org.eclipse.jkube.kit.common.KitLogger;
import io.fabric8.kubernetes.api.model.ObjectMeta;
Expand Down Expand Up @@ -69,7 +72,7 @@ void defaultValuesAndEmptyOriginal() {
.isInstanceOf(Service.class)
.hasFieldOrPropertyWithValue("spec.type", null)
.extracting("spec.ports")
.asList()
.asInstanceOf(InstanceOfAssertFactories.list(ServicePort.class))
.extracting("name", "port", "protocol")
.containsOnly(new Tuple("http", 80, "TCP"));
}
Expand All @@ -88,7 +91,7 @@ void defaultValuesAndOriginalWithPorts() {
.isInstanceOf(Service.class)
.hasFieldOrPropertyWithValue("spec.type", null)
.extracting("spec.ports")
.asList()
.asInstanceOf(InstanceOfAssertFactories.list(ServicePort.class))
.extracting("name", "port", "protocol")
.containsOnly(new Tuple("menandmice-dns", 1337, "TCP"));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ void setUp() throws Exception {
git = Git.init().setDirectory(baseDirectory).setInitialBranch("test-branch").call();
git.add().addFilepattern(".").call();
git.remoteAdd().setName("origin").setUri(new URIish("https://example.com/origin.git")).call();
commit = git.commit().setMessage("Initial commit").call();
commit = git.commit().setMessage("Initial commit").setSign(false).call();
}


Expand Down
Loading

0 comments on commit 6c33674

Please sign in to comment.