new-integration-tests/src/test/java/oracle/weblogic/kubernetes/ItMonitoringExporter.java
public static boolean isPodReady(String namespace, String labelSelector, String podName) throws ApiException {
    boolean status = false;
    V1PodList pods = listPods(namespace, labelSelector);
    V1Pod pod = null;
    for (var testpod : pods.getItems()) {
      if ((testpod.getMetadata().getName()).contains(podName)) {
        pod = testpod;
      }
    }
    if (pod != null) {
      // get the podCondition with the 'Ready' type field
      V1PodCondition v1PodReadyCondition = pod.getStatus().getConditions().stream()
          .filter(v1PodCondition -> "Ready".equals(v1PodCondition.getType()))
          .findAny()
          .orElse(null);

      if (v1PodReadyCondition != null) {
        status = v1PodReadyCondition.getStatus().equalsIgnoreCase("true");
      }
    } else {
      logger.info(podName + " pod doesn't exist");
    }
    return status;
  }
/**
   * Checks if the pod is running in a given namespace.
   * The method assumes the pod name to starts with provided value for podName
   * and decorated with provided label selector
   * @param namespace in which to check for the pod existence
   * @return true if pods are exist and running otherwise false
   * @throws ApiException when there is error in querying the cluster
   */
Checks if the pod is running in a given namespace.
The method assumes the pod name to starts with provided value for podName
and decorated with provided label selector
@param namespace in which to check for the pod existence
@return true if pods are exist and running otherwise false
@throws ApiException when there is error in querying the cluster
Checks if the pod is running in a given namespace . The method assumes the pod name to starts with provided value for podName and decorated with provided label selector @param namespace in which to check for the pod existence @return true if pods are exist and running otherwise false @throws ApiException when there is error in querying the cluster
public static boolean isPodReady(String namespace, String labelSelector, String podName) throws ApiException {
    boolean status = false;
    V1PodList pods = listPods(namespace, labelSelector);
    V1Pod pod = null;
    for (var testpod : pods.getItems()) {
      if ((testpod.getMetadata().getName()).contains(podName)) {
        pod = testpod;
      }
    }
    if (pod != null) {
      V1PodCondition v1PodReadyCondition = pod.getStatus().getConditions().stream()
          .filter(v1PodCondition -> "Ready".equals(v1PodCondition.getType()))
          .findAny()
          .orElse(null);
      if (v1PodReadyCondition != null) {
        status = v1PodReadyCondition.getStatus().equalsIgnoreCase("true");
      }
    } else {
      logger.info(podName + " pod doesn't exist");
    }
    return status;
  }
public static boolean isPodReady ( String namespace , String labelSelector , String podName ) throws ApiException { boolean status = false ; V1PodList pods = listPods ( namespace , labelSelector ) ; V1Pod pod = null ; for ( var testpod : pods . getItems ( ) ) { if ( ( testpod . getMetadata ( ) . getName ( ) ) . contains ( podName ) ) { pod = testpod ; } } if ( pod != null ) { V1PodCondition v1PodReadyCondition = pod . getStatus ( ) . getConditions ( ) . stream ( ) . filter ( v1PodCondition -> "Ready" . equals ( v1PodCondition . getType ( ) ) ) . findAny ( ) . orElse ( null ) ; if ( v1PodReadyCondition != null ) { status = v1PodReadyCondition . getStatus ( ) . equalsIgnoreCase ( "true" ) ; } } else { logger . info ( podName + " pod doesn't exist" ) ; } return status ; }
Checks if the pod is running in a given namespace.
Checks if the pod is running in a given namespace .
// get the podCondition with the 'Ready' type field