Skip to content

Commit

Permalink
Add javadoc, remove the superfluous validation step.
Browse files Browse the repository at this point in the history
Signed-off-by: Lukas Krejci <lkrejci@redhat.com>
  • Loading branch information
metlos committed Jun 5, 2019
1 parent 0dfe0fe commit ae6de5d
Showing 1 changed file with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,24 @@ public WorkspaceImpl createWorkspace(
return workspace;
}

/**
* Creates a workspace out of a devfile.
*
* <p>The devfile should have been validated using the
* {@link DevfileIntegrityValidator#validateDevfile(Devfile)}. This method does rest of
* the validation and actually creates the workspace.
*
* @param devfile the devfile describing the workspace
* @param namespace workspace name is unique in this namespace
* @param attributes workspace instance attributes
* @return new workspace instance
* @throws NullPointerException when either {@code config} or {@code namespace} is null
* @throws NotFoundException when account with given id was not found
* @throws ConflictException when any conflict occurs (e.g Workspace with such name already exists
* for {@code owner})
* @throws ServerException when any other error occurs
* @throws ValidationException when incoming configuration or attributes are not valid
*/
@Traced
public WorkspaceImpl createWorkspace(
Devfile devfile,
Expand All @@ -140,7 +158,6 @@ public WorkspaceImpl createWorkspace(
validator.validateAttributes(attributes);

try {
devfileIntegrityValidator.validateDevfile(devfile);
devfileIntegrityValidator.validateContentReferences(devfile, contentProvider);
} catch (DevfileFormatException e) {
throw new ValidationException(e.getMessage(), e);
Expand Down

0 comments on commit ae6de5d

Please sign in to comment.