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

[tink worker] containers that fail to start aren't removed #972

Open
jacobweinstock opened this issue Aug 7, 2024 · 0 comments
Open

[tink worker] containers that fail to start aren't removed #972

jacobweinstock opened this issue Aug 7, 2024 · 0 comments
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@jacobweinstock
Copy link
Member

jacobweinstock commented Aug 7, 2024

The function in Tink Worker that creates and starts containers (

func (w *Worker) execute(ctx context.Context, wfID string, action *proto.WorkflowAction) (proto.State, error) {
) doesn't remove them if the container fails to start. The clean up is defined too late. See https://github.com/tinkerbell/tink/blob/main/cmd/tink-worker/worker/worker.go#L189-L194
A failure in the start of a container leaves the container around on the host. The Workflow fails and cannot be re-run as is because the container name will have a conflict.

Expected Behaviour

Tink worker should always clean up containers properly.

Current Behaviour

Possible Solution

Move the defer function to immediately after the successful creation of the container.

Steps to Reproduce (for bugs)

Context

Your Environment

  • Operating System and version (e.g. Linux, Windows, MacOS):

  • How are you running Tinkerbell? Using Vagrant & VirtualBox, Vagrant & Libvirt, on Packet using Terraform, or give details:

  • Link to your project or a code example to reproduce issue:

@jacobweinstock jacobweinstock added the kind/bug Categorizes issue or PR as related to a bug. label Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

1 participant