use of com.hubspot.mesos.SingularityAppcImage in project Singularity by HubSpot.
the class SingularityMesosTaskBuilder method prepareMesosInfo.
private void prepareMesosInfo(ContainerInfo.Builder containerBuilder, final SingularityContainerInfo containerInfo) {
if (!containerInfo.getMesos().isPresent()) {
return;
}
final MesosInfo.Builder builder = MesosInfo.newBuilder();
final SingularityMesosInfo mesos = containerInfo.getMesos().get();
if (mesos.getImage().isPresent()) {
final SingularityMesosImage image = mesos.getImage().get();
final Image.Builder imageBuilder = Image.newBuilder();
imageBuilder.setType(Image.Type.valueOf(image.getType().toString()));
if (image.getAppc().isPresent()) {
final SingularityAppcImage appc = image.getAppc().get();
final Image.Appc.Builder appcBuilder = Image.Appc.newBuilder();
appcBuilder.setName(appc.getName());
if (appc.getId().isPresent()) {
appcBuilder.setId(appc.getId().get());
}
imageBuilder.setAppc(appcBuilder.build());
}
if (image.getDocker().isPresent()) {
final SingularityDockerImage docker = image.getDocker().get();
final Image.Docker.Builder dockerBuilder = Image.Docker.newBuilder();
dockerBuilder.setName(docker.getName());
imageBuilder.setDocker(dockerBuilder.build());
}
builder.setImage(imageBuilder.build());
}
containerBuilder.setMesos(builder.build());
}
Aggregations