-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CHE-22: check environment parameter on workspace start #518
Conversation
ок |
@@ -30,7 +30,7 @@ | |||
@Singleton | |||
public class DefaultWorkspaceConfigValidator implements WorkspaceConfigValidator { | |||
/* should contain [3, 20] characters, first and last character is letter or digit, available characters {A-Za-z0-9.-_}*/ | |||
private static final Pattern WS_NAME = Pattern.compile("[\\w][\\w\\.\\-]{1,18}[\\w]"); | |||
private static final Pattern WS_NAME = Pattern.compile("[a-zA-Z0-9][-a-zA-Z0-9.]{1,18}[a-zA-Z0-9]"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You made a small mistake here as \\w
includes underscore _
as well, so the second [-a-zA-Z0-9.]
should include underscore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, 10x
10e4f9e
to
166c2f5
Compare
@skabashnyuk @evoevodin I reworked the PR. Please take a look. |
ok |
@@ -588,6 +592,19 @@ UsersWorkspaceImpl performAsyncStart(UsersWorkspaceImpl workspace, | |||
} | |||
workspace.setTemporary(false); | |||
workspace.setStatus(WorkspaceStatus.STARTING); | |||
|
|||
if (envName != null && !workspace.getConfig() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that it is the same but shorter
!workspace.getConfig()
.getEnvironments()
.stream()
.anyMatch(env -> env.getName().equals(envName);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lokks better, thanks
ok |
3015466
to
2986552
Compare
Signed-off-by: Alexander Garagatyi <agaragatyi@codenvy.com>
CHE-22: check environment parameter on workspace start
Signed-off-by: Alexander Garagatyi agaragatyi@codenvy.com
@skabashnyuk @evoevodin Please review.