Search in sources :

Example 1 with PodLogToEventPublisher

use of org.eclipse.che.workspace.infrastructure.kubernetes.namespace.log.PodLogToEventPublisher in project che-server by eclipse-che.

the class KubernetesInternalRuntime method watchLogsIfDebugEnabled.

private void watchLogsIfDebugEnabled(Map<String, String> startOptions) throws InfrastructureException {
    if (LogWatcher.shouldWatchLogs(startOptions)) {
        LOG.info("Debug workspace startup. Will watch the logs of '{}'", getContext().getIdentity().getWorkspaceId());
        // get all the pods we care about
        Set<String> podNames = machines.getMachines(getContext().getIdentity()).values().stream().filter(Objects::nonNull).map(KubernetesMachineImpl::getPodName).filter(Objects::nonNull).collect(Collectors.toSet());
        LOG.debug("Watch '{}' pods in workspace '{}'", podNames, getContext().getIdentity().getWorkspaceId());
        namespace.deployments().watchLogs(new PodLogToEventPublisher(this.eventPublisher, this.getContext().getIdentity()), this.eventPublisher, LogWatchTimeouts.DEFAULT, podNames, LogWatcher.getLogLimitBytes(startOptions));
    }
}
Also used : KubernetesMachineImpl(org.eclipse.che.workspace.infrastructure.kubernetes.model.KubernetesMachineImpl) PodLogToEventPublisher(org.eclipse.che.workspace.infrastructure.kubernetes.namespace.log.PodLogToEventPublisher)

Example 2 with PodLogToEventPublisher

use of org.eclipse.che.workspace.infrastructure.kubernetes.namespace.log.PodLogToEventPublisher in project devspaces-images by redhat-developer.

the class DeployBroker method watchLogsIfDebugEnabled.

private void watchLogsIfDebugEnabled(Map<String, String> startOptions, Pod pluginBrokerPod) throws InfrastructureException {
    if (LogWatcher.shouldWatchLogs(startOptions)) {
        LOG.debug("Will watch the logs of plugin broker of workspace '{}'", runtimeId.getWorkspaceId());
        namespace.deployments().watchLogs(new PodLogToEventPublisher(runtimeEventsPublisher, runtimeId), runtimeEventsPublisher, LogWatchTimeouts.AGGRESSIVE, ImmutableSet.of(pluginBrokerPod.getMetadata().getName()), LogWatcher.getLogLimitBytes(startOptions));
    }
}
Also used : PodLogToEventPublisher(org.eclipse.che.workspace.infrastructure.kubernetes.namespace.log.PodLogToEventPublisher)

Example 3 with PodLogToEventPublisher

use of org.eclipse.che.workspace.infrastructure.kubernetes.namespace.log.PodLogToEventPublisher in project che-server by eclipse-che.

the class DeployBroker method watchLogsIfDebugEnabled.

private void watchLogsIfDebugEnabled(Map<String, String> startOptions, Pod pluginBrokerPod) throws InfrastructureException {
    if (LogWatcher.shouldWatchLogs(startOptions)) {
        LOG.debug("Will watch the logs of plugin broker of workspace '{}'", runtimeId.getWorkspaceId());
        namespace.deployments().watchLogs(new PodLogToEventPublisher(runtimeEventsPublisher, runtimeId), runtimeEventsPublisher, LogWatchTimeouts.AGGRESSIVE, ImmutableSet.of(pluginBrokerPod.getMetadata().getName()), LogWatcher.getLogLimitBytes(startOptions));
    }
}
Also used : PodLogToEventPublisher(org.eclipse.che.workspace.infrastructure.kubernetes.namespace.log.PodLogToEventPublisher)

Example 4 with PodLogToEventPublisher

use of org.eclipse.che.workspace.infrastructure.kubernetes.namespace.log.PodLogToEventPublisher in project devspaces-images by redhat-developer.

the class KubernetesInternalRuntime method watchLogsIfDebugEnabled.

private void watchLogsIfDebugEnabled(Map<String, String> startOptions) throws InfrastructureException {
    if (LogWatcher.shouldWatchLogs(startOptions)) {
        LOG.info("Debug workspace startup. Will watch the logs of '{}'", getContext().getIdentity().getWorkspaceId());
        // get all the pods we care about
        Set<String> podNames = machines.getMachines(getContext().getIdentity()).values().stream().filter(Objects::nonNull).map(KubernetesMachineImpl::getPodName).filter(Objects::nonNull).collect(Collectors.toSet());
        LOG.debug("Watch '{}' pods in workspace '{}'", podNames, getContext().getIdentity().getWorkspaceId());
        namespace.deployments().watchLogs(new PodLogToEventPublisher(this.eventPublisher, this.getContext().getIdentity()), this.eventPublisher, LogWatchTimeouts.DEFAULT, podNames, LogWatcher.getLogLimitBytes(startOptions));
    }
}
Also used : KubernetesMachineImpl(org.eclipse.che.workspace.infrastructure.kubernetes.model.KubernetesMachineImpl) PodLogToEventPublisher(org.eclipse.che.workspace.infrastructure.kubernetes.namespace.log.PodLogToEventPublisher)

Aggregations

PodLogToEventPublisher (org.eclipse.che.workspace.infrastructure.kubernetes.namespace.log.PodLogToEventPublisher)4 KubernetesMachineImpl (org.eclipse.che.workspace.infrastructure.kubernetes.model.KubernetesMachineImpl)2