ansible-test - Invoke container sleep through env (#81853)

pull/81858/head
Matt Clay 1 year ago committed by GitHub
parent d8f791d88c
commit 20f17687da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,3 @@
minor_changes:
- ansible-test - When invoking ``sleep`` in containers during container setup, the ``env`` command is used to avoid invoking
the shell builtin, if present.

@ -806,6 +806,7 @@ class DockerProfile(ControllerHostProfile[DockerConfig], SshTargetHostProfile[Do
- Avoid hanging indefinitely or for an unreasonably long time. - Avoid hanging indefinitely or for an unreasonably long time.
NOTE: The container must have a POSIX-compliant default shell "sh" with a non-builtin "sleep" command. NOTE: The container must have a POSIX-compliant default shell "sh" with a non-builtin "sleep" command.
The "sleep" command is invoked through "env" to avoid using a shell builtin "sleep" (if present).
""" """
command = '' command = ''
@ -813,7 +814,7 @@ class DockerProfile(ControllerHostProfile[DockerConfig], SshTargetHostProfile[Do
command += f'{init_config.command} && ' command += f'{init_config.command} && '
if sleep or init_config.command_privileged: if sleep or init_config.command_privileged:
command += 'sleep 60 ; ' command += 'env sleep 60 ; '
if not command: if not command:
return None return None

Loading…
Cancel
Save