/** * Check if docker is running on VMware Integrated Container host. * * @param computeState * host to check * @return boolean value */ public static boolean isVicHost(ComputeState computeState) { boolean vic = false; String driver = getDriver(computeState); driver = driver != null ? driver.toLowerCase().trim() : ""; vic = driver.startsWith(VMWARE_VIC_DRIVER1) || driver.startsWith(VMWARE_VIC_DRIVER2); return vic; }
@Test public void testGetDriver() { final String driver = "overlay"; ComputeService.ComputeState state = new ComputeService.ComputeState(); state.customProperties = new HashMap<>(); state.customProperties.put(ContainerHostUtil.PROPERTY_NAME_DRIVER, driver); String result = ContainerHostUtil.getDriver(state); assertEquals(driver, result); // negative test state.customProperties = null; result = ContainerHostUtil.getDriver(state); assertNull(result); }
if (ContainerHostUtil.getDriver(host) == null) { logInfo("Skipping the installation of the system container." + "The driver is not initialized.");