diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml index 095fa2851d..24e33a6a52 100644 --- a/.github/workflows/build-macos.yml +++ b/.github/workflows/build-macos.yml @@ -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' diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index 1cde57c7e3..69e99bf1d5 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -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' diff --git a/.github/workflows/license.yml b/.github/workflows/license.yml index 73e46fc643..62c20e11c1 100644 --- a/.github/workflows/license.yml +++ b/.github/workflows/license.yml @@ -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' diff --git a/.github/workflows/quickstarts.yml b/.github/workflows/quickstarts.yml index 9a539d03da..7312135bde 100644 --- a/.github/workflows/quickstarts.yml +++ b/.github/workflows/quickstarts.yml @@ -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' diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties index dc3affce3d..b9b1153ae4 100644 --- a/.mvn/wrapper/maven-wrapper.properties +++ b/.mvn/wrapper/maven-wrapper.properties @@ -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 diff --git a/gradle-plugin/it/src/it/helidon-properties/build.gradle b/gradle-plugin/it/src/it/helidon-properties/build.gradle index 5cdbf4c954..c47b46a08b 100644 --- a/gradle-plugin/it/src/it/helidon-properties/build.gradle +++ b/gradle-plugin/it/src/it/helidon-properties/build.gradle @@ -33,9 +33,7 @@ ext { } repositories { - mavenLocal() mavenCentral() - gradlePluginPortal() } dependencies { diff --git a/gradle-plugin/it/src/test/java/org/eclipse/jkube/gradle/plugin/tests/DependencyResourcesIT.java b/gradle-plugin/it/src/test/java/org/eclipse/jkube/gradle/plugin/tests/DependencyResourcesIT.java index 0792d7d0ed..a7b11d4917 100644 --- a/gradle-plugin/it/src/test/java/org/eclipse/jkube/gradle/plugin/tests/DependencyResourcesIT.java +++ b/gradle-plugin/it/src/test/java/org/eclipse/jkube/gradle/plugin/tests/DependencyResourcesIT.java @@ -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( @@ -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") diff --git a/gradle-plugin/it/src/test/java/org/eclipse/jkube/gradle/plugin/tests/SecurityHardeningIT.java b/gradle-plugin/it/src/test/java/org/eclipse/jkube/gradle/plugin/tests/SecurityHardeningIT.java index e26aba5f90..af9da96008 100644 --- a/gradle-plugin/it/src/test/java/org/eclipse/jkube/gradle/plugin/tests/SecurityHardeningIT.java +++ b/gradle-plugin/it/src/test/java/org/eclipse/jkube/gradle/plugin/tests/SecurityHardeningIT.java @@ -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; diff --git a/gradle-plugin/kubernetes/pom.xml b/gradle-plugin/kubernetes/pom.xml index fe305b6f76..4c2a621ff1 100644 --- a/gradle-plugin/kubernetes/pom.xml +++ b/gradle-plugin/kubernetes/pom.xml @@ -153,7 +153,9 @@ org.codehaus.groovy groovy-all + ${version.groovy} pom + provided org.gradle @@ -206,56 +208,4 @@ It's unrealistic to add a dependency for each of the gradle subprojects --> - - - - - jacoco - - - - org.jacoco - jacoco-maven-plugin - ${version.jacoco} - - - default-prepare-agent - - prepare-agent - - - - default-report - - report - - - - instrument - none - - - restore - none - - - - - org.apache.maven.plugins - maven-surefire-plugin - - - - target/jacoco.exec - - - en_EN.UTF-8 - - - - - - - - diff --git a/gradle-plugin/kubernetes/src/main/java/org/eclipse/jkube/gradle/plugin/GradleUtil.java b/gradle-plugin/kubernetes/src/main/java/org/eclipse/jkube/gradle/plugin/GradleUtil.java index 4825680af8..0f79efaac4 100644 --- a/gradle-plugin/kubernetes/src/main/java/org/eclipse/jkube/gradle/plugin/GradleUtil.java +++ b/gradle-plugin/kubernetes/src/main/java/org/eclipse/jkube/gradle/plugin/GradleUtil.java @@ -114,7 +114,7 @@ private static List extractDependenciesWithTransitive(Project gradle private static List extractDependencies(Project gradleProject, Function> resolutionToDependency) { - return new ArrayList(gradleProject.getConfigurations()).stream() + return new ArrayList<>(gradleProject.getConfigurations()).stream() .filter(GradleUtil::canBeResolved) .flatMap(c -> { final Map artifacts = artifactMap(c); diff --git a/gradle-plugin/kubernetes/src/main/java/org/eclipse/jkube/gradle/plugin/task/KubernetesHelmDependencyUpdateTask.java b/gradle-plugin/kubernetes/src/main/java/org/eclipse/jkube/gradle/plugin/task/KubernetesHelmDependencyUpdateTask.java index db15bc36aa..5ecd27bb5c 100644 --- a/gradle-plugin/kubernetes/src/main/java/org/eclipse/jkube/gradle/plugin/task/KubernetesHelmDependencyUpdateTask.java +++ b/gradle-plugin/kubernetes/src/main/java/org/eclipse/jkube/gradle/plugin/task/KubernetesHelmDependencyUpdateTask.java @@ -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; diff --git a/gradle-plugin/kubernetes/src/main/java/org/eclipse/jkube/gradle/plugin/task/KubernetesHelmLintTask.java b/gradle-plugin/kubernetes/src/main/java/org/eclipse/jkube/gradle/plugin/task/KubernetesHelmLintTask.java index d077cc673d..7a3c14295a 100644 --- a/gradle-plugin/kubernetes/src/main/java/org/eclipse/jkube/gradle/plugin/task/KubernetesHelmLintTask.java +++ b/gradle-plugin/kubernetes/src/main/java/org/eclipse/jkube/gradle/plugin/task/KubernetesHelmLintTask.java @@ -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; diff --git a/gradle-plugin/kubernetes/src/main/java/org/eclipse/jkube/gradle/plugin/task/KubernetesHelmPushTask.java b/gradle-plugin/kubernetes/src/main/java/org/eclipse/jkube/gradle/plugin/task/KubernetesHelmPushTask.java index 7490e3cb87..8ba5b40a4e 100644 --- a/gradle-plugin/kubernetes/src/main/java/org/eclipse/jkube/gradle/plugin/task/KubernetesHelmPushTask.java +++ b/gradle-plugin/kubernetes/src/main/java/org/eclipse/jkube/gradle/plugin/task/KubernetesHelmPushTask.java @@ -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; diff --git a/gradle-plugin/kubernetes/src/main/java/org/eclipse/jkube/gradle/plugin/task/KubernetesHelmTask.java b/gradle-plugin/kubernetes/src/main/java/org/eclipse/jkube/gradle/plugin/task/KubernetesHelmTask.java index 962494565c..7e65f9f570 100644 --- a/gradle-plugin/kubernetes/src/main/java/org/eclipse/jkube/gradle/plugin/task/KubernetesHelmTask.java +++ b/gradle-plugin/kubernetes/src/main/java/org/eclipse/jkube/gradle/plugin/task/KubernetesHelmTask.java @@ -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; diff --git a/gradle-plugin/openshift/pom.xml b/gradle-plugin/openshift/pom.xml index 01bca5c4de..e852cf3bc0 100644 --- a/gradle-plugin/openshift/pom.xml +++ b/gradle-plugin/openshift/pom.xml @@ -50,7 +50,9 @@ org.codehaus.groovy groovy-all + ${version.groovy} pom + provided org.gradle @@ -103,56 +105,4 @@ It's unrealistic to add a dependency for each of the gradle subprojects --> - - - - - jacoco - - - - org.jacoco - jacoco-maven-plugin - ${version.jacoco} - - - default-prepare-agent - - prepare-agent - - - - default-report - - report - - - - instrument - none - - - restore - none - - - - - org.apache.maven.plugins - maven-surefire-plugin - - - - target/jacoco.exec - - - en_EN.UTF-8 - - - - - - - - diff --git a/jkube-kit/build/api/src/test/java/org/eclipse/jkube/kit/build/api/auth/handler/OpenShiftRegistryAuthHandlerTest.java b/jkube-kit/build/api/src/test/java/org/eclipse/jkube/kit/build/api/auth/handler/OpenShiftRegistryAuthHandlerTest.java index 1885d0261b..fd0a42a058 100644 --- a/jkube-kit/build/api/src/test/java/org/eclipse/jkube/kit/build/api/auth/handler/OpenShiftRegistryAuthHandlerTest.java +++ b/jkube-kit/build/api/src/test/java/org/eclipse/jkube/kit/build/api/auth/handler/OpenShiftRegistryAuthHandlerTest.java @@ -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; diff --git a/jkube-kit/build/service/docker/src/main/java/org/eclipse/jkube/kit/build/service/docker/access/hc/util/AbstractNativeClientBuilder.java b/jkube-kit/build/service/docker/src/main/java/org/eclipse/jkube/kit/build/service/docker/access/hc/util/AbstractNativeClientBuilder.java index ba2ac9787e..b41dba6d0d 100644 --- a/jkube-kit/build/service/docker/src/main/java/org/eclipse/jkube/kit/build/service/docker/access/hc/util/AbstractNativeClientBuilder.java +++ b/jkube-kit/build/service/docker/src/main/java/org/eclipse/jkube/kit/build/service/docker/access/hc/util/AbstractNativeClientBuilder.java @@ -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; diff --git a/jkube-kit/build/service/docker/src/main/java/org/eclipse/jkube/kit/build/service/docker/access/hc/win/NpipeConnectionSocketFactory.java b/jkube-kit/build/service/docker/src/main/java/org/eclipse/jkube/kit/build/service/docker/access/hc/win/NpipeConnectionSocketFactory.java index 86b83ba910..5900fefcf9 100644 --- a/jkube-kit/build/service/docker/src/main/java/org/eclipse/jkube/kit/build/service/docker/access/hc/win/NpipeConnectionSocketFactory.java +++ b/jkube-kit/build/service/docker/src/main/java/org/eclipse/jkube/kit/build/service/docker/access/hc/win/NpipeConnectionSocketFactory.java @@ -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); } diff --git a/jkube-kit/common/src/test/java/org/eclipse/jkube/kit/common/util/GitUtilTest.java b/jkube-kit/common/src/test/java/org/eclipse/jkube/kit/common/util/GitUtilTest.java index bf78b480ed..90dd1020ad 100644 --- a/jkube-kit/common/src/test/java/org/eclipse/jkube/kit/common/util/GitUtilTest.java +++ b/jkube-kit/common/src/test/java/org/eclipse/jkube/kit/common/util/GitUtilTest.java @@ -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; } } diff --git a/jkube-kit/config/service/src/main/java/org/eclipse/jkube/kit/config/service/DebugService.java b/jkube-kit/config/service/src/main/java/org/eclipse/jkube/kit/config/service/DebugService.java index 9fa118d127..69eb0227ff 100644 --- a/jkube-kit/config/service/src/main/java/org/eclipse/jkube/kit/config/service/DebugService.java +++ b/jkube-kit/config/service/src/main/java/org/eclipse/jkube/kit/config/service/DebugService.java @@ -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; diff --git a/jkube-kit/doc/src/main/asciidoc/inc/_introduction.adoc b/jkube-kit/doc/src/main/asciidoc/inc/_introduction.adoc index c8ab36949c..87a4b7013a 100644 --- a/jkube-kit/doc/src/main/asciidoc/inc/_introduction.adoc +++ b/jkube-kit/doc/src/main/asciidoc/inc/_introduction.adoc @@ -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] -.... diff --git a/jkube-kit/enricher/generic/src/test/java/org/eclipse/jkube/enricher/generic/DefaultServiceEnricherAddMissingPartsTest.java b/jkube-kit/enricher/generic/src/test/java/org/eclipse/jkube/enricher/generic/DefaultServiceEnricherAddMissingPartsTest.java index 37ce8b6c1b..074a162280 100644 --- a/jkube-kit/enricher/generic/src/test/java/org/eclipse/jkube/enricher/generic/DefaultServiceEnricherAddMissingPartsTest.java +++ b/jkube-kit/enricher/generic/src/test/java/org/eclipse/jkube/enricher/generic/DefaultServiceEnricherAddMissingPartsTest.java @@ -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; @@ -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")); } @@ -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")); } diff --git a/jkube-kit/enricher/generic/src/test/java/org/eclipse/jkube/enricher/generic/GitEnricherTest.java b/jkube-kit/enricher/generic/src/test/java/org/eclipse/jkube/enricher/generic/GitEnricherTest.java index 7e75a3f7e9..bbbb3398e9 100644 --- a/jkube-kit/enricher/generic/src/test/java/org/eclipse/jkube/enricher/generic/GitEnricherTest.java +++ b/jkube-kit/enricher/generic/src/test/java/org/eclipse/jkube/enricher/generic/GitEnricherTest.java @@ -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(); } diff --git a/jkube-kit/enricher/generic/src/test/java/org/eclipse/jkube/enricher/generic/openshift/ProjectEnricherTest.java b/jkube-kit/enricher/generic/src/test/java/org/eclipse/jkube/enricher/generic/openshift/ProjectEnricherTest.java index 2e265ed9e9..23c982969d 100644 --- a/jkube-kit/enricher/generic/src/test/java/org/eclipse/jkube/enricher/generic/openshift/ProjectEnricherTest.java +++ b/jkube-kit/enricher/generic/src/test/java/org/eclipse/jkube/enricher/generic/openshift/ProjectEnricherTest.java @@ -13,14 +13,17 @@ */ package org.eclipse.jkube.enricher.generic.openshift; -import org.eclipse.jkube.kit.config.resource.PlatformMode; -import org.eclipse.jkube.kit.enricher.api.JKubeEnricherContext; - import io.fabric8.kubernetes.api.model.KubernetesList; import io.fabric8.kubernetes.api.model.KubernetesListBuilder; import io.fabric8.kubernetes.api.model.NamespaceBuilder; import io.fabric8.kubernetes.api.model.Service; import io.fabric8.kubernetes.api.model.ServiceBuilder; +import io.fabric8.kubernetes.api.model.HasMetadata; + +import org.assertj.core.api.InstanceOfAssertFactories; +import org.eclipse.jkube.kit.config.resource.PlatformMode; +import org.eclipse.jkube.kit.enricher.api.JKubeEnricherContext; + import io.fabric8.openshift.api.model.Project; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -47,7 +50,7 @@ void create_whenKubernetesListHasNamespace_thenNamespaceConvertedToProject() { // Then assertThat(klb.build()) .extracting(KubernetesList::getItems) - .asList() + .asInstanceOf(InstanceOfAssertFactories.list(HasMetadata.class)) .singleElement() .isInstanceOf(Project.class) .hasFieldOrPropertyWithValue("metadata.name", "foo"); @@ -64,11 +67,11 @@ void create_whenKubernetesListHasNamespaceWithSpec_thenNamespaceConvertedToProje // Then assertThat(klb.build()) .extracting(KubernetesList::getItems) - .asList() + .asInstanceOf(InstanceOfAssertFactories.list(HasMetadata.class)) .singleElement() .isInstanceOf(Project.class) .extracting("spec.finalizers") - .asList().first().isEqualTo("hoo"); + .asInstanceOf(InstanceOfAssertFactories.list(HasMetadata.class)).first().isEqualTo("hoo"); } @Test @@ -82,7 +85,7 @@ void create_whenKubernetesListHasNamespaceWithStatus_thenNamespaceConvertedToPro // Then assertThat(klb.build()) .extracting(KubernetesList::getItems) - .asList() + .asInstanceOf(InstanceOfAssertFactories.list(HasMetadata.class)) .singleElement() .isInstanceOf(Project.class) .hasFieldOrPropertyWithValue("status.phase", "Complete"); @@ -98,7 +101,7 @@ void create_whenKubernetesListDoesNotHasNamespace_thenDoesNotNamespaceConvertedT // Then assertThat(klb.build()) .extracting(KubernetesList::getItems) - .asList() + .asInstanceOf(InstanceOfAssertFactories.list(HasMetadata.class)) .singleElement() .isInstanceOf(Service.class) .hasFieldOrPropertyWithValue("metadata.name", null); diff --git a/jkube-kit/enricher/generic/src/test/java/org/eclipse/jkube/enricher/generic/openshift/RouteEnricherBehavioralTest.java b/jkube-kit/enricher/generic/src/test/java/org/eclipse/jkube/enricher/generic/openshift/RouteEnricherBehavioralTest.java index 918118c8d1..4696cba85b 100644 --- a/jkube-kit/enricher/generic/src/test/java/org/eclipse/jkube/enricher/generic/openshift/RouteEnricherBehavioralTest.java +++ b/jkube-kit/enricher/generic/src/test/java/org/eclipse/jkube/enricher/generic/openshift/RouteEnricherBehavioralTest.java @@ -13,6 +13,7 @@ */ package org.eclipse.jkube.enricher.generic.openshift; +import io.fabric8.kubernetes.api.model.HasMetadata; import io.fabric8.kubernetes.api.model.KubernetesList; import io.fabric8.kubernetes.api.model.KubernetesListBuilder; import io.fabric8.kubernetes.api.model.Service; @@ -54,7 +55,9 @@ void create_withNoServices_shouldNotCreateRoute() { // When new RouteEnricher(context).create(PlatformMode.openshift, klb); // Then - assertThat(klb.build()).extracting(KubernetesList::getItems).asList().isEmpty(); + assertThat(klb.build()).extracting(KubernetesList::getItems) + .asInstanceOf(InstanceOfAssertFactories.list(HasMetadata.class)) + .isEmpty(); } @Test @@ -65,8 +68,10 @@ void create_withServiceNotExposed_shouldNotCreateRoute() { // When new RouteEnricher(context).create(PlatformMode.openshift, klb); // Then - assertThat(klb.build()).extracting(KubernetesList::getItems).asList().singleElement() - .isInstanceOf(Service.class); + assertThat(klb.build()).extracting(KubernetesList::getItems) + .asInstanceOf(InstanceOfAssertFactories.list(HasMetadata.class)) + .singleElement() + .isInstanceOf(Service.class); } @Test @@ -77,7 +82,9 @@ void create_withServiceWithNoWebPort_shouldNotCreateRoute() { // When new RouteEnricher(context).create(PlatformMode.openshift, klb); // Then - assertThat(klb.build()).extracting(KubernetesList::getItems).asList().singleElement() + assertThat(klb.build()).extracting(KubernetesList::getItems) + .asInstanceOf(InstanceOfAssertFactories.list(HasMetadata.class)) + .singleElement() .isInstanceOf(Service.class); } @@ -115,7 +122,9 @@ void inKubernetes_shouldNotCreateRoute() { // When new RouteEnricher(context).create(PlatformMode.kubernetes, klb); // Then - assertThat(klb.build()).extracting(KubernetesList::getItems).asList().singleElement() + assertThat(klb.build()).extracting(KubernetesList::getItems) + .asInstanceOf(InstanceOfAssertFactories.list(HasMetadata.class)) + .singleElement() .isInstanceOf(Service.class); } diff --git a/jkube-kit/helm/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker b/jkube-kit/helm/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker deleted file mode 100644 index ca6ee9cea8..0000000000 --- a/jkube-kit/helm/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker +++ /dev/null @@ -1 +0,0 @@ -mock-maker-inline \ No newline at end of file diff --git a/jkube-kit/jkube-kit-microprofile/src/test/java/org/eclipse/jkube/microprofile/enricher/AbstractMicroprofileHealthCheckEnricherTest.java b/jkube-kit/jkube-kit-microprofile/src/test/java/org/eclipse/jkube/microprofile/enricher/AbstractMicroprofileHealthCheckEnricherTest.java index 529b40e0e0..45cc66852c 100644 --- a/jkube-kit/jkube-kit-microprofile/src/test/java/org/eclipse/jkube/microprofile/enricher/AbstractMicroprofileHealthCheckEnricherTest.java +++ b/jkube-kit/jkube-kit-microprofile/src/test/java/org/eclipse/jkube/microprofile/enricher/AbstractMicroprofileHealthCheckEnricherTest.java @@ -22,6 +22,7 @@ import org.eclipse.jkube.kit.common.Dependency; import org.eclipse.jkube.kit.common.JavaProject; import org.eclipse.jkube.kit.common.util.JKubeProjectUtil; +import org.eclipse.jkube.kit.common.KitLogger; import org.eclipse.jkube.kit.config.resource.PlatformMode; import org.eclipse.jkube.kit.config.resource.ProcessorConfig; import org.eclipse.jkube.kit.enricher.api.JKubeEnricherContext; @@ -29,14 +30,12 @@ import org.junit.jupiter.api.Test; import java.io.File; -import java.util.Collections; import java.util.Properties; +import java.util.ArrayList; +import java.util.List; import java.util.function.Supplier; import static org.assertj.core.api.AssertionsForClassTypes.assertThat; -import static org.mockito.Answers.RETURNS_DEEP_STUBS; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; class AbstractMicroprofileHealthCheckEnricherTest { private JKubeEnricherContext context; @@ -46,9 +45,7 @@ class AbstractMicroprofileHealthCheckEnricherTest { @BeforeEach public void setUp() { - context = mock(JKubeEnricherContext.class, RETURNS_DEEP_STUBS); properties = new Properties(); - ProcessorConfig processorConfig = new ProcessorConfig(); klb = new KubernetesListBuilder(); klb.addToItems(new DeploymentBuilder() .editOrNewSpec() @@ -65,14 +62,18 @@ public void setUp() { .endSpec() .build()); - context = mock(JKubeEnricherContext.class, RETURNS_DEEP_STUBS); - javaProject = mock(JavaProject.class, RETURNS_DEEP_STUBS); - when(context.getProject()).thenReturn(javaProject); - when(context.getProperties()).thenReturn(properties); - when(context.getConfiguration().getProcessorConfig()).thenReturn(processorConfig); - when(javaProject.getProperties()).thenReturn(properties); - when(javaProject.getBaseDirectory()).thenReturn(new File("/tmp/ignore")); - when(javaProject.getOutputDirectory()).thenReturn(new File("/tmp/ignore")); + javaProject = JavaProject.builder() + .properties(properties) + .outputDirectory(new File("/tmp/ignore")) + .baseDirectory(new File("/tmp/ignore")) + .dependenciesWithTransitive(new ArrayList<>()) + .build(); + + context = JKubeEnricherContext.builder() + .log(new KitLogger.SilentLogger()) + .project(javaProject) + .processorConfig(new ProcessorConfig()) + .build(); } @Test @@ -161,18 +162,22 @@ void create_withMicroprofileHealthAndMicroprofileImplWithEnricherConfiguration_s } private void withMicroprofileHealthTransitiveDependency(String microProfileVersion) { - when(javaProject.getDependenciesWithTransitive()).thenReturn(Collections.singletonList(Dependency.builder() - .groupId("org.eclipse.microprofile.health") - .artifactId("microprofile-health-api") - .version(microProfileVersion) - .build())); + List dependencies = new ArrayList<>(javaProject.getDependencies()); + dependencies.add(Dependency.builder() + .groupId("org.eclipse.microprofile.health") + .artifactId("microprofile-health-api") + .version(microProfileVersion) + .build()); + javaProject.setDependenciesWithTransitive(dependencies); } private void withMicroprofileImplDependency() { - when(javaProject.getDependencies()).thenReturn(Collections.singletonList(Dependency.builder() - .groupId("org.example") - .artifactId("microprofile-fooimpl") - .build())); + List dependencies = new ArrayList<>(javaProject.getDependencies()); + dependencies.add(Dependency.builder() + .groupId("org.example") + .artifactId("microprofile-fooimpl") + .build()); + javaProject.setDependencies(dependencies); } private void assertProbesAdded(String livenessScheme, String livenessPath, String readyScheme, String readyPath, String startedScheme, String startedPath) { diff --git a/jkube-kit/jkube-kit-smallrye/src/test/java/org/eclipse/jkube/smallrye/enricher/SmallRyeHealthCheckEnricherTest.java b/jkube-kit/jkube-kit-smallrye/src/test/java/org/eclipse/jkube/smallrye/enricher/SmallRyeHealthCheckEnricherTest.java index 3747b40c24..19ab37e5a2 100644 --- a/jkube-kit/jkube-kit-smallrye/src/test/java/org/eclipse/jkube/smallrye/enricher/SmallRyeHealthCheckEnricherTest.java +++ b/jkube-kit/jkube-kit-smallrye/src/test/java/org/eclipse/jkube/smallrye/enricher/SmallRyeHealthCheckEnricherTest.java @@ -20,21 +20,22 @@ import io.fabric8.kubernetes.api.model.apps.DeploymentBuilder; import org.eclipse.jkube.kit.common.Dependency; import org.eclipse.jkube.kit.common.JavaProject; +import org.eclipse.jkube.kit.common.KitLogger; import org.eclipse.jkube.kit.config.resource.PlatformMode; import org.eclipse.jkube.kit.config.resource.ProcessorConfig; import org.eclipse.jkube.kit.enricher.api.JKubeEnricherContext; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; + import java.io.File; -import java.util.Collections; + +import java.util.ArrayList; +import java.util.List; import java.util.Properties; import java.util.function.Supplier; import static org.assertj.core.api.AssertionsForInterfaceTypes.assertThat; -import static org.mockito.Answers.RETURNS_DEEP_STUBS; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; class SmallRyeHealthCheckEnricherTest { private JKubeEnricherContext context; @@ -42,11 +43,12 @@ class SmallRyeHealthCheckEnricherTest { private Properties properties; private KubernetesListBuilder klb; + @BeforeEach void setup() { properties = new Properties(); - ProcessorConfig processorConfig = new ProcessorConfig(); klb = new KubernetesListBuilder(); + klb.addToItems(new DeploymentBuilder() .editOrNewSpec() .editOrNewTemplate() @@ -62,14 +64,16 @@ void setup() { .endSpec() .build()); - context = mock(JKubeEnricherContext.class, RETURNS_DEEP_STUBS); - javaProject = mock(JavaProject.class, RETURNS_DEEP_STUBS); - when(context.getProject()).thenReturn(javaProject); - when(context.getProperties()).thenReturn(properties); - when(context.getConfiguration().getProcessorConfig()).thenReturn(processorConfig); - when(javaProject.getProperties()).thenReturn(properties); - when(javaProject.getBaseDirectory()).thenReturn(new File("/tmp/ignore")); - when(javaProject.getOutputDirectory()).thenReturn(new File("/tmp/ignore")); + javaProject = JavaProject.builder() + .properties(properties) + .outputDirectory(new File("/tmp/ignore")) + .dependenciesWithTransitive(new ArrayList<>()) + .build(); + context = JKubeEnricherContext.builder() + .log(new KitLogger.SilentLogger()) + .project(javaProject) + .processorConfig(new ProcessorConfig()) + .build(); } @Test @@ -157,21 +161,24 @@ void create_withMicroprofileHealthAndSmallRyeWithEnricherConfiguration_shouldPro } private void withMicroprofileHealthTransitiveDependency(String microProfileVersion) { - when(javaProject.getDependenciesWithTransitive()).thenReturn(Collections.singletonList(Dependency.builder() + final List deps = new ArrayList<>(javaProject.getDependencies()); + deps.add(Dependency.builder() .groupId("org.eclipse.microprofile.health") .artifactId("microprofile-health-api") .version(microProfileVersion) - .build())); + .build()); + javaProject.setDependenciesWithTransitive(deps); } private void withSmallRyeDependency() { - when(javaProject.getDependencies()).thenReturn(Collections.singletonList(Dependency.builder() - .groupId("io.smallrye") - .artifactId("smallrye-health") - .build())); + final List deps = new ArrayList<>(javaProject.getDependencies()); + deps.add(Dependency.builder() + .groupId("io.smallrye") + .artifactId("smallrye-health") + .build()); + javaProject.setDependencies(deps); } - private void assertProbesAdded(String livenessScheme, String livenessPath, String readyScheme, String readyPath, String startedScheme, String startedPath) { Container container = getFirstContainerFromDeployment(); assertProbe(container::getLivenessProbe, livenessScheme, livenessPath); diff --git a/jkube-kit/parent/pom.xml b/jkube-kit/parent/pom.xml index c7ebc9c99c..a0002842d5 100644 --- a/jkube-kit/parent/pom.xml +++ b/jkube-kit/parent/pom.xml @@ -34,9 +34,9 @@ UTF-8 - 1.78.1 - 1.17.0 - 3.14.0 + 1.79 + 1.17.1 + 3.17.0 1.12.0 2.10.1 4.4.16 @@ -46,20 +46,20 @@ 3.30.2-GA 5.13.3.202401111512-r - 0.38.22 + 0.38.23 3.0.2 - 3.6.2 + 3.6.3 3.8.1 - 3.3.2 - 3.13.0 - 1.4.0 + 3.4.0 + 3.15.1 + 1.5.4 ${version.kubernetes-client} 2.8.0 0.0.7 3.5.0 1.2.6 2.0.1.Final - 9.7 + 9.7.1 0.0.24 @@ -129,7 +129,7 @@ quay.io/wildfly/wildfly-centos7:${version.image.wildfly.upstream.s2i} wildfly:${version.image.wildfly.upstream.s2i} - 0.27.0 + 0.27.2 0.34.2 exe diff --git a/jkube-kit/remote-dev/src/test/java/org/eclipse/jkube/kit/remotedev/LocalServiceManagerTest.java b/jkube-kit/remote-dev/src/test/java/org/eclipse/jkube/kit/remotedev/LocalServiceManagerTest.java index 3634c4d28d..46d96e06e8 100644 --- a/jkube-kit/remote-dev/src/test/java/org/eclipse/jkube/kit/remotedev/LocalServiceManagerTest.java +++ b/jkube-kit/remote-dev/src/test/java/org/eclipse/jkube/kit/remotedev/LocalServiceManagerTest.java @@ -23,7 +23,6 @@ import io.fabric8.kubernetes.client.server.mock.EnableKubernetesMockClient; import io.fabric8.kubernetes.client.server.mock.KubernetesMockServer; import org.assertj.core.api.InstanceOfAssertFactories; -import org.assertj.core.api.InstanceOfAssertFactory; import org.eclipse.jkube.kit.common.KitLogger; import org.eclipse.jkube.kit.common.util.Serialization; import org.junit.jupiter.api.BeforeEach; diff --git a/pom.xml b/pom.xml index 2d2503e7fa..4daaa88a41 100644 --- a/pom.xml +++ b/pom.xml @@ -92,41 +92,41 @@ false 2.2.4 2.3.0 - 3.25.3 + 3.26.3 3.4.0 - 1.26.1 - 2.16.1 - 7.6.2 + 1.27.1 + 2.18.0 + 7.6.4 0.0.5 - 3.0.21 - 33.2.0-jre - 0.0.10 - 2.17.1 + 3.0.23 + 33.3.1-jre + 0.0.14 + 2.18.2 0.8.12 2.5.1 - 5.10.2 - 6.13.2 - 4.5 - 1.18.32 + 5.11.3 + 6.13.4 + 4.6 + 1.18.36 1.18.20.0 3.13.0 - 3.4.1 - 3.2.5 - 3.2.4 - 3.6.1 - 3.4.1 - 3.6.3 - 3.13.1 - 3.0.1 + 3.5.0 + 3.5.2 + 3.2.7 + 3.8.1 + 3.4.2 + 3.11.1 + 3.15.1 + 3.1.1 3.3.1 3.3.1 - 3.2.5 + 3.5.2 4.6.1 - 1.6.13 + 1.7.0 2.2.0 1.7.36 3.11.0.3922 - 2.12.1 + 2.14.0 2024-08-13T09:16:47Z ${project.build.directory}/generated-docs @@ -317,22 +317,6 @@ report - - - instrument - process-classes - - instrument - - - - restore - test - - restore-instrumented-classes - - - diff --git a/quickstarts/gradle/plugin/README.md b/quickstarts/gradle/plugin/README.md index e0cf5d4a1c..6e0073da3b 100644 --- a/quickstarts/gradle/plugin/README.md +++ b/quickstarts/gradle/plugin/README.md @@ -52,7 +52,7 @@ buildSrc/ The Dockerfile is tuned to copy the generated and downloaded files to the container image so that they can be consumed by the application. ```dockerfile -COPY maven/build/classes/java/main/jkube-extra/* /deployments/files/ +COPY maven/build/classes/java/main/jkube-extra/* files/ ``` The application will attempt to load these files: @@ -66,14 +66,13 @@ public String version() throws IOException { } ``` - ## Running the example If you have Minikube, it's as simple as running the following commands from the main quickstart project directory: ```shell -app : $ eval $(minikube docker-env) -app : $ ../gradlew k8sBuild k8sResource k8sApply +eval $(minikube docker-env) +./gradlew k8sBuild k8sResource k8sApply ``` You need to run `minikube service app` from the command line, and a web browser window will open showing the latest Spring Boot Reference Documentation in PDF. diff --git a/quickstarts/gradle/plugin/app/Dockerfile b/quickstarts/gradle/plugin/app/Dockerfile index 1ed47ac705..9519392e9d 100644 --- a/quickstarts/gradle/plugin/app/Dockerfile +++ b/quickstarts/gradle/plugin/app/Dockerfile @@ -16,8 +16,10 @@ FROM quay.io/jkube/jkube-java:0.0.15 ENV JAVA_APP_DIR=/deployments -COPY maven/build/libs/*.jar /deployments/app.jar -COPY maven/build/classes/java/main/jkube-extra/* /deployments/files/ +WORKDIR ${JAVA_APP_DIR} + +COPY maven/build/libs/*.jar app.jar +COPY maven/build/classes/java/main/jkube-extra/* files/ EXPOSE 8080 diff --git a/quickstarts/gradle/plugin/buildSrc/src/main/java/org/eclipse/jkube/quickstart/plugin/SimpleJKubePlugin.java b/quickstarts/gradle/plugin/buildSrc/src/main/java/org/eclipse/jkube/quickstart/plugin/SimpleJKubePlugin.java index 2c652ccfc8..323b64571c 100644 --- a/quickstarts/gradle/plugin/buildSrc/src/main/java/org/eclipse/jkube/quickstart/plugin/SimpleJKubePlugin.java +++ b/quickstarts/gradle/plugin/buildSrc/src/main/java/org/eclipse/jkube/quickstart/plugin/SimpleJKubePlugin.java @@ -27,7 +27,7 @@ public class SimpleJKubePlugin implements JKubePlugin { private static final String SPRING_BOOT_LATEST_DOC_URL = - "https://docs.spring.io/spring-boot/docs/current/reference/pdf/spring-boot-reference.pdf"; + "https://docs.spring.io/spring-boot/docs/3.2.7/reference/pdf/spring-boot-reference.pdf"; @Override public void addExtraFiles(File targetDir) { diff --git a/quickstarts/maven/plugin/README.md b/quickstarts/maven/plugin/README.md index 4fd97a81e5..6e48f5efc0 100644 --- a/quickstarts/maven/plugin/README.md +++ b/quickstarts/maven/plugin/README.md @@ -51,7 +51,7 @@ Note how the plugin module is declared as a Kubernetes Maven Plugin dependency: The Dockerfile is tuned to copy the generated and downloaded files to the container image so that they can be consumed by the application. ```dockerfile -COPY maven/target/classes/jkube-extra/* /deployments/files/ +COPY maven/target/classes/jkube-extra/* files/ ``` The application will attempt to load these files: @@ -75,4 +75,5 @@ eval $(minikube docker-env) mvn clean install ``` -Since JKube's Maven goals are bound to the install phase, this should automatically deploy the application on Minikube. You only need to run `minikube service app` from the command line, and a web browser window will open showing the latest Spring Boot Reference Documentation in PDF. +Since JKube's Maven goals are bound to the install phase, this should automatically deploy the application on Minikube. +You only need to run `minikube service app` from the command line, and a web browser window will open showing the latest Spring Boot Reference Documentation in PDF. diff --git a/quickstarts/maven/plugin/app/Dockerfile b/quickstarts/maven/plugin/app/Dockerfile index fffeffe9cb..2318a35d22 100644 --- a/quickstarts/maven/plugin/app/Dockerfile +++ b/quickstarts/maven/plugin/app/Dockerfile @@ -16,8 +16,10 @@ FROM quay.io/jkube/jkube-java:0.0.15 ENV JAVA_APP_DIR=/deployments -COPY maven/target/*.jar /deployments/app.jar -COPY maven/target/classes/jkube-extra/* /deployments/files/ +WORKDIR ${JAVA_APP_DIR} + +COPY maven/target/*.jar app.jar +COPY maven/target/classes/jkube-extra/* files/ EXPOSE 8080 diff --git a/quickstarts/maven/plugin/jkube-plugin/src/main/java/org/eclipse/jkube/quickstart/plugin/SimpleJKubePlugin.java b/quickstarts/maven/plugin/jkube-plugin/src/main/java/org/eclipse/jkube/quickstart/plugin/SimpleJKubePlugin.java index 2c652ccfc8..323b64571c 100644 --- a/quickstarts/maven/plugin/jkube-plugin/src/main/java/org/eclipse/jkube/quickstart/plugin/SimpleJKubePlugin.java +++ b/quickstarts/maven/plugin/jkube-plugin/src/main/java/org/eclipse/jkube/quickstart/plugin/SimpleJKubePlugin.java @@ -27,7 +27,7 @@ public class SimpleJKubePlugin implements JKubePlugin { private static final String SPRING_BOOT_LATEST_DOC_URL = - "https://docs.spring.io/spring-boot/docs/current/reference/pdf/spring-boot-reference.pdf"; + "https://docs.spring.io/spring-boot/docs/3.2.7/reference/pdf/spring-boot-reference.pdf"; @Override public void addExtraFiles(File targetDir) {