| 427 | |
| 428 | |
| 429 | Future<string> ServiceManagerProcess::getApiVersion() |
| 430 | { |
| 431 | if (apiVersion.isSome()) { |
| 432 | return apiVersion.get(); |
| 433 | } |
| 434 | |
| 435 | // Ensure that the unmanaged CSI plugin has been probed (which does the API |
| 436 | // version detection) before returning the API version. |
| 437 | if (!serviceEndpoints.empty()) { |
| 438 | return probeEndpoint(serviceEndpoints.begin()->second) |
| 439 | .then(process::defer(self(), [=] { return CHECK_NOTNONE(apiVersion); })); |
| 440 | } |
| 441 | |
| 442 | // For the managed CSI plugin, `probeEndpoint` will be internally called by |
| 443 | // `getEndpoint` to do the API version detection. |
| 444 | CHECK(!serviceContainers.empty()); |
| 445 | return getEndpoint(serviceContainers.begin()->second) |
| 446 | .then(process::defer(self(), [=] { return CHECK_NOTNONE(apiVersion); })); |
| 447 | } |
| 448 | |
| 449 | |
| 450 | Option<CSIPluginContainerInfo> ServiceManagerProcess::getContainerInfo( |