python/ray/tests/kuberay/utils.py
def kubectl_exec(
    command: List[str],
    pod: str,
    namespace: str,
    container: Optional[str] = None,
) -> str:
    """kubectl exec the `command` in the given `pod` in the given `namespace`.
    If a `container` is specified, will specify that container for kubectl.

    Prints and return kubectl's output as a string.
    """
    container_option = ["-c", container] if container else []
    kubectl_exec_command = (
        ["kubectl", "exec", "-it", pod] + container_option + ["--"] + command
    )
    out = subprocess.check_output(kubectl_exec_command).decode().strip()
    # Print for debugging convenience.
    print(out)
    return out
kubectl exec the `command` in the given `pod` in the given `namespace`.
    If a `container` is specified, will specify that container for kubectl.

    Prints and return kubectl's output as a string.
    


Prints and return kubectl's output as a string.
Prints and return kubectl ' s output as a string .
def kubectl_exec(
    command: List[str],
    pod: str,
    namespace: str,
    container: Optional[str] = None,
) -> str:
    container_option = ["-c", container] if container else []
    kubectl_exec_command = (
        ["kubectl", "exec", "-it", pod] + container_option + ["--"] + command
    )
    out = subprocess.check_output(kubectl_exec_command).decode().strip()
    print(out)
    return out
def kubectl_exec ( command : List [ str ] , pod : str , namespace : str , container : Optional [ str ] = None , ) -> str : container_option = [ "-c" , container ] if container else [ ] kubectl_exec_command = ( [ "kubectl" , "exec" , "-it" , pod ] + container_option + [ "--" ] + command ) out = subprocess . check_output ( kubectl_exec_command ) . decode ( ) . strip ( ) print ( out ) return out
kubectl exec the `command` in the given `pod` in the given `namespace`.
kubectl exec the ` command ` in the given ` pod ` in the given ` namespace ` .
"""kubectl exec the `command` in the given `pod` in the given `namespace`.
    If a `container` is specified, will specify that container for kubectl.

    Prints and return kubectl's output as a string.
    """ # Print for debugging convenience.
command
List[str]
pod
str
namespace
str
container
Optional[str]