use of org.eclipse.jkube.kit.config.resource.GroupArtifactVersion in project jkube by eclipse.
the class MavenProjectEnricherTest method setupExpectations.
@Before
public void setupExpectations() {
new Expectations() {
{
context.getGav();
result = new GroupArtifactVersion("groupId", "artifactId", "version");
}
};
}
use of org.eclipse.jkube.kit.config.resource.GroupArtifactVersion in project jkube by eclipse.
the class KubernetesResourceUtilTest method extractContainerName.
@Test
public void extractContainerName() {
// Given
final ImageConfiguration imageConfiguration = ImageConfiguration.builder().name("dummy-image").registry("example.com/someregistry").name("test").build();
// When
final String result = KubernetesResourceUtil.extractContainerName(new GroupArtifactVersion("io.fabric8-test-", "fabric8-maven-plugin-dummy", "0"), imageConfiguration);
// Then
assertThat(result).isEqualTo("iofabric8-test--fabric8-maven-plugin-dummy");
}
use of org.eclipse.jkube.kit.config.resource.GroupArtifactVersion in project jkube by eclipse.
the class ContainerHandlerTest method imagePullPolicyWithPolicySetTest.
@Test
public void imagePullPolicyWithPolicySetTest() {
// check if policy is set then both in case of version is not null or null
// project with version and ending in SNAPSHOT
project1.setVersion("3.5-SNAPSHOT");
// project with version but not ending in SNAPSHOT
project2.setVersion("3.5-NEW");
// creating container Handler for all
ContainerHandler handler1 = new ContainerHandler(project1.getProperties(), new GroupArtifactVersion("g", "a", "3.5-SNAPSHOT"), probeHandler);
ContainerHandler handler2 = new ContainerHandler(project2.getProperties(), new GroupArtifactVersion("g", "a", "3.5-NEW"), probeHandler);
images.clear();
images.add(imageConfiguration1);
containers = handler1.getContainers(config1, images);
assertEquals("IfNotPresent", containers.get(0).getImagePullPolicy());
containers = handler2.getContainers(config1, images);
assertEquals("IfNotPresent", containers.get(0).getImagePullPolicy());
}
use of org.eclipse.jkube.kit.config.resource.GroupArtifactVersion in project jkube by eclipse.
the class DeploymentHandlerTest method before.
@Before
public void before() {
// volume config with name and multiple mount
mounts.add("/path/system");
mounts.add("/path/sys");
ports.add("8080");
ports.add("9090");
tags.add("latest");
tags.add("test");
VolumeConfig volumeConfig1 = VolumeConfig.builder().name("test").mounts(mounts).type("hostPath").path("/test/path").build();
volumes1.add(volumeConfig1);
// container name with alias
final BuildConfiguration buildImageConfiguration = BuildConfiguration.builder().ports(ports).from("fabric8/maven:latest").cleanup("try").tags(tags).compressionString("gzip").build();
ImageConfiguration imageConfiguration = ImageConfiguration.builder().name("test").alias("test-app").build(buildImageConfiguration).registry("docker.io").build();
images.add(imageConfiguration);
deploymentHandler = new DeploymentHandler(new PodTemplateHandler(new ContainerHandler(project.getProperties(), new GroupArtifactVersion("g", "a", "v"), probeHandler)));
}
use of org.eclipse.jkube.kit.config.resource.GroupArtifactVersion in project jkube by eclipse.
the class KubernetesResourceUtilTest method extractContainerName_withPeriodsInImageUser_shouldRemovePeriodsFromContainerName.
@Test
public void extractContainerName_withPeriodsInImageUser_shouldRemovePeriodsFromContainerName() {
// Given
final ImageConfiguration imageConfiguration = ImageConfiguration.builder().name("org.eclipse.jkube.testing/test-image").build();
final GroupArtifactVersion gav = new GroupArtifactVersion("org.eclipse.jkube.testing", "test-image", "1.0.0");
// When
final String result = KubernetesResourceUtil.extractContainerName(gav, imageConfiguration);
// Then
assertThat(result).isEqualTo("orgeclipsejkubetesting-test-image");
}
Aggregations