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