remove che.infra.kubernetes.pvc.wait_bound property
Signed-off-by: Andrew Obuchowicz <aobuchow@redhat.com>pull/344/head
parent
2791c8cfa2
commit
d11c28325e
|
|
@ -418,14 +418,6 @@ che.infra.kubernetes.pvc.jobs.image.pull_policy=IfNotPresent
|
|||
# Defines Pod memory limit for persistent volume claim maintenance jobs
|
||||
che.infra.kubernetes.pvc.jobs.memorylimit=250Mi
|
||||
|
||||
# Defines if {prod-short} Server should wait workspaces Persistent Volume Claims to become bound after creating.
|
||||
# Default value is `true`.
|
||||
# The parameter is used by all Persistent Volume Claim strategies.
|
||||
#
|
||||
# It should be set to `false` when `volumeBindingMode` is configured to `WaitForFirstConsumer` otherwise workspace starts will hangs up on phase of waiting PVCs.
|
||||
#
|
||||
che.infra.kubernetes.pvc.wait_bound=true
|
||||
|
||||
# Defines annotations for ingresses which are used for servers exposing. Value depends on the kind of ingress
|
||||
# controller.
|
||||
#
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@ import io.fabric8.kubernetes.api.model.VolumeMount;
|
|||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.inject.Named;
|
||||
import org.eclipse.che.account.spi.AccountImpl;
|
||||
import org.eclipse.che.api.core.Page;
|
||||
import org.eclipse.che.api.core.ServerException;
|
||||
|
|
@ -105,7 +104,6 @@ public class CommonPVCStrategy implements WorkspaceVolumesStrategy {
|
|||
|
||||
@Inject
|
||||
public CommonPVCStrategy(
|
||||
@Named("che.infra.kubernetes.pvc.wait_bound") boolean waitBound,
|
||||
PVCSubPathHelper pvcSubPathHelper,
|
||||
KubernetesNamespaceFactory factory,
|
||||
EphemeralWorkspaceAdapter ephemeralWorkspaceAdapter,
|
||||
|
|
@ -118,7 +116,7 @@ public class CommonPVCStrategy implements WorkspaceVolumesStrategy {
|
|||
this.pvcAccessMode = "TEST";
|
||||
this.preCreateDirs = true;
|
||||
this.pvcStorageClassName = "TEST";
|
||||
this.waitBound = waitBound;
|
||||
this.waitBound = true;
|
||||
this.pvcSubPathHelper = pvcSubPathHelper;
|
||||
this.factory = factory;
|
||||
this.ephemeralWorkspaceAdapter = ephemeralWorkspaceAdapter;
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ import static org.eclipse.che.workspace.infrastructure.kubernetes.namespace.Kube
|
|||
import com.google.common.collect.ImmutableMap;
|
||||
import io.fabric8.kubernetes.api.model.PersistentVolumeClaim;
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
import org.eclipse.che.api.core.model.workspace.Workspace;
|
||||
import org.eclipse.che.api.workspace.server.WorkspaceManager;
|
||||
import org.eclipse.che.api.workspace.server.spi.InfrastructureException;
|
||||
|
|
@ -52,7 +51,6 @@ public class PerWorkspacePVCStrategy extends CommonPVCStrategy {
|
|||
|
||||
@Inject
|
||||
public PerWorkspacePVCStrategy(
|
||||
@Named("che.infra.kubernetes.pvc.wait_bound") boolean waitBound,
|
||||
PVCSubPathHelper pvcSubPathHelper,
|
||||
KubernetesNamespaceFactory factory,
|
||||
EphemeralWorkspaceAdapter ephemeralWorkspaceAdapter,
|
||||
|
|
@ -61,7 +59,6 @@ public class PerWorkspacePVCStrategy extends CommonPVCStrategy {
|
|||
SubPathPrefixes subpathPrefixes,
|
||||
WorkspaceManager workspaceManager) {
|
||||
super(
|
||||
waitBound,
|
||||
pvcSubPathHelper,
|
||||
factory,
|
||||
ephemeralWorkspaceAdapter,
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@ import java.util.HashMap;
|
|||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
import org.eclipse.che.api.core.model.workspace.Workspace;
|
||||
import org.eclipse.che.api.core.model.workspace.runtime.RuntimeIdentity;
|
||||
import org.eclipse.che.api.workspace.server.spi.InfrastructureException;
|
||||
|
|
@ -85,12 +84,11 @@ public class UniqueWorkspacePVCStrategy implements WorkspaceVolumesStrategy {
|
|||
|
||||
@Inject
|
||||
public UniqueWorkspacePVCStrategy(
|
||||
@Named("che.infra.kubernetes.pvc.wait_bound") boolean waitBound,
|
||||
KubernetesNamespaceFactory factory,
|
||||
EphemeralWorkspaceAdapter ephemeralWorkspaceAdapter,
|
||||
PVCProvisioner pvcProvisioner,
|
||||
SubPathPrefixes subpathPrefixes) {
|
||||
this.waitBound = waitBound;
|
||||
this.waitBound = true;
|
||||
this.factory = factory;
|
||||
this.ephemeralWorkspaceAdapter = ephemeralWorkspaceAdapter;
|
||||
this.pvcProvisioner = pvcProvisioner;
|
||||
|
|
|
|||
|
|
@ -17,8 +17,6 @@ import static java.util.Collections.singletonMap;
|
|||
import static org.eclipse.che.api.workspace.shared.Constants.PERSIST_VOLUMES_ATTRIBUTE;
|
||||
import static org.eclipse.che.workspace.infrastructure.kubernetes.Constants.CHE_WORKSPACE_ID_LABEL;
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.ArgumentMatchers.anyLong;
|
||||
import static org.mockito.ArgumentMatchers.anyString;
|
||||
import static org.mockito.ArgumentMatchers.eq;
|
||||
import static org.mockito.Mockito.doThrow;
|
||||
import static org.mockito.Mockito.inOrder;
|
||||
|
|
@ -89,7 +87,7 @@ public class UniqueWorkspacePVCStrategyTest {
|
|||
public void setup() throws Exception {
|
||||
strategy =
|
||||
new UniqueWorkspacePVCStrategy(
|
||||
true, factory, ephemeralWorkspaceAdapter, pvcProvisioner, subpathPrefixes);
|
||||
factory, ephemeralWorkspaceAdapter, pvcProvisioner, subpathPrefixes);
|
||||
|
||||
k8sEnv = KubernetesEnvironment.builder().build();
|
||||
|
||||
|
|
@ -157,27 +155,6 @@ public class UniqueWorkspacePVCStrategyTest {
|
|||
verify(pvcs).waitBound(uniqueName, 100);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCreatesProvisionedPVCsOnPrepareIfWaitIsDisabled() throws Exception {
|
||||
strategy =
|
||||
new UniqueWorkspacePVCStrategy(
|
||||
false, // wait bound PVCs
|
||||
factory,
|
||||
ephemeralWorkspaceAdapter,
|
||||
pvcProvisioner,
|
||||
subpathPrefixes);
|
||||
|
||||
final String uniqueName = PVC_NAME_PREFIX + "-3121";
|
||||
final PersistentVolumeClaim pvc = newPVC(uniqueName);
|
||||
k8sEnv.getPersistentVolumeClaims().clear();
|
||||
k8sEnv.getPersistentVolumeClaims().putAll(singletonMap(uniqueName, pvc));
|
||||
|
||||
strategy.prepare(k8sEnv, IDENTITY, 100, emptyMap());
|
||||
|
||||
verify(pvcs).createIfNotExist(any());
|
||||
verify(pvcs, never()).waitBound(anyString(), anyLong());
|
||||
}
|
||||
|
||||
@Test(expectedExceptions = InfrastructureException.class)
|
||||
public void throwsInfrastructureExceptionWhenFailedToCreatePVCs() throws Exception {
|
||||
final PersistentVolumeClaim pvc = mock(PersistentVolumeClaim.class);
|
||||
|
|
|
|||
Loading…
Reference in New Issue