From e2bf86b50ba20672dc96574f365aeba275a75210 Mon Sep 17 00:00:00 2001 From: hocine hacherouf Date: Sun, 23 Mar 2025 21:52:32 +0100 Subject: [PATCH 01/10] feat: Add getImageTagsWithDigest method to generate image tags with digests --- .../cloud/tools/jib/api/JibContainer.java | 21 +++++++++++++++ .../cloud/tools/jib/api/JibContainerTest.java | 27 +++++++++++++++++++ 2 files changed, 48 insertions(+) diff --git a/jib-core/src/main/java/com/google/cloud/tools/jib/api/JibContainer.java b/jib-core/src/main/java/com/google/cloud/tools/jib/api/JibContainer.java index aeb50913d8..3ca9547964 100644 --- a/jib-core/src/main/java/com/google/cloud/tools/jib/api/JibContainer.java +++ b/jib-core/src/main/java/com/google/cloud/tools/jib/api/JibContainer.java @@ -21,6 +21,7 @@ import com.google.common.annotations.VisibleForTesting; import java.util.Objects; import java.util.Set; +import java.util.stream.Collectors; /** The container built by Jib. */ public class JibContainer { @@ -99,6 +100,26 @@ public Set getTags() { return tags; } + /** + * Get the image tags with digest + * @return the image tags with digest + */ + public Set getImageTagsWithDigest() { + return tags.stream() + .map(tag -> { + StringBuilder imageTagWithDigest = new StringBuilder() + .append(targetImage.getRegistry()) + .append("/") + .append(targetImage.getRepository()) + .append(":") + .append(tag) + .append("@") + .append(imageDigest); + return imageTagWithDigest.toString(); + }) + .collect(Collectors.toSet()); + } + @Override public int hashCode() { return Objects.hash(targetImage, imageDigest, imageId, tags, imagePushed); diff --git a/jib-core/src/test/java/com/google/cloud/tools/jib/api/JibContainerTest.java b/jib-core/src/test/java/com/google/cloud/tools/jib/api/JibContainerTest.java index cb0e4ec3a8..c24709359a 100644 --- a/jib-core/src/test/java/com/google/cloud/tools/jib/api/JibContainerTest.java +++ b/jib-core/src/test/java/com/google/cloud/tools/jib/api/JibContainerTest.java @@ -23,7 +23,11 @@ import com.google.cloud.tools.jib.configuration.ImageConfiguration; import com.google.common.collect.ImmutableSet; import java.security.DigestException; +import java.util.Collections; +import java.util.HashSet; import java.util.Set; +import java.util.stream.Collectors; + import org.junit.Assert; import org.junit.Before; import org.junit.Rule; @@ -142,4 +146,27 @@ public void testCreation_withBuildContextAndBuildResult() { Assert.assertEquals(tags1, container.getTags()); Assert.assertTrue(container.isImagePushed()); } + + @Test + public void testGetImageTagsWithDigest_constructsCorrectImageTagsWithDigest() { + JibContainer container = new JibContainer(targetImage1, digest1, digest2, tags1, true); + + Set expectedImageTagsWithDigest = tags1.stream() + .map(tag -> { + StringBuilder imageTagWithDigest = new StringBuilder() + .append(targetImage1.getRegistry()) + .append("/") + .append(targetImage1.getRepository()) + .append(":") + .append(tag) + .append("@") + .append(digest1); + return imageTagWithDigest.toString(); + }) + .collect(Collectors.toSet()); + + Set imageTagsWithDigest = container.getImageTagsWithDigest(); + + Assert.assertEquals(expectedImageTagsWithDigest, imageTagsWithDigest); + } } From 0a277b31b0792360119a6bddd9f0661065a0c3c8 Mon Sep 17 00:00:00 2001 From: hocine hacherouf Date: Sun, 23 Mar 2025 21:58:26 +0100 Subject: [PATCH 02/10] feat: Add configurations for image tags with digest output file --- .../tools/jib/gradle/GradleRawConfiguration.java | 5 +++++ .../tools/jib/gradle/OutputPathsParameters.java | 16 ++++++++++++++++ .../tools/jib/maven/JibPluginConfiguration.java | 9 +++++++++ .../tools/jib/maven/MavenRawConfiguration.java | 5 +++++ .../tools/jib/plugins/common/PropertyNames.java | 1 + .../jib/plugins/common/RawConfiguration.java | 2 ++ 6 files changed, 38 insertions(+) diff --git a/jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/GradleRawConfiguration.java b/jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/GradleRawConfiguration.java index 10195cc756..7c79a8a650 100644 --- a/jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/GradleRawConfiguration.java +++ b/jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/GradleRawConfiguration.java @@ -203,6 +203,11 @@ public Path getDigestOutputPath() { return jibExtension.getOutputPaths().getDigestPath(); } + @Override + public Path getImageTagDigestOutputPath() { + return jibExtension.getOutputPaths().getImageTagDigestPath(); + } + @Override public Path getImageIdOutputPath() { return jibExtension.getOutputPaths().getImageIdPath(); diff --git a/jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/OutputPathsParameters.java b/jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/OutputPathsParameters.java index 46b4b6e608..c140a1d4b0 100644 --- a/jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/OutputPathsParameters.java +++ b/jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/OutputPathsParameters.java @@ -30,6 +30,7 @@ public class OutputPathsParameters { private final Project project; private Path digest; + private Path imageTagDigest; private Path tar; private Path imageId; private Path imageJson; @@ -38,6 +39,7 @@ public class OutputPathsParameters { public OutputPathsParameters(Project project) { this.project = project; digest = project.getBuildDir().toPath().resolve("jib-image.digest"); + imageTagDigest = project.getBuildDir().toPath().resolve("jib-image-tag.digest"); imageId = project.getBuildDir().toPath().resolve("jib-image.id"); imageJson = project.getBuildDir().toPath().resolve("jib-image.json"); tar = project.getBuildDir().toPath().resolve("jib-image.tar"); @@ -57,6 +59,20 @@ public void setDigest(String digest) { this.digest = Paths.get(digest); } + @Input + public String getImageTagDigest() { + return getRelativeToProjectRoot(imageTagDigest, PropertyNames.OUTPUT_PATHS_IMAGE_TAG_DIGEST).toString(); + } + + @Internal + public Path getImageTagDigestPath() { + return getRelativeToProjectRoot(imageTagDigest, PropertyNames.OUTPUT_PATHS_IMAGE_TAG_DIGEST); + } + + public void setImageTagDigest(String imageTagDigest) { + this.imageTagDigest = Paths.get(imageTagDigest); + } + @Input public String getImageId() { return getRelativeToProjectRoot(imageId, PropertyNames.OUTPUT_PATHS_IMAGE_ID).toString(); diff --git a/jib-maven-plugin/src/main/java/com/google/cloud/tools/jib/maven/JibPluginConfiguration.java b/jib-maven-plugin/src/main/java/com/google/cloud/tools/jib/maven/JibPluginConfiguration.java index 0e897cdaa9..f911918e8c 100644 --- a/jib-maven-plugin/src/main/java/com/google/cloud/tools/jib/maven/JibPluginConfiguration.java +++ b/jib-maven-plugin/src/main/java/com/google/cloud/tools/jib/maven/JibPluginConfiguration.java @@ -322,6 +322,7 @@ public static class OutputPathsParameters { @Nullable @Parameter private File tar; @Nullable @Parameter private File digest; + @Nullable @Parameter private File imageTagDigest; @Nullable @Parameter private File imageId; @Nullable @Parameter private File imageJson; } @@ -776,6 +777,14 @@ Path getDigestOutputPath() { return getRelativeToProjectRoot(configuredPath, PropertyNames.OUTPUT_PATHS_DIGEST); } + Path getImageTagDigestOutputPath() { + Path configuredPath = + outputPaths.imageTagDigest == null + ? Paths.get(getProject().getBuild().getDirectory()).resolve("jib-image-tag.digest") + : outputPaths.imageTagDigest.toPath(); + return getRelativeToProjectRoot(configuredPath, PropertyNames.OUTPUT_PATHS_IMAGE_TAG_DIGEST); + } + Path getImageIdOutputPath() { Path configuredPath = outputPaths.imageId == null diff --git a/jib-maven-plugin/src/main/java/com/google/cloud/tools/jib/maven/MavenRawConfiguration.java b/jib-maven-plugin/src/main/java/com/google/cloud/tools/jib/maven/MavenRawConfiguration.java index 0d11c86f6f..8aa0793ec8 100644 --- a/jib-maven-plugin/src/main/java/com/google/cloud/tools/jib/maven/MavenRawConfiguration.java +++ b/jib-maven-plugin/src/main/java/com/google/cloud/tools/jib/maven/MavenRawConfiguration.java @@ -200,6 +200,11 @@ public Path getDigestOutputPath() { return jibPluginConfiguration.getDigestOutputPath(); } + @Override + public Path getImageTagDigestOutputPath() { + return jibPluginConfiguration.getImageTagDigestOutputPath(); + } + @Override public Path getImageIdOutputPath() { return jibPluginConfiguration.getImageIdOutputPath(); diff --git a/jib-plugins-common/src/main/java/com/google/cloud/tools/jib/plugins/common/PropertyNames.java b/jib-plugins-common/src/main/java/com/google/cloud/tools/jib/plugins/common/PropertyNames.java index 14e27c2ed3..d2a3c33daa 100644 --- a/jib-plugins-common/src/main/java/com/google/cloud/tools/jib/plugins/common/PropertyNames.java +++ b/jib-plugins-common/src/main/java/com/google/cloud/tools/jib/plugins/common/PropertyNames.java @@ -54,6 +54,7 @@ public class PropertyNames { public static final String DOCKER_CLIENT_EXECUTABLE = "jib.dockerClient.executable"; public static final String DOCKER_CLIENT_ENVIRONMENT = "jib.dockerClient.environment"; public static final String OUTPUT_PATHS_DIGEST = "jib.outputPaths.digest"; + public static final String OUTPUT_PATHS_IMAGE_TAG_DIGEST = "jib.outputPaths.imageTagDigest"; public static final String OUTPUT_PATHS_IMAGE_ID = "jib.outputPaths.imageId"; public static final String OUTPUT_PATHS_IMAGE_JSON = "jib.outputPaths.imageJson"; public static final String OUTPUT_PATHS_TAR = "jib.outputPaths.tar"; diff --git a/jib-plugins-common/src/main/java/com/google/cloud/tools/jib/plugins/common/RawConfiguration.java b/jib-plugins-common/src/main/java/com/google/cloud/tools/jib/plugins/common/RawConfiguration.java index b31cf326ec..56a4ee36b8 100644 --- a/jib-plugins-common/src/main/java/com/google/cloud/tools/jib/plugins/common/RawConfiguration.java +++ b/jib-plugins-common/src/main/java/com/google/cloud/tools/jib/plugins/common/RawConfiguration.java @@ -129,6 +129,8 @@ interface CredHelperConfiguration { Path getDigestOutputPath(); + Path getImageTagDigestOutputPath(); + Path getImageIdOutputPath(); Path getImageJsonOutputPath(); From 6e9b5bb893ec504726e77f155856e7a703cda0e7 Mon Sep 17 00:00:00 2001 From: hocine hacherouf Date: Sun, 23 Mar 2025 22:01:22 +0100 Subject: [PATCH 03/10] feat: Add writeImageTagDigest on JibBuildRunner --- .../jib/plugins/common/JibBuildRunner.java | 10 ++++++++ .../plugins/common/JibBuildRunnerTest.java | 23 +++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/jib-plugins-common/src/main/java/com/google/cloud/tools/jib/plugins/common/JibBuildRunner.java b/jib-plugins-common/src/main/java/com/google/cloud/tools/jib/plugins/common/JibBuildRunner.java index 867f0bd83a..7744c5b4e2 100644 --- a/jib-plugins-common/src/main/java/com/google/cloud/tools/jib/plugins/common/JibBuildRunner.java +++ b/jib-plugins-common/src/main/java/com/google/cloud/tools/jib/plugins/common/JibBuildRunner.java @@ -193,6 +193,7 @@ private static void handleRegistryUnauthorizedException( private final Consumer logger; private final HelpfulSuggestions helpfulSuggestions; @Nullable private Path imageDigestOutputPath; + @Nullable private Path imageTagDigestOutputPath; @Nullable private Path imageIdOutputPath; @Nullable private Path imageJsonOutputPath; @@ -236,6 +237,10 @@ public JibContainer runBuild() String imageDigest = jibContainer.getDigest().toString(); Files.write(imageDigestOutputPath, imageDigest.getBytes(StandardCharsets.UTF_8)); } + if (imageTagDigestOutputPath != null) { + Set imageTagsWithDigest = jibContainer.getImageTagsWithDigest(); + Files.write(imageTagDigestOutputPath, imageTagsWithDigest); + } if (imageIdOutputPath != null) { String imageId = jibContainer.getImageId().toString(); Files.write(imageIdOutputPath, imageId.getBytes(StandardCharsets.UTF_8)); @@ -304,6 +309,11 @@ public JibBuildRunner writeImageDigest(@Nullable Path imageDigestOutputPath) { return this; } + public JibBuildRunner writeImageTagDigest(@Nullable Path imageTagDigestOutputPath) { + this.imageTagDigestOutputPath = imageTagDigestOutputPath; + return this; + } + /** * Set the location where the image id will be saved. If {@code null} then digest is not saved. * diff --git a/jib-plugins-common/src/test/java/com/google/cloud/tools/jib/plugins/common/JibBuildRunnerTest.java b/jib-plugins-common/src/test/java/com/google/cloud/tools/jib/plugins/common/JibBuildRunnerTest.java index 4b41447b55..bf1786a194 100644 --- a/jib-plugins-common/src/test/java/com/google/cloud/tools/jib/plugins/common/JibBuildRunnerTest.java +++ b/jib-plugins-common/src/test/java/com/google/cloud/tools/jib/plugins/common/JibBuildRunnerTest.java @@ -253,4 +253,27 @@ public void testBuildImage_writesImageJson() throws Exception { Assert.assertEquals(tags, ImmutableSet.copyOf(metadataOutput.getTags())); Assert.assertTrue(metadataOutput.isImagePushed()); } + + @Test + public void testBuildImage_writeImageTagDigest() throws Exception { + Set imageTagsDigest = ImmutableSet.of( + "gcr.io/project/image:latest@sha256:abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789", + "gcr.io/project/image:custom-tag@sha256:abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789"); + + String expectedImageTagsDigestOutput = "gcr.io/project/image:latest@sha256:abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789\n" + + "gcr.io/project/image:custom-tag@sha256:abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789\n"; + + final Path outputPath = temporaryFolder.newFile("jib-image-tag.digest").toPath(); + + Mockito.when(mockJibContainer.getImageTagsWithDigest()).thenReturn(imageTagsDigest); + Mockito.when(mockJibContainerBuilder.containerize(mockContainerizer)) + .thenReturn(mockJibContainer); + Mockito.when(mockJibContainer.isImagePushed()).thenReturn(true); + + testJibBuildRunner.writeImageTagDigest(outputPath).runBuild(); + + final String imageTagDigestOutput = new String(Files.readAllBytes(outputPath), StandardCharsets.UTF_8); + + Assert.assertEquals(expectedImageTagsDigestOutput, imageTagDigestOutput); + } } From 30ffc230445b82e58acf8ecbfa973326a1b88c6e Mon Sep 17 00:00:00 2001 From: hocine hacherouf Date: Sun, 23 Mar 2025 22:02:37 +0100 Subject: [PATCH 04/10] feat: Add writeImageTagDigest on PluginConfigurationProcesspr --- .../tools/jib/plugins/common/PluginConfigurationProcessor.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/jib-plugins-common/src/main/java/com/google/cloud/tools/jib/plugins/common/PluginConfigurationProcessor.java b/jib-plugins-common/src/main/java/com/google/cloud/tools/jib/plugins/common/PluginConfigurationProcessor.java index 8ac4001db5..2117d99479 100644 --- a/jib-plugins-common/src/main/java/com/google/cloud/tools/jib/plugins/common/PluginConfigurationProcessor.java +++ b/jib-plugins-common/src/main/java/com/google/cloud/tools/jib/plugins/common/PluginConfigurationProcessor.java @@ -167,6 +167,7 @@ public static JibBuildRunner createJibBuildRunnerForDockerDaemonImage( targetImageReference, rawConfiguration.getToTags()) .writeImageDigest(rawConfiguration.getDigestOutputPath()) + .writeImageTagDigest(rawConfiguration.getImageTagDigestOutputPath()) .writeImageId(rawConfiguration.getImageIdOutputPath()) .writeImageJson(rawConfiguration.getImageJsonOutputPath()); } @@ -235,6 +236,7 @@ public static JibBuildRunner createJibBuildRunnerForTarImage( helpfulSuggestions, rawConfiguration.getTarOutputPath()) .writeImageDigest(rawConfiguration.getDigestOutputPath()) + .writeImageTagDigest(rawConfiguration.getImageTagDigestOutputPath()) .writeImageId(rawConfiguration.getImageIdOutputPath()) .writeImageJson(rawConfiguration.getImageJsonOutputPath()); } @@ -320,6 +322,7 @@ public static JibBuildRunner createJibBuildRunnerForRegistryImage( targetImageReference, rawConfiguration.getToTags()) .writeImageDigest(rawConfiguration.getDigestOutputPath()) + .writeImageTagDigest(rawConfiguration.getImageTagDigestOutputPath()) .writeImageId(rawConfiguration.getImageIdOutputPath()) .writeImageJson(rawConfiguration.getImageJsonOutputPath()); } From 9ed972c97ea8073c1530a217c2b01eddc0604152 Mon Sep 17 00:00:00 2001 From: hocine hacherouf Date: Sun, 23 Mar 2025 22:22:08 +0100 Subject: [PATCH 05/10] feat: Add unit tests on getImageTagDigestPath on maven and gradle configuration --- .../cloud/tools/jib/gradle/GradleRawConfigurationTest.java | 2 ++ .../google/cloud/tools/jib/maven/MavenRawConfigurationTest.java | 2 ++ 2 files changed, 4 insertions(+) diff --git a/jib-gradle-plugin/src/test/java/com/google/cloud/tools/jib/gradle/GradleRawConfigurationTest.java b/jib-gradle-plugin/src/test/java/com/google/cloud/tools/jib/gradle/GradleRawConfigurationTest.java index 8655241553..bc77d72a48 100644 --- a/jib-gradle-plugin/src/test/java/com/google/cloud/tools/jib/gradle/GradleRawConfigurationTest.java +++ b/jib-gradle-plugin/src/test/java/com/google/cloud/tools/jib/gradle/GradleRawConfigurationTest.java @@ -103,6 +103,7 @@ public void testGetters() { .thenReturn(new HashMap<>(ImmutableMap.of("docker", "client"))); Mockito.when(outputPathsParameters.getDigestPath()).thenReturn(Paths.get("digest/path")); + Mockito.when(outputPathsParameters.getImageTagDigestPath()).thenReturn(Paths.get("image-tag-digest/path")); Mockito.when(outputPathsParameters.getImageIdPath()).thenReturn(Paths.get("id/path")); Mockito.when(outputPathsParameters.getImageJsonPath()).thenReturn(Paths.get("json/path")); Mockito.when(outputPathsParameters.getTarPath()).thenReturn(Paths.get("tar/path")); @@ -147,6 +148,7 @@ public void testGetters() { new HashMap<>(ImmutableMap.of("docker", "client")), rawConfiguration.getDockerEnvironment()); Assert.assertEquals(Paths.get("digest/path"), rawConfiguration.getDigestOutputPath()); + Assert.assertEquals(Paths.get("image-tag-digest/path"), rawConfiguration.getImageTagDigestOutputPath()); Assert.assertEquals(Paths.get("id/path"), rawConfiguration.getImageIdOutputPath()); Assert.assertEquals(Paths.get("json/path"), rawConfiguration.getImageJsonOutputPath()); Assert.assertEquals(Paths.get("tar/path"), rawConfiguration.getTarOutputPath()); diff --git a/jib-maven-plugin/src/test/java/com/google/cloud/tools/jib/maven/MavenRawConfigurationTest.java b/jib-maven-plugin/src/test/java/com/google/cloud/tools/jib/maven/MavenRawConfigurationTest.java index 44798046e6..e9b1bd1377 100644 --- a/jib-maven-plugin/src/test/java/com/google/cloud/tools/jib/maven/MavenRawConfigurationTest.java +++ b/jib-maven-plugin/src/test/java/com/google/cloud/tools/jib/maven/MavenRawConfigurationTest.java @@ -100,6 +100,7 @@ public void testGetters() { Mockito.when(jibPluginConfiguration.getDockerClientEnvironment()) .thenReturn(new HashMap<>(ImmutableMap.of("docker", "client"))); Mockito.when(jibPluginConfiguration.getDigestOutputPath()).thenReturn(Paths.get("digest/path")); + Mockito.when(jibPluginConfiguration.getImageTagDigestOutputPath()).thenReturn(Paths.get("image-tag-digest/path")); Mockito.when(jibPluginConfiguration.getImageIdOutputPath()).thenReturn(Paths.get("id/path")); Mockito.when(jibPluginConfiguration.getImageJsonOutputPath()) .thenReturn(Paths.get("json/path")); @@ -144,6 +145,7 @@ public void testGetters() { new HashMap<>(ImmutableMap.of("docker", "client")), rawConfiguration.getDockerEnvironment()); Assert.assertEquals(Paths.get("digest/path"), jibPluginConfiguration.getDigestOutputPath()); + Assert.assertEquals(Paths.get("image-tag-digest/path"), jibPluginConfiguration.getImageTagDigestOutputPath()); Assert.assertEquals(Paths.get("id/path"), jibPluginConfiguration.getImageIdOutputPath()); Assert.assertEquals(Paths.get("json/path"), jibPluginConfiguration.getImageJsonOutputPath()); Assert.assertEquals(Paths.get("tar/path"), jibPluginConfiguration.getTarOutputPath()); From c695aeab139472bb8375c6a3ccec1b0e6f2ec978 Mon Sep 17 00:00:00 2001 From: hocine hacherouf Date: Sun, 23 Mar 2025 22:43:37 +0100 Subject: [PATCH 06/10] feat: Add outputPaths.imageTagDigest on maven/gradle plugin readme --- jib-gradle-plugin/README.md | 1 + jib-maven-plugin/README.md | 1 + 2 files changed, 2 insertions(+) diff --git a/jib-gradle-plugin/README.md b/jib-gradle-plugin/README.md index 7ae6237045..e95c23f325 100644 --- a/jib-gradle-plugin/README.md +++ b/jib-gradle-plugin/README.md @@ -286,6 +286,7 @@ Property | Type | Default | Description `tar` | `File` | `(project-dir)/build/jib-image.tar` | The path of the tarball generated by `jibBuildTar`. Relative paths are resolved relative to the project root. `digest` | `File` | `(project-dir)/build/jib-image.digest` | The path of the image digest written out during the build. Relative paths are resolved relative to the project root. `imageId` | `File` | `(project-dir)/build/jib-image.id` | The path of the image ID written out during the build. Relative paths are resolved relative to the project root. +`imageTagDigest` | string | `(project-dir)/build/jib-image-tag.digest` | The path of the image tags with digest written out during the build. Relative paths are resolved relative to the project root. `dockerClient` is an object used to configure Docker when building to/from the Docker daemon. It has the following properties: diff --git a/jib-maven-plugin/README.md b/jib-maven-plugin/README.md index f489befef5..7ca57e771d 100644 --- a/jib-maven-plugin/README.md +++ b/jib-maven-plugin/README.md @@ -336,6 +336,7 @@ Property | Type | Default | Description `digest` | string | `(project-dir)/target/jib-image.digest` | The path of the image digest written out during the build. Relative paths are resolved relative to the project root. `imageId` | string | `(project-dir)/target/jib-image.id` | The path of the image ID written out during the build. Relative paths are resolved relative to the project root. `imageJson` | string | `(project-dir)/target/jib-image.json` | The path of the image metadata json file written out during the build. Relative paths are resolved relative to the project root. +`imageTagDigest` | string | `(project-dir)/target/jib-image-tag.digest` | The path of the image tags with digest written out during the build. Relative paths are resolved relative to the project root. `dockerClient` is an object used to configure Docker when building to/from the Docker daemon. It has the following properties: From 45af9910715a26c0a347875d3a063faddafb1e72 Mon Sep 17 00:00:00 2001 From: hocine hacherouf Date: Sun, 23 Mar 2025 22:51:00 +0100 Subject: [PATCH 07/10] feat: Update unit tests on JibPluginConfigurationTest about jib.outputPaths.imageTagDigest --- .../tools/jib/maven/JibPluginConfigurationTest.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/jib-maven-plugin/src/test/java/com/google/cloud/tools/jib/maven/JibPluginConfigurationTest.java b/jib-maven-plugin/src/test/java/com/google/cloud/tools/jib/maven/JibPluginConfigurationTest.java index b518fbc321..57eebfb5ac 100644 --- a/jib-maven-plugin/src/test/java/com/google/cloud/tools/jib/maven/JibPluginConfigurationTest.java +++ b/jib-maven-plugin/src/test/java/com/google/cloud/tools/jib/maven/JibPluginConfigurationTest.java @@ -205,6 +205,10 @@ public void testSystemPropertiesOutputPaths() { // Absolute paths sessionSystemProperties.put("jib.outputPaths.digest", "/digest/path"); assertThat(testPluginConfiguration.getDigestOutputPath()).isEqualTo(Paths.get("/digest/path")); + sessionSystemProperties.put("jib.outputPaths.imageTagDigest", "/image-tag-digest/path"); + assertThat(testPluginConfiguration.getImageTagDigestOutputPath()).isEqualTo(Paths.get("/image-tag-digest/path")); + sessionSystemProperties.put("jib.outputPaths.imageTagDigest", "/image-tag-digest/path"); + assertThat(testPluginConfiguration.getImageTagDigestOutputPath()).isEqualTo(Paths.get("/image-tag-digest/path")); sessionSystemProperties.put("jib.outputPaths.imageId", "/id/path"); assertThat(testPluginConfiguration.getImageIdOutputPath()).isEqualTo(Paths.get("/id/path")); sessionSystemProperties.put("jib.outputPaths.tar", "/tar/path"); @@ -213,6 +217,9 @@ public void testSystemPropertiesOutputPaths() { sessionSystemProperties.put("jib.outputPaths.digest", "digest/path"); assertThat(testPluginConfiguration.getDigestOutputPath()) .isEqualTo(Paths.get("/repository/project/digest/path")); + sessionSystemProperties.put("jib.outputPaths.imageTagDigest", "image-tag-digest/path"); + assertThat(testPluginConfiguration.getImageTagDigestOutputPath()) + .isEqualTo(Paths.get("/repository/project/image-tag-digest/path")); sessionSystemProperties.put("jib.outputPaths.imageId", "id/path"); assertThat(testPluginConfiguration.getImageIdOutputPath()) .isEqualTo(Paths.get("/repository/project/id/path")); @@ -323,6 +330,8 @@ public void testPomPropertiesExtraDirectories() { public void testPomPropertiesOutputPaths() { project.getProperties().setProperty("jib.outputPaths.digest", "/digest/path"); assertThat(testPluginConfiguration.getDigestOutputPath()).isEqualTo(Paths.get("/digest/path")); + project.getProperties().setProperty("jib.outputPaths.imageTagDigest", "/image-tag-digest/path"); + assertThat(testPluginConfiguration.getImageTagDigestOutputPath()).isEqualTo(Paths.get("/image-tag-digest/path")); project.getProperties().setProperty("jib.outputPaths.imageId", "/id/path"); assertThat(testPluginConfiguration.getImageIdOutputPath()).isEqualTo(Paths.get("/id/path")); project.getProperties().setProperty("jib.outputPaths.imageJson", "/json/path"); From 11fc8b7a996df097003d9fbf7e06e8b2d3f9471f Mon Sep 17 00:00:00 2001 From: hocine hacherouf Date: Sun, 23 Mar 2025 23:18:19 +0100 Subject: [PATCH 08/10] feat: Add unit tests on JibExtension about image tag digest --- .../google/cloud/tools/jib/gradle/JibExtensionTest.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/jib-gradle-plugin/src/test/java/com/google/cloud/tools/jib/gradle/JibExtensionTest.java b/jib-gradle-plugin/src/test/java/com/google/cloud/tools/jib/gradle/JibExtensionTest.java index 440ae17779..42279d89cb 100644 --- a/jib-gradle-plugin/src/test/java/com/google/cloud/tools/jib/gradle/JibExtensionTest.java +++ b/jib-gradle-plugin/src/test/java/com/google/cloud/tools/jib/gradle/JibExtensionTest.java @@ -393,12 +393,15 @@ public void testOutputFiles() { testJibExtension.outputPaths( outputFiles -> { outputFiles.setDigest("/path/to/digest"); + outputFiles.setImageTagDigest("/path/to/image-tag-digest"); outputFiles.setImageId("/path/to/id"); outputFiles.setTar("path/to/tar"); }); assertThat(testJibExtension.getOutputPaths().getDigestPath()) .isEqualTo(Paths.get("/path/to/digest").toAbsolutePath()); + assertThat(testJibExtension.getOutputPaths().getImageTagDigestPath()) + .isEqualTo(Paths.get("/path/to/image-tag-digest").toAbsolutePath()); assertThat(testJibExtension.getOutputPaths().getImageIdPath()) .isEqualTo(Paths.get("/path/to/id").toAbsolutePath()); assertThat(testJibExtension.getOutputPaths().getTarPath()) @@ -555,6 +558,9 @@ public void testPropertiesOutputPaths() { System.setProperty("jib.outputPaths.digest", "/digest/path"); assertThat(testJibExtension.getOutputPaths().getDigestPath()) .isEqualTo(Paths.get("/digest/path").toAbsolutePath()); + System.setProperty("jib.outputPaths.imageTagDigest", "/image-tag-digest/path"); + assertThat(testJibExtension.getOutputPaths().getImageTagDigestPath()) + .isEqualTo(Paths.get("/image-tag-digest/path").toAbsolutePath()); System.setProperty("jib.outputPaths.imageId", "/id/path"); assertThat(testJibExtension.getOutputPaths().getImageIdPath()) .isEqualTo(Paths.get("/id/path").toAbsolutePath()); @@ -565,6 +571,9 @@ public void testPropertiesOutputPaths() { System.setProperty("jib.outputPaths.digest", "digest/path"); assertThat(testJibExtension.getOutputPaths().getDigestPath()) .isEqualTo(fakeProject.getProjectDir().toPath().resolve("digest/path")); + System.setProperty("jib.outputPaths.imageTagDigest", "image-tag-digest/path"); + assertThat(testJibExtension.getOutputPaths().getImageTagDigestPath()) + .isEqualTo(fakeProject.getProjectDir().toPath().resolve("image-tag-digest/path")); System.setProperty("jib.outputPaths.imageId", "id/path"); assertThat(testJibExtension.getOutputPaths().getImageIdPath()) .isEqualTo(fakeProject.getProjectDir().toPath().resolve("id/path")); From 385ea88a338ee0319e15fd455640e6d7f0981042 Mon Sep 17 00:00:00 2001 From: hocine hacherouf Date: Mon, 24 Mar 2025 19:29:52 +0100 Subject: [PATCH 09/10] feat: Fix google java style issues --- .../cloud/tools/jib/api/JibContainer.java | 11 ++++--- .../cloud/tools/jib/api/JibContainerTest.java | 30 +++++++++---------- .../jib/gradle/OutputPathsParameters.java | 3 +- .../gradle/GradleRawConfigurationTest.java | 6 ++-- .../jib/maven/JibPluginConfiguration.java | 6 ++-- .../jib/maven/JibPluginConfigurationTest.java | 5 ++-- .../jib/maven/MavenRawConfigurationTest.java | 6 ++-- .../plugins/common/JibBuildRunnerTest.java | 14 +++++---- 8 files changed, 45 insertions(+), 36 deletions(-) diff --git a/jib-core/src/main/java/com/google/cloud/tools/jib/api/JibContainer.java b/jib-core/src/main/java/com/google/cloud/tools/jib/api/JibContainer.java index 3ca9547964..361a016368 100644 --- a/jib-core/src/main/java/com/google/cloud/tools/jib/api/JibContainer.java +++ b/jib-core/src/main/java/com/google/cloud/tools/jib/api/JibContainer.java @@ -101,13 +101,16 @@ public Set getTags() { } /** - * Get the image tags with digest + * Get the image tags with digest. + * * @return the image tags with digest */ public Set getImageTagsWithDigest() { return tags.stream() - .map(tag -> { - StringBuilder imageTagWithDigest = new StringBuilder() + .map( + tag -> { + StringBuilder imageTagWithDigest = + new StringBuilder() .append(targetImage.getRegistry()) .append("/") .append(targetImage.getRepository()) @@ -117,7 +120,7 @@ public Set getImageTagsWithDigest() { .append(imageDigest); return imageTagWithDigest.toString(); }) - .collect(Collectors.toSet()); + .collect(Collectors.toSet()); } @Override diff --git a/jib-core/src/test/java/com/google/cloud/tools/jib/api/JibContainerTest.java b/jib-core/src/test/java/com/google/cloud/tools/jib/api/JibContainerTest.java index c24709359a..e605069c0a 100644 --- a/jib-core/src/test/java/com/google/cloud/tools/jib/api/JibContainerTest.java +++ b/jib-core/src/test/java/com/google/cloud/tools/jib/api/JibContainerTest.java @@ -23,11 +23,8 @@ import com.google.cloud.tools.jib.configuration.ImageConfiguration; import com.google.common.collect.ImmutableSet; import java.security.DigestException; -import java.util.Collections; -import java.util.HashSet; import java.util.Set; import java.util.stream.Collectors; - import org.junit.Assert; import org.junit.Before; import org.junit.Rule; @@ -151,18 +148,21 @@ public void testCreation_withBuildContextAndBuildResult() { public void testGetImageTagsWithDigest_constructsCorrectImageTagsWithDigest() { JibContainer container = new JibContainer(targetImage1, digest1, digest2, tags1, true); - Set expectedImageTagsWithDigest = tags1.stream() - .map(tag -> { - StringBuilder imageTagWithDigest = new StringBuilder() - .append(targetImage1.getRegistry()) - .append("/") - .append(targetImage1.getRepository()) - .append(":") - .append(tag) - .append("@") - .append(digest1); - return imageTagWithDigest.toString(); - }) + Set expectedImageTagsWithDigest = + tags1.stream() + .map( + tag -> { + StringBuilder imageTagWithDigest = + new StringBuilder() + .append(targetImage1.getRegistry()) + .append("/") + .append(targetImage1.getRepository()) + .append(":") + .append(tag) + .append("@") + .append(digest1); + return imageTagWithDigest.toString(); + }) .collect(Collectors.toSet()); Set imageTagsWithDigest = container.getImageTagsWithDigest(); diff --git a/jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/OutputPathsParameters.java b/jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/OutputPathsParameters.java index c140a1d4b0..76ace959bf 100644 --- a/jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/OutputPathsParameters.java +++ b/jib-gradle-plugin/src/main/java/com/google/cloud/tools/jib/gradle/OutputPathsParameters.java @@ -61,7 +61,8 @@ public void setDigest(String digest) { @Input public String getImageTagDigest() { - return getRelativeToProjectRoot(imageTagDigest, PropertyNames.OUTPUT_PATHS_IMAGE_TAG_DIGEST).toString(); + return getRelativeToProjectRoot(imageTagDigest, PropertyNames.OUTPUT_PATHS_IMAGE_TAG_DIGEST) + .toString(); } @Internal diff --git a/jib-gradle-plugin/src/test/java/com/google/cloud/tools/jib/gradle/GradleRawConfigurationTest.java b/jib-gradle-plugin/src/test/java/com/google/cloud/tools/jib/gradle/GradleRawConfigurationTest.java index bc77d72a48..e48ff59695 100644 --- a/jib-gradle-plugin/src/test/java/com/google/cloud/tools/jib/gradle/GradleRawConfigurationTest.java +++ b/jib-gradle-plugin/src/test/java/com/google/cloud/tools/jib/gradle/GradleRawConfigurationTest.java @@ -103,7 +103,8 @@ public void testGetters() { .thenReturn(new HashMap<>(ImmutableMap.of("docker", "client"))); Mockito.when(outputPathsParameters.getDigestPath()).thenReturn(Paths.get("digest/path")); - Mockito.when(outputPathsParameters.getImageTagDigestPath()).thenReturn(Paths.get("image-tag-digest/path")); + Mockito.when(outputPathsParameters.getImageTagDigestPath()) + .thenReturn(Paths.get("image-tag-digest/path")); Mockito.when(outputPathsParameters.getImageIdPath()).thenReturn(Paths.get("id/path")); Mockito.when(outputPathsParameters.getImageJsonPath()).thenReturn(Paths.get("json/path")); Mockito.when(outputPathsParameters.getTarPath()).thenReturn(Paths.get("tar/path")); @@ -148,7 +149,8 @@ public void testGetters() { new HashMap<>(ImmutableMap.of("docker", "client")), rawConfiguration.getDockerEnvironment()); Assert.assertEquals(Paths.get("digest/path"), rawConfiguration.getDigestOutputPath()); - Assert.assertEquals(Paths.get("image-tag-digest/path"), rawConfiguration.getImageTagDigestOutputPath()); + Assert.assertEquals( + Paths.get("image-tag-digest/path"), rawConfiguration.getImageTagDigestOutputPath()); Assert.assertEquals(Paths.get("id/path"), rawConfiguration.getImageIdOutputPath()); Assert.assertEquals(Paths.get("json/path"), rawConfiguration.getImageJsonOutputPath()); Assert.assertEquals(Paths.get("tar/path"), rawConfiguration.getTarOutputPath()); diff --git a/jib-maven-plugin/src/main/java/com/google/cloud/tools/jib/maven/JibPluginConfiguration.java b/jib-maven-plugin/src/main/java/com/google/cloud/tools/jib/maven/JibPluginConfiguration.java index f911918e8c..c349dcd3bf 100644 --- a/jib-maven-plugin/src/main/java/com/google/cloud/tools/jib/maven/JibPluginConfiguration.java +++ b/jib-maven-plugin/src/main/java/com/google/cloud/tools/jib/maven/JibPluginConfiguration.java @@ -779,9 +779,9 @@ Path getDigestOutputPath() { Path getImageTagDigestOutputPath() { Path configuredPath = - outputPaths.imageTagDigest == null - ? Paths.get(getProject().getBuild().getDirectory()).resolve("jib-image-tag.digest") - : outputPaths.imageTagDigest.toPath(); + outputPaths.imageTagDigest == null + ? Paths.get(getProject().getBuild().getDirectory()).resolve("jib-image-tag.digest") + : outputPaths.imageTagDigest.toPath(); return getRelativeToProjectRoot(configuredPath, PropertyNames.OUTPUT_PATHS_IMAGE_TAG_DIGEST); } diff --git a/jib-maven-plugin/src/test/java/com/google/cloud/tools/jib/maven/JibPluginConfigurationTest.java b/jib-maven-plugin/src/test/java/com/google/cloud/tools/jib/maven/JibPluginConfigurationTest.java index 57eebfb5ac..6f6481f464 100644 --- a/jib-maven-plugin/src/test/java/com/google/cloud/tools/jib/maven/JibPluginConfigurationTest.java +++ b/jib-maven-plugin/src/test/java/com/google/cloud/tools/jib/maven/JibPluginConfigurationTest.java @@ -207,8 +207,6 @@ public void testSystemPropertiesOutputPaths() { assertThat(testPluginConfiguration.getDigestOutputPath()).isEqualTo(Paths.get("/digest/path")); sessionSystemProperties.put("jib.outputPaths.imageTagDigest", "/image-tag-digest/path"); assertThat(testPluginConfiguration.getImageTagDigestOutputPath()).isEqualTo(Paths.get("/image-tag-digest/path")); - sessionSystemProperties.put("jib.outputPaths.imageTagDigest", "/image-tag-digest/path"); - assertThat(testPluginConfiguration.getImageTagDigestOutputPath()).isEqualTo(Paths.get("/image-tag-digest/path")); sessionSystemProperties.put("jib.outputPaths.imageId", "/id/path"); assertThat(testPluginConfiguration.getImageIdOutputPath()).isEqualTo(Paths.get("/id/path")); sessionSystemProperties.put("jib.outputPaths.tar", "/tar/path"); @@ -331,7 +329,8 @@ public void testPomPropertiesOutputPaths() { project.getProperties().setProperty("jib.outputPaths.digest", "/digest/path"); assertThat(testPluginConfiguration.getDigestOutputPath()).isEqualTo(Paths.get("/digest/path")); project.getProperties().setProperty("jib.outputPaths.imageTagDigest", "/image-tag-digest/path"); - assertThat(testPluginConfiguration.getImageTagDigestOutputPath()).isEqualTo(Paths.get("/image-tag-digest/path")); + assertThat(testPluginConfiguration.getImageTagDigestOutputPath()) + .isEqualTo(Paths.get("/image-tag-digest/path")); project.getProperties().setProperty("jib.outputPaths.imageId", "/id/path"); assertThat(testPluginConfiguration.getImageIdOutputPath()).isEqualTo(Paths.get("/id/path")); project.getProperties().setProperty("jib.outputPaths.imageJson", "/json/path"); diff --git a/jib-maven-plugin/src/test/java/com/google/cloud/tools/jib/maven/MavenRawConfigurationTest.java b/jib-maven-plugin/src/test/java/com/google/cloud/tools/jib/maven/MavenRawConfigurationTest.java index e9b1bd1377..af23b8346a 100644 --- a/jib-maven-plugin/src/test/java/com/google/cloud/tools/jib/maven/MavenRawConfigurationTest.java +++ b/jib-maven-plugin/src/test/java/com/google/cloud/tools/jib/maven/MavenRawConfigurationTest.java @@ -100,7 +100,8 @@ public void testGetters() { Mockito.when(jibPluginConfiguration.getDockerClientEnvironment()) .thenReturn(new HashMap<>(ImmutableMap.of("docker", "client"))); Mockito.when(jibPluginConfiguration.getDigestOutputPath()).thenReturn(Paths.get("digest/path")); - Mockito.when(jibPluginConfiguration.getImageTagDigestOutputPath()).thenReturn(Paths.get("image-tag-digest/path")); + Mockito.when(jibPluginConfiguration.getImageTagDigestOutputPath()) + .thenReturn(Paths.get("image-tag-digest/path")); Mockito.when(jibPluginConfiguration.getImageIdOutputPath()).thenReturn(Paths.get("id/path")); Mockito.when(jibPluginConfiguration.getImageJsonOutputPath()) .thenReturn(Paths.get("json/path")); @@ -145,7 +146,8 @@ public void testGetters() { new HashMap<>(ImmutableMap.of("docker", "client")), rawConfiguration.getDockerEnvironment()); Assert.assertEquals(Paths.get("digest/path"), jibPluginConfiguration.getDigestOutputPath()); - Assert.assertEquals(Paths.get("image-tag-digest/path"), jibPluginConfiguration.getImageTagDigestOutputPath()); + Assert.assertEquals( + Paths.get("image-tag-digest/path"), jibPluginConfiguration.getImageTagDigestOutputPath()); Assert.assertEquals(Paths.get("id/path"), jibPluginConfiguration.getImageIdOutputPath()); Assert.assertEquals(Paths.get("json/path"), jibPluginConfiguration.getImageJsonOutputPath()); Assert.assertEquals(Paths.get("tar/path"), jibPluginConfiguration.getTarOutputPath()); diff --git a/jib-plugins-common/src/test/java/com/google/cloud/tools/jib/plugins/common/JibBuildRunnerTest.java b/jib-plugins-common/src/test/java/com/google/cloud/tools/jib/plugins/common/JibBuildRunnerTest.java index bf1786a194..e90fb2a815 100644 --- a/jib-plugins-common/src/test/java/com/google/cloud/tools/jib/plugins/common/JibBuildRunnerTest.java +++ b/jib-plugins-common/src/test/java/com/google/cloud/tools/jib/plugins/common/JibBuildRunnerTest.java @@ -256,23 +256,25 @@ public void testBuildImage_writesImageJson() throws Exception { @Test public void testBuildImage_writeImageTagDigest() throws Exception { - Set imageTagsDigest = ImmutableSet.of( + Set imageTagsDigest = + ImmutableSet.of( "gcr.io/project/image:latest@sha256:abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789", "gcr.io/project/image:custom-tag@sha256:abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789"); - String expectedImageTagsDigestOutput = "gcr.io/project/image:latest@sha256:abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789\n" + - "gcr.io/project/image:custom-tag@sha256:abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789\n"; + String expectedImageTagsDigestOutput = + "gcr.io/project/image:latest@sha256:abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789\n" + + "gcr.io/project/image:custom-tag@sha256:abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789\n"; final Path outputPath = temporaryFolder.newFile("jib-image-tag.digest").toPath(); Mockito.when(mockJibContainer.getImageTagsWithDigest()).thenReturn(imageTagsDigest); Mockito.when(mockJibContainerBuilder.containerize(mockContainerizer)) - .thenReturn(mockJibContainer); - Mockito.when(mockJibContainer.isImagePushed()).thenReturn(true); + .thenReturn(mockJibContainer); testJibBuildRunner.writeImageTagDigest(outputPath).runBuild(); - final String imageTagDigestOutput = new String(Files.readAllBytes(outputPath), StandardCharsets.UTF_8); + final String imageTagDigestOutput = + new String(Files.readAllBytes(outputPath), StandardCharsets.UTF_8); Assert.assertEquals(expectedImageTagsDigestOutput, imageTagDigestOutput); } From 3ea464ea614ff6fd22bf9bae42df2d3e8ec80798 Mon Sep 17 00:00:00 2001 From: hocine hacherouf Date: Thu, 16 Oct 2025 19:39:07 +0200 Subject: [PATCH 10/10] Addresses line length in test Ensures line length consistency in tests for better readability --- .../cloud/tools/jib/maven/JibPluginConfigurationTest.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/jib-maven-plugin/src/test/java/com/google/cloud/tools/jib/maven/JibPluginConfigurationTest.java b/jib-maven-plugin/src/test/java/com/google/cloud/tools/jib/maven/JibPluginConfigurationTest.java index 6f6481f464..ea3ffa94ef 100644 --- a/jib-maven-plugin/src/test/java/com/google/cloud/tools/jib/maven/JibPluginConfigurationTest.java +++ b/jib-maven-plugin/src/test/java/com/google/cloud/tools/jib/maven/JibPluginConfigurationTest.java @@ -206,7 +206,8 @@ public void testSystemPropertiesOutputPaths() { sessionSystemProperties.put("jib.outputPaths.digest", "/digest/path"); assertThat(testPluginConfiguration.getDigestOutputPath()).isEqualTo(Paths.get("/digest/path")); sessionSystemProperties.put("jib.outputPaths.imageTagDigest", "/image-tag-digest/path"); - assertThat(testPluginConfiguration.getImageTagDigestOutputPath()).isEqualTo(Paths.get("/image-tag-digest/path")); + assertThat(testPluginConfiguration.getImageTagDigestOutputPath()) + .isEqualTo(Paths.get("/image-tag-digest/path")); sessionSystemProperties.put("jib.outputPaths.imageId", "/id/path"); assertThat(testPluginConfiguration.getImageIdOutputPath()).isEqualTo(Paths.get("/id/path")); sessionSystemProperties.put("jib.outputPaths.tar", "/tar/path"); @@ -217,7 +218,7 @@ public void testSystemPropertiesOutputPaths() { .isEqualTo(Paths.get("/repository/project/digest/path")); sessionSystemProperties.put("jib.outputPaths.imageTagDigest", "image-tag-digest/path"); assertThat(testPluginConfiguration.getImageTagDigestOutputPath()) - .isEqualTo(Paths.get("/repository/project/image-tag-digest/path")); + .isEqualTo(Paths.get("/repository/project/image-tag-digest/path")); sessionSystemProperties.put("jib.outputPaths.imageId", "id/path"); assertThat(testPluginConfiguration.getImageIdOutputPath()) .isEqualTo(Paths.get("/repository/project/id/path"));