diff --git a/infrastructures/kubernetes/src/main/java/org/eclipse/che/workspace/infrastructure/kubernetes/provision/AsyncStorageProvisioner.java b/infrastructures/kubernetes/src/main/java/org/eclipse/che/workspace/infrastructure/kubernetes/provision/AsyncStorageProvisioner.java index cc945e4141..02ea0cd555 100644 --- a/infrastructures/kubernetes/src/main/java/org/eclipse/che/workspace/infrastructure/kubernetes/provision/AsyncStorageProvisioner.java +++ b/infrastructures/kubernetes/src/main/java/org/eclipse/che/workspace/infrastructure/kubernetes/provision/AsyncStorageProvisioner.java @@ -17,6 +17,7 @@ import static java.lang.String.format; import static java.lang.String.valueOf; import static java.util.Collections.singletonList; import static org.eclipse.che.api.workspace.shared.Constants.ASYNC_PERSIST_ATTRIBUTE; +import static org.eclipse.che.api.workspace.shared.Constants.PERSIST_VOLUMES_ATTRIBUTE; import static org.eclipse.che.workspace.infrastructure.kubernetes.Constants.CHE_DEPLOYMENT_NAME_LABEL; import static org.eclipse.che.workspace.infrastructure.kubernetes.Constants.CHE_USER_ID_LABEL; import static org.eclipse.che.workspace.infrastructure.kubernetes.Warnings.NOT_ABLE_TO_PROVISION_SSH_KEYS; @@ -169,7 +170,7 @@ public class AsyncStorageProvisioner { String message = format( "Workspace configuration not valid: Asynchronous storage available only if '%s' attribute set to false", - ASYNC_PERSIST_ATTRIBUTE); + PERSIST_VOLUMES_ATTRIBUTE); LOG.warn(message); k8sEnv.addWarning(new WarningImpl(4200, message)); throw new InfrastructureException(message); diff --git a/infrastructures/kubernetes/src/test/java/org/eclipse/che/workspace/infrastructure/kubernetes/provision/AsyncStorageProvisionerTest.java b/infrastructures/kubernetes/src/test/java/org/eclipse/che/workspace/infrastructure/kubernetes/provision/AsyncStorageProvisionerTest.java index e5dfbe8cc9..376ce45bca 100644 --- a/infrastructures/kubernetes/src/test/java/org/eclipse/che/workspace/infrastructure/kubernetes/provision/AsyncStorageProvisionerTest.java +++ b/infrastructures/kubernetes/src/test/java/org/eclipse/che/workspace/infrastructure/kubernetes/provision/AsyncStorageProvisionerTest.java @@ -122,7 +122,10 @@ public class AsyncStorageProvisionerTest { sshPair = new SshPairImpl(USER, "internal", SSH_KEY_NAME, "", ""); } - @Test(expectedExceptions = InfrastructureException.class) + @Test( + expectedExceptions = InfrastructureException.class, + expectedExceptionsMessageRegExp = + "Workspace configuration not valid: Asynchronous storage available only for 'common' PVC strategy.*") public void shouldThrowExceptionIfNotCommonStrategy() throws Exception { AsyncStorageProvisioner asyncStorageProvisioner = new AsyncStorageProvisioner( @@ -142,7 +145,10 @@ public class AsyncStorageProvisionerTest { verifyNoMoreInteractions(identity); } - @Test(expectedExceptions = InfrastructureException.class) + @Test( + expectedExceptions = InfrastructureException.class, + expectedExceptionsMessageRegExp = + "Workspace configuration not valid: Asynchronous storage available only if 'persistVolumes' attribute set to false") public void shouldThrowExceptionIfAsyncStorageForNotEphemeralWorkspace() throws Exception { Map attributes = new HashMap<>(2); attributes.put(ASYNC_PERSIST_ATTRIBUTE, "true");