public List<Pod> podsForReplicationController(ReplicationController controller) { return KubernetesHelper.getPodsForReplicationController(controller, podMap.values()); } }
/** * Returns a client for the first working pod for the given replication controller */ public J4pClient clientForReplicationController(ReplicationController replicationController) { Objects.requireNonNull(replicationController, "ReplicationController"); PodList podList = kubernetes.pods().inNamespace(replicationController.getMetadata().getNamespace()).list(); List<Pod> items = null; if (podList != null) { items = podList.getItems(); } if (items == null || items.isEmpty()) { throw new IllegalArgumentException("No pods found for ReplicationController " + KubernetesHelper.summaryText(replicationController)); } List<Pod> pods = KubernetesHelper.getPodsForReplicationController(replicationController, items); return clientForPod(pods); }
/** * Returns all the clients for the first working pod for the given replication controller */ public List<J4pClient> clientsForReplicationController(String replicationControllerName, String namespace) { ReplicationController replicationController = requireReplicationController(replicationControllerName, namespace); List<Pod> pods = KubernetesHelper.getPodsForReplicationController(replicationController, kubernetes.pods().inNamespace(namespace).list().getItems()); return clientsForPod(pods); }
/** * Returns all the clients for the first working pod for the given replication controller */ public List<J4pClient> clientsForReplicationController(ReplicationController replicationController) { List<Pod> pods = KubernetesHelper.getPodsForReplicationController(replicationController, kubernetes.pods().inNamespace(replicationController.getMetadata().getNamespace()).list().getItems()); return clientsForPod(pods); }