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) {
Manifest manifest = desiredState.getManifest();
if (manifest != null) {
List<ManifestContainer> containers = manifest.getContainers();
if (notEmpty(containers)) {
System.out.println("Containers:");
indentCount++;
for (ManifestContainer container : containers) {
printValue("Name", container.getName());
printValue("Image", container.getImage());
printValue("Working Dir", container.getWorkingDir());
printValue("Command", container.getCommand());
List<Port> ports = container.getPorts();
if (notEmpty(ports)) {
println("Ports:");
indentCount++;
for (Port port : ports) {
printValue("Name", port.getName());
printValue("Protocol", port.getProtocol());
printValue("Host Port", port.getHostPort());
printValue("Container Port", port.getContainerPort());
}
indentCount--;
}
List<Env> envList = container.getEnv();
if (notEmpty(envList)) {
println("Environment:");
indentCount++;
for (Env env : envList) {
printValue(env.getName(), env.getValue());
}
indentCount--;
}
List<VolumeMount> volumeMounts = container.getVolumeMounts();
if (notEmpty(volumeMounts)) {
println("Volume Mounts:");
indentCount++;
for (VolumeMount volumeMount : volumeMounts) {
printValue("Name", volumeMount.getName());
printValue("Mount Path", volumeMount.getMountPath());
printValue("Read Only", volumeMount.getReadOnly());
}
indentCount--;
}
}
}
Set<Volume> volumes = manifest.getVolumes();
if (volumes != null) {
System.out.println("Volumes: ");
for (Volume volume : volumes) {
System.out.println(indent + volume.getName());
}