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

Only allow one k0sctl to run simultaneously per host #382

Merged
merged 5 commits into from
May 27, 2022
Merged

Only allow one k0sctl to run simultaneously per host #382

merged 5 commits into from
May 27, 2022

Conversation

kke
Copy link
Contributor

@kke kke commented May 4, 2022

Fixes #381

Uses a lock file (/run/lock/k0sctl) to stop multiple instances of k0sctl from operating on the same target host simultaneously. A background loop touches the modtime of the lock file every 10 seconds while k0sctl is running.

If a lock file is found, it is discarded if it is over 30 seconds old.

@kke kke added the enhancement New feature or request label May 4, 2022
@kke kke marked this pull request as ready for review May 5, 2022 10:01
configurer/linux.go Outdated Show resolved Hide resolved
phase/prepare_hosts.go Outdated Show resolved Hide resolved
kke added 2 commits May 24, 2022 10:07
Cant use configurer before detect OS

Flock

Wait a while

No flock? Take a risk

Seal window
@kke kke merged commit 63d8e85 into main May 27, 2022
@kke kke deleted the lock branch May 27, 2022 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider having k0sctl create some kind of a lockfile
3 participants