Thanks to visit codestin.com
Credit goes to github.com

Skip to content

connect_get_namespaced_pod_exec cannot run nohup command and return immediately #2352

Open
@HuanjieGuo

Description

@HuanjieGuo

What happened (please include outputs or screenshots):

Here is the command

    command = ['bash', '/mnt_target/rsync_command.sh']
    res = stream(tess_client.api.connect_get_namespaced_pod_exec,
        pod_name,
        namespace,
        command=command,
        stderr=True,
        stdin=False,
        stdout=True,
        tty=False,
        async_req = False
    )
    return res

cat /mnt_target/rsync_command.sh
nohup rsync -vr /mnt_source/ /mnt_target > /mnt_target/rsync.log 2>&1 && echo 1 > /mnt_target/rsync_done.txt &

when I call connect_get_namespaced_pod_exec, it will block there and cannot return immediately.

What you expected to happen:
It should return immediately because I use nohub &

Name: kubernetes
Version: 31.0.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.lifecycle/staleDenotes an issue or PR has remained open with no activity and has become stale.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions