def create_container_config(container): if container is Empty: return Container(MesosContainer(), None) elif container.docker() is not Empty: params = list() if container.docker().parameters() is not Empty: for p in fully_interpolated(container.docker().parameters()): params.append(DockerParameter(p['name'], p['value'])) return Container(None, DockerContainer(fully_interpolated(container.docker().image()), params)) else: raise InvalidConfig('If a container is specified it must set one type.')
def create_docker_container(container): params = list() if container.parameters() is not Empty: for p in fully_interpolated(container.parameters()): params.append(DockerParameter(p['name'], p['value'])) return DockerContainer(fully_interpolated(container.image()), params)
def test_sandbox_provider_docker_container(): sandbox = DefaultSandboxProvider().from_assigned_task( AssignedTask(task=TaskConfig(container=Container( docker=DockerContainer())))) assert sandbox._user is None