Search in sources :

Example 16 with ImageConfiguration

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

the class PropertyConfigHandlerTest method testFilter.

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

Example 17 with ImageConfiguration

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

the class PropertyConfigHandlerTest method testCacheFrom.

@Test
public void testCacheFrom() {
    String[] testData = new String[] { k(ConfigKey.NAME), "image", k(ConfigKey.CACHEFROM), "foo/bar:latest", k(ConfigKey.FROM), "base" };
    ImageConfiguration config = resolveExternalImageConfig(mergeArrays(getBaseTestData(), testData));
    assertEquals(Collections.singletonList("foo/bar:latest"), config.getBuildConfiguration().getCacheFrom());
}
Also used : ImageConfiguration(org.eclipse.jkube.kit.config.image.ImageConfiguration) RunImageConfiguration(org.eclipse.jkube.kit.config.image.RunImageConfiguration) Test(org.junit.Test)

Example 18 with ImageConfiguration

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

the class PropertyConfigHandlerTest method testNoCacheDisabled.

@Test
public void testNoCacheDisabled() throws Exception {
    String[] testData = new String[] { k(ConfigKey.NAME), "image", k(ConfigKey.NOCACHE), "false", k(ConfigKey.FROM), "base" };
    ImageConfiguration config = resolveExternalImageConfig(mergeArrays(getBaseTestData(), testData));
    assertEquals(false, 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 19 with ImageConfiguration

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

the class PropertyConfigHandlerTest method testNoBuildConfig.

@Test
public void testNoBuildConfig() {
    String[] testData = new String[] { k(ConfigKey.NAME), "image" };
    ImageConfiguration config = resolveExternalImageConfig(testData);
    assertNull(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 20 with ImageConfiguration

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

the class PropertyConfigHandlerTest method testShell.

@Test
public void testShell() {
    List<ImageConfiguration> configs = resolveImage(imageConfiguration, props(mergeArrays(getBaseTestData(), new String[] { "docker.from", "base", "docker.name", "demo", "docker.shell", "/bin/sh -c" })));
    assertEquals(1, configs.size());
    BuildConfiguration buildConfig = configs.get(0).getBuildConfiguration();
    String[] shell = new ArrayList<>(buildConfig.getShell().asStrings()).toArray(new String[buildConfig.getShell().asStrings().size()]);
    assertArrayEquals(new String[] { "/bin/sh", "-c" }, shell);
}
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)

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