Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ignore if kill can't find pid that is already gone #3005

Merged
merged 1 commit into from
Aug 25, 2022
Merged

ignore if kill can't find pid that is already gone #3005

merged 1 commit into from
Aug 25, 2022

Conversation

schdief
Copy link

@schdief schdief commented Aug 8, 2022

we use buildctl-daemonless.sh inside a rootless-pod based on moby/buildkit:master-rootless to perform our builds and call it via a CI/CD tool, which returns a non-zero exit code, as the trap cannot kill the process, as it is already gone, in case everything went fine

so we need to catch the error code from kill, which tries to kill a process that doesn't exist anymore and the suggestion is to just add || true, because we don't care about the exit code of kill

#17 DONE 4.2s
sh: can't kill pid 65: No such process
command terminated with exit code 1

not sure if this script is automatically baked in the moby/buildkit:master-rootless image or I need to do something else

Signed-off-by: Steve Lohr schdief.law@gmail.com

we use this script inside a rootless-pod (https://github.com/moby/buildkit/blob/master/examples/kubernetes/pod.rootless.yaml) to perform our builds and call it via a CI/CD tool, which returns a non-zero exit code, as the trap cannot kill the process, as it is already gone, in case everything went fine

so we need to catch the error code from kill, which tries to kill a process that doesn't exist anymore and the suggestion is to just add || true, because we don't care about the exit code of kill

```
#17 DONE 4.2s
sh: can't kill pid 65: No such process
command terminated with exit code 1
```

Signed-off-by: Steve Lohr <schdief.law@gmail.com>
@tonistiigi tonistiigi merged commit c172172 into moby:master Aug 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants