| 400 | |
| 401 | |
| 402 | Future<string> ServiceManagerProcess::getServiceEndpoint(const Service& service) |
| 403 | { |
| 404 | // For the unmanaged CSI plugin, get its endpoint from |
| 405 | // `serviceEndpoints` directly. |
| 406 | if (!serviceEndpoints.empty()) { |
| 407 | if (serviceEndpoints.contains(service)) { |
| 408 | return serviceEndpoints.at(service); |
| 409 | } else { |
| 410 | return Failure( |
| 411 | stringify(service) + " not found for CSI plugin type '" + |
| 412 | info.type() + "' and name '" + info.name() + "'"); |
| 413 | } |
| 414 | } |
| 415 | |
| 416 | // For the managed CSI plugin, get its endpoint via its corresponding |
| 417 | // standalone container ID. |
| 418 | CHECK(!serviceContainers.empty()); |
| 419 | if (!serviceContainers.contains(service)) { |
| 420 | return Failure( |
| 421 | stringify(service) + " not found for CSI plugin type '" + info.type() + |
| 422 | "' and name '" + info.name() + "'"); |
| 423 | } |
| 424 | |
| 425 | return getEndpoint(serviceContainers.at(service)); |
| 426 | } |
| 427 | |
| 428 | |
| 429 | Future<string> ServiceManagerProcess::getApiVersion() |