Skip to content

Commit

Permalink
make mode optional in SingularityVolume
Browse files Browse the repository at this point in the history
  • Loading branch information
ssalinas committed Jun 16, 2015
1 parent aa3e8c1 commit 4e2304b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Expand Up @@ -9,13 +9,13 @@
public class SingularityVolume {
private final String containerPath;
private final Optional<String> hostPath;
private final Mode mode;
private final Optional<Mode> mode;

@JsonCreator
public SingularityVolume(
@JsonProperty("containerPath") String containerPath,
@JsonProperty("hostPath") Optional<String> hostPath,
@JsonProperty("mode") Mode mode) {
@JsonProperty("mode") Optional<Mode> mode) {
this.containerPath = containerPath;
this.hostPath = hostPath;
this.mode = mode;
Expand All @@ -29,7 +29,7 @@ public Optional<String> getHostPath() {
return hostPath;
}

public Mode getMode() {
public Optional<Mode> getMode() {
return mode;
}

Expand Down
Expand Up @@ -220,7 +220,9 @@ private void prepareContainerInfo(final SingularityTaskId taskId, final TaskInfo
if (volumeInfo.getHostPath().isPresent()) {
volumeBuilder.setHostPath(fillInTaskIdValues(volumeInfo.getHostPath().get(), taskId));
}
volumeBuilder.setMode(volumeInfo.getMode());
if (volumeInfo.getMode().isPresent()) {
volumeBuilder.setMode(volumeInfo.getMode().get());
}
containerBuilder.addVolumes(volumeBuilder);
}

Expand Down

0 comments on commit 4e2304b

Please sign in to comment.