return null;
}
private void printContainers(PodListSchema pods, PrintStream out) {
TablePrinter table = new TablePrinter();
table.columns("id", "image(s)", "host", "labels", "status");
List<PodSchema> items = pods.getItems();
if (items == null) {
items = Collections.EMPTY_LIST;
}
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) {
ManifestSchema 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 = "";
host = "";
status = "";
labels = "";
}
}
}
}
}
table.print();
}