Search in sources :

Example 1 with Entrypoint

use of org.eclipse.che.api.core.model.workspace.devfile.Entrypoint in project che-server by eclipse-che.

the class KubernetesComponentValidator method validateEntrypointSelector.

private void validateEntrypointSelector(Component component, List<HasMetadata> filteredObjects) throws DevfileException {
    if (component.getEntrypoints() == null || component.getEntrypoints().isEmpty()) {
        return;
    }
    for (Entrypoint ep : component.getEntrypoints()) {
        ContainerSearch search = new ContainerSearch(ep.getParentName(), ep.getParentSelector(), ep.getContainerName());
        List<Container> cs = search.search(filteredObjects);
        if (cs.isEmpty()) {
            throw new DevfileFormatException(format("Component '%s' of type '%s' contains an entry point that doesn't match any" + " container.", getIdentifiableComponentName(component), component.getType()));
        }
    }
}
Also used : Container(io.fabric8.kubernetes.api.model.Container) Entrypoint(org.eclipse.che.api.core.model.workspace.devfile.Entrypoint) DevfileFormatException(org.eclipse.che.api.workspace.server.devfile.exception.DevfileFormatException)

Example 2 with Entrypoint

use of org.eclipse.che.api.core.model.workspace.devfile.Entrypoint in project devspaces-images by redhat-developer.

the class KubernetesComponentValidator method validateEntrypointSelector.

private void validateEntrypointSelector(Component component, List<HasMetadata> filteredObjects) throws DevfileException {
    if (component.getEntrypoints() == null || component.getEntrypoints().isEmpty()) {
        return;
    }
    for (Entrypoint ep : component.getEntrypoints()) {
        ContainerSearch search = new ContainerSearch(ep.getParentName(), ep.getParentSelector(), ep.getContainerName());
        List<Container> cs = search.search(filteredObjects);
        if (cs.isEmpty()) {
            throw new DevfileFormatException(format("Component '%s' of type '%s' contains an entry point that doesn't match any" + " container.", getIdentifiableComponentName(component), component.getType()));
        }
    }
}
Also used : Container(io.fabric8.kubernetes.api.model.Container) Entrypoint(org.eclipse.che.api.core.model.workspace.devfile.Entrypoint) DevfileFormatException(org.eclipse.che.api.workspace.server.devfile.exception.DevfileFormatException)

Aggregations

Container (io.fabric8.kubernetes.api.model.Container)2 Entrypoint (org.eclipse.che.api.core.model.workspace.devfile.Entrypoint)2 DevfileFormatException (org.eclipse.che.api.workspace.server.devfile.exception.DevfileFormatException)2