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());
}
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());
}
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());
}
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());
}
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"));
}
Aggregations