热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

io.fabric8.kubernetes.api.model.PodStatus.getConditions()方法的使用及代码示例

本文整理了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){

推荐阅读
  • 本文详细介绍了Java中org.neo4j.helpers.collection.Iterators.single()方法的功能、使用场景及代码示例,帮助开发者更好地理解和应用该方法。 ... [详细]
  • Explore a common issue encountered when implementing an OAuth 1.0a API, specifically the inability to encode null objects and how to resolve it. ... [详细]
  • 本文详细介绍了Java中org.w3c.dom.Text类的splitText()方法,通过多个代码示例展示了其实际应用。该方法用于将文本节点在指定位置拆分为两个节点,并保持在文档树中。 ... [详细]
  • 本文详细介绍了Java中的访问器(getter)和修改器(setter),探讨了它们在保护数据完整性、增强代码可维护性方面的重要作用。通过具体示例,展示了如何正确使用这些方法来控制类属性的访问和更新。 ... [详细]
  • 本文详细介绍了 GWT 中 PopupPanel 类的 onKeyDownPreview 方法,提供了多个代码示例及应用场景,帮助开发者更好地理解和使用该方法。 ... [详细]
  • 本文将介绍如何编写一些有趣的VBScript脚本,这些脚本可以在朋友之间进行无害的恶作剧。通过简单的代码示例,帮助您了解VBScript的基本语法和功能。 ... [详细]
  • 本文介绍如何使用Objective-C结合dispatch库进行并发编程,以提高素数计数任务的效率。通过对比纯C代码与引入并发机制后的代码,展示dispatch库的强大功能。 ... [详细]
  • 本文详细介绍了如何在Linux系统上安装和配置Smokeping,以实现对网络链路质量的实时监控。通过详细的步骤和必要的依赖包安装,确保用户能够顺利完成部署并优化其网络性能监控。 ... [详细]
  • 本文详细介绍了Java中org.eclipse.ui.forms.widgets.ExpandableComposite类的addExpansionListener()方法,并提供了多个实际代码示例,帮助开发者更好地理解和使用该方法。这些示例来源于多个知名开源项目,具有很高的参考价值。 ... [详细]
  • 本文介绍了如何在C#中启动一个应用程序,并通过枚举窗口来获取其主窗口句柄。当使用Process类启动程序时,我们通常只能获得进程的句柄,而主窗口句柄可能为0。因此,我们需要使用API函数和回调机制来准确获取主窗口句柄。 ... [详细]
  • 本文详细介绍了 Apache Jena 库中的 Txn.executeWrite 方法,通过多个实际代码示例展示了其在不同场景下的应用,帮助开发者更好地理解和使用该方法。 ... [详细]
  • Java 类成员初始化顺序与数组创建
    本文探讨了Java中类成员的初始化顺序、静态引入、可变参数以及finalize方法的应用。通过具体的代码示例,详细解释了这些概念及其在实际编程中的使用。 ... [详细]
  • 1:有如下一段程序:packagea.b.c;publicclassTest{privatestaticinti0;publicintgetNext(){return ... [详细]
  • 使用 Azure Service Principal 和 Microsoft Graph API 获取 AAD 用户列表
    本文介绍了一段通用代码示例,该代码不仅能够操作 Azure Active Directory (AAD),还可以通过 Azure Service Principal 的授权访问和管理 Azure 订阅资源。Azure 的架构可以分为两个层级:AAD 和 Subscription。 ... [详细]
  • 本文详细探讨了VxWorks操作系统中双向链表和环形缓冲区的实现原理及使用方法,通过具体示例代码加深理解。 ... [详细]
author-avatar
卢启红
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有