Search in sources :

Example 71 with ImageConfiguration

use of org.eclipse.jkube.kit.config.image.ImageConfiguration in project jkube by eclipse.

the class PropertyConfigHandlerTest method testNoCacheEnabled.

@Test
public void testNoCacheEnabled() {
    String[] testData = new String[] { k(ConfigKey.NAME), "image", k(ConfigKey.NOCACHE), "true", k(ConfigKey.FROM), "base" };
    ImageConfiguration config = resolveExternalImageConfig(mergeArrays(getBaseTestData(), testData));
    assertEquals(true, config.getBuildConfiguration().getNocache());
}
Also used : ImageConfiguration(org.eclipse.jkube.kit.config.image.ImageConfiguration) RunImageConfiguration(org.eclipse.jkube.kit.config.image.RunImageConfiguration) Test(org.junit.Test)

Example 72 with ImageConfiguration

use of org.eclipse.jkube.kit.config.image.ImageConfiguration in project jkube by eclipse.

the class PropertyConfigHandlerTest method testCleanup.

@Test
public void testCleanup() {
    CleanupMode mode = CleanupMode.REMOVE;
    String[] testData = new String[] { k(ConfigKey.NAME), "image", k(ConfigKey.FROM), "base", k(ConfigKey.CLEANUP), mode.toParameter() };
    ImageConfiguration config = resolveExternalImageConfig(mergeArrays(getBaseTestData(), testData));
    assertEquals(mode, config.getBuildConfiguration().cleanupMode());
}
Also used : ImageConfiguration(org.eclipse.jkube.kit.config.image.ImageConfiguration) RunImageConfiguration(org.eclipse.jkube.kit.config.image.RunImageConfiguration) CleanupMode(org.eclipse.jkube.kit.config.image.build.CleanupMode) Test(org.junit.Test)

Example 73 with ImageConfiguration

use of org.eclipse.jkube.kit.config.image.ImageConfiguration in project jkube by eclipse.

the class PropertyConfigHandlerTest method testContextDir.

@Test
public void testContextDir() {
    String[] testData = new String[] { k(ConfigKey.NAME), "image", k(ConfigKey.CONTEXT_DIR), "dir" };
    ImageConfiguration config = resolveExternalImageConfig(mergeArrays(getBaseTestData(), testData));
    assertNotNull(config.getBuildConfiguration());
}
Also used : ImageConfiguration(org.eclipse.jkube.kit.config.image.ImageConfiguration) RunImageConfiguration(org.eclipse.jkube.kit.config.image.RunImageConfiguration) Test(org.junit.Test)

Example 74 with ImageConfiguration

use of org.eclipse.jkube.kit.config.image.ImageConfiguration in project jkube by eclipse.

the class PropertyConfigHandlerTest method testEntrypoint.

@Test
public void testEntrypoint() {
    List<ImageConfiguration> configs = resolveImage(imageConfiguration, props(mergeArrays(getBaseTestData(), new String[] { "docker.from", "base", "docker.name", "demo", "docker.entrypoint", "/entrypoint.sh --from-property" })));
    assertEquals(1, configs.size());
    BuildConfiguration buildConfig = configs.get(0).getBuildConfiguration();
    assertArrayEquals(new String[] { "/entrypoint.sh", "--from-property" }, buildConfig.getEntryPoint().asStrings().toArray());
}
Also used : BuildConfiguration(org.eclipse.jkube.kit.config.image.build.BuildConfiguration) ImageConfiguration(org.eclipse.jkube.kit.config.image.ImageConfiguration) RunImageConfiguration(org.eclipse.jkube.kit.config.image.RunImageConfiguration) Test(org.junit.Test)

Example 75 with ImageConfiguration

use of org.eclipse.jkube.kit.config.image.ImageConfiguration in project jkube by eclipse.

the class PropertyConfigHandlerTest method testSpecificEnv.

@Test
public void testSpecificEnv() {
    List<ImageConfiguration> configs = resolveImage(imageConfiguration, props(mergeArrays(getBaseTestData(), new String[] { "docker.from", "baase", "docker.name", "demo", "docker.envBuild.HOME", "/tmp", "docker.envRun.root.dir", "/bla" })));
    assertEquals(1, configs.size());
    ImageConfiguration calcConfig = configs.get(0);
    Map<String, String> env;
    env = calcConfig.getBuildConfiguration().getEnv();
    assertEquals(1, env.size());
    assertEquals("/tmp", env.get("HOME"));
    env = calcConfig.getRunConfiguration().getEnv();
    assertEquals(1, env.size());
    assertEquals("/bla", env.get("root.dir"));
}
Also used : ImageConfiguration(org.eclipse.jkube.kit.config.image.ImageConfiguration) RunImageConfiguration(org.eclipse.jkube.kit.config.image.RunImageConfiguration) Test(org.junit.Test)

Aggregations

ImageConfiguration (org.eclipse.jkube.kit.config.image.ImageConfiguration)109 Test (org.junit.Test)75 BuildConfiguration (org.eclipse.jkube.kit.config.image.build.BuildConfiguration)29 RunImageConfiguration (org.eclipse.jkube.kit.config.image.RunImageConfiguration)28 File (java.io.File)26 ArrayList (java.util.ArrayList)19 Expectations (mockit.Expectations)15 GroupArtifactVersion (org.eclipse.jkube.kit.config.resource.GroupArtifactVersion)11 Before (org.junit.Before)11 IOException (java.io.IOException)9 Properties (java.util.Properties)8 KitLogger (org.eclipse.jkube.kit.common.KitLogger)8 KubernetesListBuilder (io.fabric8.kubernetes.api.model.KubernetesListBuilder)7 JKubeServiceException (org.eclipse.jkube.kit.config.service.JKubeServiceException)7 WatchImageConfiguration (org.eclipse.jkube.kit.config.image.WatchImageConfiguration)6 ResourceConfig (org.eclipse.jkube.kit.config.resource.ResourceConfig)6 List (java.util.List)5 JKubeConfiguration (org.eclipse.jkube.kit.common.JKubeConfiguration)5 VolumeConfig (org.eclipse.jkube.kit.config.resource.VolumeConfig)5 Container (io.fabric8.kubernetes.api.model.Container)4