예제 #1
0
Try<Owned<VolumeManager>> VolumeManager::create(
    const http::URL& agentUrl,
    const string& rootDir,
    const CSIPluginInfo& info,
    const hashset<Service>& services,
    const string& containerPrefix,
    const Option<string>& authToken,
    Metrics* metrics)
{
  if (services.empty()) {
    return Error(
        "Must specify at least one service for CSI plugin type '" +
        info.type() + "' and name '" + info.name() + "'");
  }

  return new v0::VolumeManager(
      agentUrl,
      rootDir,
      info,
      services,
      containerPrefix,
      authToken,
      Runtime(),
      metrics);
}
예제 #2
0
파일: type_utils.cpp 프로젝트: mpark/mesos
bool operator==(const CSIPluginInfo& left, const CSIPluginInfo& right)
{
  // Order of containers is important.
  if (left.containers_size() != right.containers_size()) {
    return false;
  }

  for (int i = 0; i < left.containers_size(); i++) {
    if (left.containers(i) != right.containers(i)) {
      return false;
    }
  }

  return left.type() == right.type() &&
    left.name() == right.name();
}