Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: pull docker image by digest #300

Merged
merged 2 commits into from
Jul 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
import java.io.IOException;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.net.URI;
import java.net.URISyntaxException;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Collections;
Expand Down Expand Up @@ -53,7 +55,7 @@ public void beforeEach(ExtensionContext context) throws Exception {
}
}

private JKubeGradleRunner getJKubeGradleRunner(ExtensionContext context) throws IOException, InterruptedException {
private JKubeGradleRunner getJKubeGradleRunner(ExtensionContext context) throws URISyntaxException {
synchronized (context.getRoot()) {
var singletonJKubeGradleRunner = getStore(context).get(JKubeGradleRunner.class, JKubeGradleRunner.class);
if (singletonJKubeGradleRunner != null) {
Expand All @@ -70,7 +72,8 @@ private JKubeGradleRunner getJKubeGradleRunner(ExtensionContext context) throws
}
var projectPath = rootPath.resolve("projects-to-be-tested").resolve("gradle");
var gradleRunner = GradleRunner.create()
.withGradleInstallation(getGradleInstallation())
.withGradleDistribution(new URI("https://services.gradle.org/distributions/gradle-7.6-bin.zip"))
// .withGradleInstallation(getGradleInstallation())
Copy link
Member

Choose a reason for hiding this comment

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

getGradleInstallation is no longer used anywhere. We should remove it.

Copy link
Member Author

Choose a reason for hiding this comment

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

we yet need to see if we want to change this approach in a per-test basis. Left there for evaluation of options.

.withProjectDir(projectPath.toFile());
if (annotation.forwardOutput()) {
gradleRunner.forwardOutput();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
package org.eclipse.jkube.integrationtests.jupiter.api.extension;

import io.fabric8.junit.jupiter.HasKubernetesClient;
import io.fabric8.kubernetes.api.model.IntOrString;
import io.fabric8.kubernetes.api.model.ServiceBuilder;
import org.eclipse.jkube.integrationtests.cli.CliUtils;
import org.eclipse.jkube.integrationtests.jupiter.api.DockerRegistry;
import org.eclipse.jkube.integrationtests.jupiter.api.DockerRegistryHost;
Expand All @@ -38,6 +36,8 @@ public class RegistryExtension implements HasKubernetesClient, BeforeAllCallback

private static final Logger log = LoggerFactory.getLogger(RegistryExtension.class);

private static final String DOCKER_REGISTRY_AMD64_LINUX_IMAGE = "registry:2.8.2@sha256:0f7e785a49386d7e98c502151f9b01dc5578aa4f13078a346b2c5cf50433f663";

@Override
public void beforeAll(ExtensionContext context) throws Exception {
final var annotation = context.getRequiredTestClass().getAnnotation(DockerRegistry.class);
Expand Down Expand Up @@ -72,7 +72,7 @@ public void afterAll(ExtensionContext context) throws Exception {
private static CliUtils.CliResult startRegularDockerRegistry(DockerRegistry dockerRegistry) throws IOException, InterruptedException {
log.debug(() -> "Starting standard Docker Registry");
return CliUtils.runCommand("docker run --rm -d -p " + dockerRegistry.port() +":5000 --name " +
getName(dockerRegistry) + " registry:2");
getName(dockerRegistry) + " " + DOCKER_REGISTRY_AMD64_LINUX_IMAGE);
}

private static CliUtils.CliResult startWindowsDockerRegistry(DockerRegistry dockerRegistry) throws IOException, InterruptedException {
Expand Down
Loading