use of com.google.cloud.tools.jib.configuration.ImageConfiguration in project jib by GoogleContainerTools.
the class ContainerizerTest method testGetImageConfiguration_dockerDaemonImage.
@Test
public void testGetImageConfiguration_dockerDaemonImage() throws InvalidImageReferenceException {
Containerizer containerizer = Containerizer.to(DockerDaemonImage.named("docker/deamon/image"));
ImageConfiguration imageConfiguration = containerizer.getImageConfiguration();
Assert.assertEquals("docker/deamon/image", imageConfiguration.getImage().toString());
Assert.assertEquals(0, imageConfiguration.getCredentialRetrievers().size());
}
use of com.google.cloud.tools.jib.configuration.ImageConfiguration in project jib by GoogleContainerTools.
the class PluginConfigurationProcessorTest method testGetJavaContainerBuilderWithBaseImage_tarBase.
@Test
public void testGetJavaContainerBuilderWithBaseImage_tarBase() throws IncompatibleBaseImageJavaVersionException, IOException, InvalidImageReferenceException, CacheDirectoryCreationException {
when(rawConfiguration.getFromImage()).thenReturn(Optional.of("tar:///path/to.tar"));
ImageConfiguration result = getCommonImageConfiguration();
assertThat(result.getTarPath()).hasValue(Paths.get("/path/to.tar"));
assertThat(result.getDockerClient()).isEmpty();
}
use of com.google.cloud.tools.jib.configuration.ImageConfiguration in project jib by GoogleContainerTools.
the class PluginConfigurationProcessorTest method testGetJavaContainerBuilderWithBaseImage_java12BaseImage.
// https://github.com/GoogleContainerTools/jib/issues/1995
@Test
public void testGetJavaContainerBuilderWithBaseImage_java12BaseImage() throws InvalidImageReferenceException, IOException, IncompatibleBaseImageJavaVersionException, CacheDirectoryCreationException {
when(projectProperties.getMajorJavaVersion()).thenReturn(12);
when(rawConfiguration.getFromImage()).thenReturn(Optional.of("regis.try/java12image"));
ImageConfiguration imageConfiguration = getCommonImageConfiguration();
assertThat(imageConfiguration.getImageRegistry()).isEqualTo("regis.try");
assertThat(imageConfiguration.getImageRepository()).isEqualTo("java12image");
}
use of com.google.cloud.tools.jib.configuration.ImageConfiguration in project jib by GoogleContainerTools.
the class PluginConfigurationProcessorTest method testGetJavaContainerBuilderWithBaseImage_dockerBase.
@Test
public void testGetJavaContainerBuilderWithBaseImage_dockerBase() throws IncompatibleBaseImageJavaVersionException, IOException, InvalidImageReferenceException, CacheDirectoryCreationException {
when(rawConfiguration.getFromImage()).thenReturn(Optional.of("docker://ima.ge/name"));
ImageConfiguration result = getCommonImageConfiguration();
assertThat(result.getImage().toString()).isEqualTo("ima.ge/name");
assertThat(result.getDockerClient()).isPresent();
assertThat(result.getTarPath()).isEmpty();
}
Aggregations