Package io.fabric8.kubernetes.api.model

Examples of io.fabric8.kubernetes.api.model.CurrentState


                if (!pods.isEmpty()) {
                    Map<String, Container> containerMap = createPodIdToContainerMap(containerArray);

                    for (PodSchema item : pods) {
                        String podId = item.getId();
                        CurrentState currentState = item.getCurrentState();
                        if (currentState != null) {
                            String host = currentState.getHost();
                            String hostIp = currentState.getHost();
                            String status = currentState.getStatus();

                            Container container = containerMap.remove(podId);
                            if (container != null) {
                                DesiredState desiredState = item.getDesiredState();
                                if (desiredState != null) {
View Full Code Here


        System.out.println("Labels: ");
        Map<String, String> labels = podInfo.getLabels();
        for (Map.Entry<String, String> entry : labels.entrySet()) {
            System.out.println(indent + entry.getKey() + " = " + entry.getValue());
        }
        CurrentState currentState = podInfo.getCurrentState();
        if (currentState != null) {
            printValue("Host", currentState.getHost());
            printValue("IP", currentState.getPodIP());
            printValue("Status", currentState.getStatus());
            PodContainerManifest manifest = currentState.getManifest();
        }
        DesiredState desiredState = podInfo.getDesiredState();
        if (desiredState != null) {
            ManifestSchema manifest = desiredState.getManifest();
            if (manifest != null) {
View Full Code Here

            for (Port port : ports) {
                Integer containerPort = port.getContainerPort();
                if (containerPort != null) {
                    String name = port.getName();
                    if (containerPort == 8778 || (Objects.equals("jolokia", name) && containerPort.intValue() > 0)) {
                        CurrentState currentState = pod.getCurrentState();
                        String podIP = currentState.getPodIP();
                        if (Strings.isNotBlank(podIP)) {
                            return createJolokiaClientFromHostAndPort(container, podIP, containerPort);
                        }
                        Integer hostPort = port.getHostPort();
                        if (hostPort != null && hasDocker(pod)) {
View Full Code Here

    /**
     * Returns true if we detect we are running inside docker
     */
    protected boolean hasDocker(PodSchema pod) {
        CurrentState currentState = pod.getCurrentState();
        if (currentState != null) {
            Map<String, PodCurrentContainerInfo> info = currentState.getInfo();
            if (info != null) {
                Collection<PodCurrentContainerInfo> containers = info.values();
                for (PodCurrentContainerInfo container : containers) {
                    DetailInfo detailInfo = container.getDetailInfo();
                    if (detailInfo != null) {
View Full Code Here

        }
        Filter<PodSchema> filter = KubernetesHelpers.createPodFilter(filterText);
        for (PodSchema item : items) {
            if (filter.matches(item)) {
                String id = item.getId();
                CurrentState currentState = item.getCurrentState();
                String status = "";
                String host = "";
                if (currentState != null) {
                    status = currentState.getStatus();
                    host = currentState.getHost();
                }
                Map<String, String> labelMap = item.getLabels();
                String labels = KubernetesHelpers.toLabelsString(labelMap);
                DesiredState desiredState = item.getDesiredState();
                if (desiredState != null) {
View Full Code Here

    /**
     * Returns all the current containers from the given currentState
     */
    public static Map<String, PodCurrentContainerInfo> getCurrentContainers(PodSchema pod) {
        if (pod != null) {
            CurrentState currentState = pod.getCurrentState();
            return getCurrentContainers(currentState);

        }
        return Collections.EMPTY_MAP;
    }
View Full Code Here

    /**
     * Returns the host of the pod
     */
    public static String getHost(PodSchema pod) {
        if (pod != null) {
            CurrentState currentState = pod.getCurrentState();
            if (currentState != null) {
                return currentState.getHost();
            }
        }
        return null;
    }
View Full Code Here

                    status = currentState.getStatus();
                    host = currentState.getHost();
                }
                Map<String, String> labelMap = item.getLabels();
                String labels = KubernetesHelper.toLabelsString(labelMap);
                DesiredState desiredState = item.getDesiredState();
                if (desiredState != null) {
                    Manifest manifest = desiredState.getManifest();
                    if (manifest != null) {
                        List<ManifestContainer> containers = manifest.getContainers();
                        for (ManifestContainer container : containers) {
                            String image = container.getImage();
                            table.row(id, image, host, labels, status);
View Full Code Here

            printValue("Host", currentState.getHost());
            printValue("IP", currentState.getPodIP());
            printValue("Status", currentState.getStatus());
            PodContainerManifest manifest = currentState.getManifest();
        }
        DesiredState desiredState = podInfo.getDesiredState();
        if (desiredState != null) {
            Manifest manifest = desiredState.getManifest();
            if (manifest != null) {
                List<ManifestContainer> containers = manifest.getContainers();
                if (notEmpty(containers)) {
                    System.out.println("Containers:");
                    indentCount++;
View Full Code Here

                }
                Map<String, String> labelMap = item.getLabels();
                String labels = KubernetesHelper.toLabelsString(labelMap);
                DesiredState desiredState = item.getDesiredState();
                if (desiredState != null) {
                    Manifest manifest = desiredState.getManifest();
                    if (manifest != null) {
                        List<ManifestContainer> containers = manifest.getContainers();
                        for (ManifestContainer container : containers) {
                            String image = container.getImage();
                            table.row(id, image, host, labels, status);

                            id = "";
View Full Code Here

TOP

Related Classes of io.fabric8.kubernetes.api.model.CurrentState

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.