作者:卢启红 | 来源:互联网 | 2023-10-14 14:40
本文整理了Java中io.fabric8.kubernetes.api.model.PodStatus.getConditions()方法的一些代码示例,展示了
本文整理了Java中io.fabric8.kubernetes.api.model.PodStatus.getConditions()
方法的一些代码示例,展示了PodStatus.getConditions()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。PodStatus.getConditions()
方法的具体详情如下:
包路径:io.fabric8.kubernetes.api.model.PodStatus
类名称:PodStatus
方法名:getConditions
PodStatus.getConditions介绍
暂无
代码示例
代码示例来源:origin: zalando/zalenium
public boolean isReady(ContainerCreationStatus container) {
Pod pod = client.pods().withName(container.getContainerName()).get();
if (pod == null) {
return false;
}
else {
return pod.getStatus().getConditions().stream()
.filter(condition -> condition.getType().equals("Ready"))
.map(condition -> condition.getStatus().equals("True"))
.findFirst()
.orElse(false);
}
}
代码示例来源:origin: fabric8io/kubernetes-client
/**
* Returns the ready condition of the pod.
* @param pod The target pod.
* @return The {@link PodCondition} or null if not found.
*/
private static PodCondition getPodReadyCondition(Pod pod) {
Utils.checkNotNull(pod, "Pod can't be null.");
if (pod.getStatus() == null || pod.getStatus().getConditions() == null) {
return null;
}
for (PodCondition condition : pod.getStatus().getConditions()) {
if (POD_READY.equals(condition.getType())) {
return condition;
}
}
return null;
}
代码示例来源:origin: fabric8io/kubernetes-client
public void run() {
PodList podList = listSelectedPods(obj);
int count = 0;
List items = podList.getItems();
for (Pod item : items) {
for (PodCondition c : item.getStatus().getConditions()) {
if (c.getType().equals("Ready") && c.getStatus().equals("True")) {
count++;
}
}
}
podCount.set(count);
if (count == requiredPodCount) {
countDownLatch.countDown();
}
}
};
代码示例来源:origin: fabric8io/fabric8-maven-plugin
protected static String getPodCondition(Pod pod) {
PodStatus podStatus = pod.getStatus();
if (podStatus == null) {
return "";
}
List cOnditions= podStatus.getConditions();
if (cOnditions== null || conditions.isEmpty()) {
return "";
}
for (PodCondition condition : conditions) {
String type = condition.getType();
if (StringUtils.isNotBlank(type)) {
if ("ready".equalsIgnoreCase(type)) {
String statusText = condition.getStatus();
if (StringUtils.isNotBlank(statusText)) {
if (Boolean.parseBoolean(statusText)) {
return type;
}
}
}
}
}
return "";
}
代码示例来源:origin: org.domeos/kubernetes-client
public void run() {
PodList podList = listSelectedPods(obj);
int count = 0;
List items = podList.getItems();
for (Pod item : items) {
for (PodCondition c : item.getStatus().getConditions()) {
if (c.getType().equals("Ready") && c.getStatus().equals("True")) {
count++;
}
}
}
podCount.set(count);
if (count == requiredPodCount) {
countDownLatch.countDown();
}
}
};
代码示例来源:origin: org.domeos/kubernetes-client
/**
* Returns the ready condition of the pod.
* @param pod The target pod.
* @return The {@link PodCondition} or null if not found.
*/
private static PodCondition getPodReadyCondition(Pod pod) {
Utils.checkNotNull(pod, "Pod can't be null.");
if (pod.getStatus() == null || pod.getStatus().getConditions() == null) {
return null;
}
for (PodCondition condition : pod.getStatus().getConditions()) {
if (POD_READY.equals(condition.getType())) {
return condition;
}
}
return null;
}
}
代码示例来源:origin: fabric8io/fabric8-maven-plugin
/**
* Returns true if the pod is running and ready
*/
public static boolean isPodReady(Pod pod) {
if (!isPodRunning(pod)) {
return false;
}
PodStatus podStatus = pod.getStatus();
if (podStatus == null) {
return true;
}
List cOnditions= podStatus.getConditions();
if (cOnditions== null || conditions.isEmpty()) {
return true;
}
// Check "ready" condition
for (PodCondition condition : conditions) {
if ("ready".equalsIgnoreCase(condition.getType())) {
return Boolean.parseBoolean(condition.getStatus());
}
}
return true;
}
代码示例来源:origin: EnMasseProject/enmasse
public Pod(io.fabric8.kubernetes.api.model.Pod pod) {
this.name = pod.getMetadata().getName();
if (pod.getMetadata().getAnnotations() != null) {
this.annotations.putAll(pod.getMetadata().getAnnotations());
}
this.kind = pod.getKind();
this.host = pod.getStatus().getPodIP();
this.phase = pod.getStatus().getPhase();
this.ready = getReadyCondition(pod.getStatus().getConditions());
this.portMap = getPortMap(pod.getSpec().getContainers());
}
代码示例来源:origin: io.fabric8.schemagenerator/kubernetes-model
public PodStatusBuilder( PodStatusFluent> fluent , PodStatus instance ){
this.fluent = fluent; fluent.withConditions(instance.getConditions()); fluent.withContainerStatuses(instance.getContainerStatuses()); fluent.withHostIP(instance.getHostIP()); fluent.withMessage(instance.getMessage()); fluent.withPhase(instance.getPhase()); fluent.withPodIP(instance.getPodIP()); fluent.withStartTime(instance.getStartTime());
}
public PodStatusBuilder( PodStatus instance ){
代码示例来源:origin: io.fabric8.schemagenerator/kubernetes-model
public PodStatusBuilder( PodStatus instance ){
this.fluent = this; this.withConditions(instance.getConditions()); this.withContainerStatuses(instance.getContainerStatuses()); this.withHostIP(instance.getHostIP()); this.withMessage(instance.getMessage()); this.withPhase(instance.getPhase()); this.withPodIP(instance.getPodIP()); this.withStartTime(instance.getStartTime());
}
代码示例来源:origin: org.domeos/kubernetes-model
public PodStatusFluentImpl(PodStatus instance){
this.withConditions(instance.getConditions());
this.withContainerStatuses(instance.getContainerStatuses());
this.withHostIP(instance.getHostIP());
this.withMessage(instance.getMessage());
this.withPhase(instance.getPhase());
this.withPodIP(instance.getPodIP());
this.withReason(instance.getReason());
this.withStartTime(instance.getStartTime());
}
代码示例来源:origin: org.domeos/kubernetes-model
public PodStatusBuilder(PodStatus instance,Boolean validationEnabled){
this.fluent = this;
this.withConditions(instance.getConditions());
this.withContainerStatuses(instance.getContainerStatuses());
this.withHostIP(instance.getHostIP());
this.withMessage(instance.getMessage());
this.withPhase(instance.getPhase());
this.withPodIP(instance.getPodIP());
this.withReason(instance.getReason());
this.withStartTime(instance.getStartTime());
this.validatiOnEnabled= validationEnabled;
}
代码示例来源:origin: org.domeos/kubernetes-model
public PodStatusBuilder(PodStatusFluent> fluent,PodStatus instance,Boolean validationEnabled){
this.fluent = fluent;
fluent.withConditions(instance.getConditions());
fluent.withContainerStatuses(instance.getContainerStatuses());
fluent.withHostIP(instance.getHostIP());
fluent.withMessage(instance.getMessage());
fluent.withPhase(instance.getPhase());
fluent.withPodIP(instance.getPodIP());
fluent.withReason(instance.getReason());
fluent.withStartTime(instance.getStartTime());
this.validatiOnEnabled= validationEnabled;
}
public PodStatusBuilder(PodStatus instance){