use of org.eclipse.che.api.workspace.server.spi.environment.InternalMachineConfig in project devspaces-images by redhat-developer.
the class MachineResolverTest method shouldAddProjectMountPointWhenMountSources.
@Test
public void shouldAddProjectMountPointWhenMountSources() throws InfrastructureException {
cheContainer.setMountSources(true);
InternalMachineConfig config = resolver.resolve();
assertEquals(1, config.getVolumes().size());
assertEquals(PROJECTS_MOUNT_PATH, config.getVolumes().get(Constants.PROJECTS_VOLUME_NAME).getPath());
}
use of org.eclipse.che.api.workspace.server.spi.environment.InternalMachineConfig in project devspaces-images by redhat-developer.
the class MachineResolverTest method shouldSetDefaultMemLimitAndRequestIfSidecarDoesNotHaveOne.
@Test
public void shouldSetDefaultMemLimitAndRequestIfSidecarDoesNotHaveOne() throws InfrastructureException {
InternalMachineConfig machineConfig = resolver.resolve();
assertEquals(machineConfig.getAttributes().get(MEMORY_LIMIT_ATTRIBUTE), DEFAULT_MEM_LIMIT);
assertEquals(machineConfig.getAttributes().get(MEMORY_REQUEST_ATTRIBUTE), DEFAULT_MEM_REQUEST);
}
use of org.eclipse.che.api.workspace.server.spi.environment.InternalMachineConfig in project devspaces-images by redhat-developer.
the class MachineResolverTest method shouldOverrideMemoryLimitOfASidecarIfCorrespondingWSConfigAttributeIsSet.
@Test
public void shouldOverrideMemoryLimitOfASidecarIfCorrespondingWSConfigAttributeIsSet() throws InfrastructureException {
String memoryLimit = "300Mi";
String expectedMemLimit = toBytesString(memoryLimit);
Containers.addRamLimit(container, 123456789);
component.setMemoryLimit(memoryLimit);
InternalMachineConfig machineConfig = resolver.resolve();
assertEquals(machineConfig.getAttributes().get(MEMORY_LIMIT_ATTRIBUTE), expectedMemLimit);
}
use of org.eclipse.che.api.workspace.server.spi.environment.InternalMachineConfig in project devspaces-images by redhat-developer.
the class KubernetesPluginsToolingApplierTest method addsMachineWithServersThatUseSamePortButDifferentNames.
@Test
public void addsMachineWithServersThatUseSamePortButDifferentNames() throws Exception {
// given
ChePlugin chePlugin = createChePlugin();
addPortToSingleContainerPlugin(chePlugin, 80, "test-port/http", emptyMap(), true);
addPortToSingleContainerPlugin(chePlugin, 80, "test-port/ws", emptyMap(), true);
// when
applier.apply(runtimeIdentity, internalEnvironment, singletonList(chePlugin));
// then
InternalMachineConfig machineConfig = getOneAndOnlyNonUserMachine(internalEnvironment);
assertEquals(machineConfig.getServers(), expectedTwoServers(80, "test-port/http", emptyMap(), true, 80, "test-port/ws", emptyMap(), true));
}
use of org.eclipse.che.api.workspace.server.spi.environment.InternalMachineConfig in project devspaces-images by redhat-developer.
the class KubernetesPluginsToolingApplierTest method addsTwoServersForContainers.
@Test
public void addsTwoServersForContainers() throws Exception {
// given
ChePlugin chePlugin = createChePlugin();
addPortToSingleContainerPlugin(chePlugin, 80, "test-port", emptyMap(), true);
addPortToSingleContainerPlugin(chePlugin, 8090, "another-test-port", emptyMap(), false);
// when
applier.apply(runtimeIdentity, internalEnvironment, singletonList(chePlugin));
// then
InternalMachineConfig machineConfig = getOneAndOnlyNonUserMachine(internalEnvironment);
assertEquals(machineConfig.getServers(), expectedTwoServers(80, "test-port", emptyMap(), true, 8090, "another-test-port", emptyMap(), false));
}
Aggregations