Package io.fabric8.patch

Examples of io.fabric8.patch.Result


        builder.add(replicationControllerId);
    }

    @Override
    public Result execute(UIExecutionContext context) throws Exception {
        Kubernetes kubernetes = getKubernetes();

        String idText = replicationControllerId.getValue();
        ReplicationControllerSchema replicationController = kubernetes.getReplicationController(idText);
        if (replicationController == null) {
            System.out.println("No replicationController for id: " + idText);
        } else {
            executeReplicationController(replicationController);
        }
View Full Code Here


        builder.add(serviceId);
    }

    @Override
    public Result execute(UIExecutionContext context) throws Exception {
        Kubernetes kubernetes = getKubernetes();

        String idText = serviceId.getValue();
        ServiceSchema service = kubernetes.getService(idText);
        if (service == null) {
            System.out.println("No service for id: " + idText);
        } else {
            executeService(service);
        }
View Full Code Here

        builder.add(podId);
    }

    @Override
    public Result execute(UIExecutionContext context) throws Exception {
        Kubernetes kubernetes = getKubernetes();

        String podIdText = podId.getValue();
        PodSchema podInfo = kubernetes.getPod(podIdText);
        if (podInfo == null) {
            System.out.println("No pod for id: " + podIdText);
        } else {
            executePod(podInfo, podIdText);
        }
View Full Code Here

    public KubernetesClient getKubernetes() {
        if (kubernetes == null) {
            String kubernetesAddress = kubernetesUrl.getValue();
            if (Strings.isNotBlank(kubernetesAddress)) {
                kubernetes = new KubernetesClient(new KubernetesFactory(kubernetesAddress));
            } else {
                kubernetes = new KubernetesClient();
            }
        }
        Objects.notNull(kubernetes, "kubernetes");
        return kubernetes;
    }
View Full Code Here

            factory = new KubernetesFactory("http://localhost:8585/");
        } else {
            factory = new KubernetesFactory(kubernetesMaster);
        }
        contextPathsCache = new ArrayList<String>();
        client = new KubernetesClient(factory);
        //for now simply check in with kubernetes every 5 seconds
        //it'd be nice if kubernetes can callback into our cache.
        serviceCacheExecutor.scheduleWithFixedDelay(this, 0, 5, SECONDS);
    }
View Full Code Here

    public KubernetesClient getKubernetes() {
        if (kubernetes == null) {
            String kubernetesAddress = kubernetesUrl.getValue();
            if (Strings.isNotBlank(kubernetesAddress)) {
                kubernetes = new KubernetesClient(new KubernetesFactory(kubernetesAddress));
            } else {
                kubernetes = new KubernetesClient();
            }
        }
        Objects.notNull(kubernetes, "kubernetes");
View Full Code Here

       this.serviceSelectors = serviceSelectors;
    }
   
    public void init() {
        String kubernetesMaster = Systems.getEnvVarOrSystemProperty("KUBERNETES_MASTER", "KUBERNETES_MASTER", null);
        KubernetesFactory factory;
        if (kubernetesMaster==null) {
            factory = new KubernetesFactory("http://localhost:8585/");
        } else {
            factory = new KubernetesFactory(kubernetesMaster);
        }
        contextPathsCache = new ArrayList<String>();
        client = new KubernetesClient(factory);
        //for now simply check in with kubernetes every 5 seconds
        //it'd be nice if kubernetes can callback into our cache.
View Full Code Here

            if (filter.matches(item)) {
                String id = item.getId();
                String labels = KubernetesHelper.toLabelsString(item.getLabels());
                Integer replicas = null;
                ControllerDesiredState desiredState = item.getDesiredState();
                ControllerCurrentState currentState = item.getCurrentState();
                String selector = null;
                if (desiredState != null) {
                    selector = KubernetesHelper.toLabelsString(desiredState.getReplicaSelector());
                }
                if (currentState != null) {
                    replicas = currentState.getReplicas();
                }
                table.row(id, labels, toPositiveNonZeroText(replicas), selector);
            }
        }
        table.print();
View Full Code Here

        for (ReplicationControllerSchema item : items) {
            if (filter.matches(item)) {
                String id = item.getId();
                String labels = KubernetesHelper.toLabelsString(item.getLabels());
                Integer replicas = null;
                ControllerDesiredState desiredState = item.getDesiredState();
                ControllerCurrentState currentState = item.getCurrentState();
                String selector = null;
                if (desiredState != null) {
                    selector = KubernetesHelper.toLabelsString(desiredState.getReplicaSelector());
                }
                if (currentState != null) {
                    replicas = currentState.getReplicas();
                }
                table.row(id, labels, toPositiveNonZeroText(replicas), selector);
View Full Code Here

    protected static void listReplicationControllers(Kubernetes kube) {
        System.out.println("Looking up replicationControllers");
        ReplicationControllerListSchema replicationControllers = kube.getReplicationControllers();
        List<ReplicationControllerSchema> items = replicationControllers.getItems();
        for (ReplicationControllerSchema item : items) {
            ControllerDesiredState desiredState = item.getDesiredState();
            if (desiredState != null) {
                System.out.println("ReplicationController " + item.getId() + " labels: " + item.getLabels()
                        + " replicas: " + desiredState.getReplicas() + " replicatorSelector: " + desiredState.getReplicaSelector() + " podTemplate: " + desiredState.getPodTemplate());
            } else {
                System.out.println("ReplicationController " + item.getId() + " labels: " + item.getLabels() + " no desiredState");
            }
        }
        System.out.println();
View Full Code Here

TOP

Related Classes of io.fabric8.patch.Result

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.