@Test public void shouldDisablePatching() throws Exception { envVars.set(ServiceResourceUtil.K8S_PIPELINE_SERVICE_PATCH, "disabled"); Set<HasMetadata> entities = getEntitiesFromResource("/services/invalidservice1.yaml"); ServiceResourceUtil util = new ServiceResourceUtil(); util.patchServiceName(entities); HasMetadata service = getKind(entities, "Service"); Route route = (Route) getKind(entities, "Route"); assertEquals(2, entities.size()); assertEquals("12Nodejs-rest-http", service.getMetadata().getName()); assertEquals("12Nodejs-rest-http", route.getSpec().getTo().getName()); }
public void patchServiceName(Set<HasMetadata> entities) { if(isPatchingDisabled()) { return; } Map<String, Service> services = patchServiceIfInvalidName(entities); Map<String, Route> routes = patchRouteWithService(entities, services); replace(services, entities); replace(routes, entities); }
ServiceResourceUtil implements Serializable { public void patchServiceName(Set<HasMetadata> entities) { if(isPatchingDisabled()) { return; } Map<String, Service> services = patchServiceIfInvalidName(entities); Map<String, Route> routes = patchRouteWithService(entities, services); replace(services, entities); replace(routes, entities); } }
ServiceResourceUtil implements Serializable { public void patchServiceName(Set<HasMetadata> entities) { if(isPatchingDisabled()) { return; } Map<String, Service> services = patchServiceIfInvalidName(entities); Map<String, Route> routes = patchRouteWithService(entities, services); replace(services, entities); replace(routes, entities); }  }
ServiceResourceUtil implements Serializable { public void patchServiceName(Set<HasMetadata> entities) { if(isPatchingDisabled()) { return; } Map<String, Service> services = patchServiceIfInvalidName(entities); Map<String, Route> routes = patchRouteWithService(entities, services); replace(services, entities); replace(routes, entities); }  void patchServiceName(Set<HasMetadata> entities); boolean hasInvalidDNS(Service service); }
ServiceResourceUtil implements Serializable { public void patchServiceName(Set<HasMetadata> entities) { if(isPatchingDisabled()) { return; } Map<String, Service> services = patchServiceIfInvalidName(entities); Map<String, Route> routes = patchRouteWithService(entities, services); replace(services, entities); replace(routes, entities); }  void patchServiceName(Set<HasMetadata> entities); boolean hasInvalidDNS(Service service); static final int SERVICE_NAME_MAX_LENGTH; static final String SERVICE_NAME_PREFIX; static final String K8S_PIPELINE_SERVICE_PATCH; }