new-integration-tests/src/test/java/oracle/weblogic/kubernetes/actions/TestActions.java
public static ExecResult execCommand(
      String namespace,
      String podName,
      String containerName,
      boolean redirectToStdout,
      String... command
  ) throws IOException, ApiException, InterruptedException {
    // get the pod given the namespace and name of the pod
    // no label selector is needed (thus null below)
    final V1Pod pod = Kubernetes.getPod(namespace, null, podName);
    if (pod == null) {
      throw new IllegalArgumentException(
          String.format("The pod %s does not exist in namespace %s!", podName, namespace));
    }
    return Exec.exec(pod, containerName, redirectToStdout, command);
  }
/**
   * Execute a command in a container of a Kubernetes pod.
   *
   * @param namespace The Kubernetes namespace that the pod is in
   * @param podName The name of the Kubernetes pod where the command is expected to run
   * @param containerName The container in the Pod where the command is to be run. If no
   *                         container name is provided than the first container in the Pod is used.
   * @param redirectToStdout copy process output to stdout
   * @param command The command to run
   * @return result of command execution
   * @throws IOException if an I/O error occurs.
   * @throws ApiException if Kubernetes client API call fails
   * @throws InterruptedException if any thread has interrupted the current thread
   */
Execute a command in a container of a Kubernetes pod.
@param namespace The Kubernetes namespace that the pod is in
@param podName The name of the Kubernetes pod where the command is expected to run
@param containerName The container in the Pod where the command is to be run. If no
container name is provided than the first container in the Pod is used.
@param redirectToStdout copy process output to stdout
@param command The command to run
@return result of command execution
@throws IOException if an I/O error occurs.
@throws ApiException if Kubernetes client API call fails
@throws InterruptedException if any thread has interrupted the current thread
Execute a command in a container of a Kubernetes pod . @param namespace The Kubernetes namespace that the pod is in @param podName The name of the Kubernetes pod where the command is expected to run @param containerName The container in the Pod where the command is to be run . If no container name is provided than the first container in the Pod is used . @param redirectToStdout copy process output to stdout @param command The command to run @return result of command execution @throws IOException if an I / O error occurs . @throws ApiException if Kubernetes client API call fails @throws InterruptedException if any thread has interrupted the current thread
public static ExecResult execCommand(
      String namespace,
      String podName,
      String containerName,
      boolean redirectToStdout,
      String... command
  ) throws IOException, ApiException, InterruptedException {
    final V1Pod pod = Kubernetes.getPod(namespace, null, podName);
    if (pod == null) {
      throw new IllegalArgumentException(
          String.format("The pod %s does not exist in namespace %s!", podName, namespace));
    }
    return Exec.exec(pod, containerName, redirectToStdout, command);
  }
public static ExecResult execCommand ( String namespace , String podName , String containerName , boolean redirectToStdout , String ... command ) throws IOException , ApiException , InterruptedException { final V1Pod pod = Kubernetes . getPod ( namespace , null , podName ) ; if ( pod == null ) { throw new IllegalArgumentException ( String . format ( "The pod %s does not exist in namespace %s!" , podName , namespace ) ) ; } return Exec . exec ( pod , containerName , redirectToStdout , command ) ; }
Execute a command in a container of a Kubernetes pod.
Execute a command in a container of a Kubernetes pod .
// get the pod given the namespace and name of the pod // no label selector is needed (thus null below)