@Override protected List<Container> getContainers() { return pod.getSpec().getContainers(); } }
@Override protected List<Container> getContainers() { return config.getSpec().getTemplate().getSpec().getContainers(); } }
for (Container container : resource.getSpec().getContainers()) { for (ContainerPort containerPort : container.getPorts()) { if (containerPort.getContainerPort() == null) {
@Override public <T extends HasMetadata> void onResourceNotReady(T resource) { try { PodList podList = podsOf(resource); if (podList == null) { return; } for (Pod pod : podList.getItems()) { //That should only happen in tests. if (pod.getSpec() == null || pod.getSpec().getContainers() == null) { continue; } displayPodEvents(pod); for (Container container : pod.getSpec().getContainers()) { displayContainerLogs(pod, container); } } } catch (Throwable t) { //ignore } }
@Override public <T extends HasMetadata> void onResourceNotReady(T resource) { try { PodList podList = podsOf(resource); if (podList == null) { return; } for (Pod pod : podList.getItems()) { //That should only happen in tests. if (pod.getSpec() == null || pod.getSpec().getContainers() == null) { continue; } displayPodEvents(pod); for (Container container : pod.getSpec().getContainers()) { displayContainerLogs(pod, container); } } } catch (Throwable t) { //ignore } }
Collection<Closeable> fds = new ArrayList<Closeable>(); List<Container> containers = client.pods().inNamespace(session.getNamespace()).withName(podName).get() .getSpec().getContainers(); if (containers.size() == 1) { fileName += String.format("-%s.log", podName);
Collection<Closeable> fds = new ArrayList<Closeable>(); List<Container> containers = client.pods().inNamespace(session.getNamespace()).withName(podName).get() .getSpec().getContainers(); if (containers.size() == 1) { fileName += String.format("-%s.log", podName);
private synchronized void podStarted() throws Exception { if (holder.getPod() != null && holder.getPod().getSpec() != null && holder.getPod().getSpec().getContainers() != null) { for (Container container : holder.getPod().getSpec().getContainers()) { for (ContainerPort containerPort : container.getPorts()) { if (containerPort.getContainerPort() == null) { continue; } final int port = containerPort.getContainerPort(); if (!proxiedPorts.containsKey(port)) { final Integer hostPort = containerPort.getHostPort(); if (hostPort != null) { // overwrite as hostIP info may have changed mappedPorts.put(port, new PortAddressImpl(containerPort.getHostIP(), hostPort)); } } } } } createProxies(); }
final DeployableScalableResource<DeploymentConfig, DoneableDeploymentConfig> ccr = client.deploymentConfigs().inNamespace(configuration.getNamespace()).withName(actualName); List<Container> containers = ccr.get().getSpec().getTemplate().getSpec().getContainers(); if (containers.size() > 0) {
public static Binding toBinding(Pod pod) { Binding binding = null; if (pod.getStatus() != null && pod.getStatus().getHostIP() != null) { // Running // pod binding = new Binding(pod.getStatus().getHostIP()); } else { // Configured pod binding = new Binding(null); } for (Container container : pod.getSpec().getContainers()) { for (ContainerPort port : container.getPorts()) { binding.addPortBinding(port.getContainerPort(), port.getHostPort()); } } return binding; }