-
Notifications
You must be signed in to change notification settings - Fork 386
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Replace pid with flock for runtime config loading #5435
Conversation
Shouldn't we leave it as is and eventually remove the whole runtime config file instead? |
how do you mean? |
This pull request has merge conflicts that need to be resolved. |
b58069c
to
92be067
Compare
That appears to be a fairly intrusive change. This is a cheap and non-intrusive way to fix the specific problem at hand that easily can be backported. |
This pull request has merge conflicts that need to be resolved. |
58b09ae
to
4b0f2f1
Compare
9a20f31
to
d5e2254
Compare
This pull request has merge conflicts that need to be resolved. |
Use lock file and flock(2) to ensure there is only a single instance of k0s running. This is more reliable than storing the pid in the runtime config. This solves false positives with k0s runtime config leftovers. Fixes: k0sproject#5399 Signed-off-by: Natanael Copa <ncopa@mirantis.com>
Since we removed the pid from runtime config we can no longer skip the is-k0s-running-test by letting the pid be zero. So we need to create a proper runtime lock file by using NewRuntimeConfig. Signed-off-by: Natanael Copa <ncopa@mirantis.com>
Use lock file and flock(2) to ensure there is only a single instance of k0s running. This is more reliable than storing the pid in the runtime config.
This also solves false positives with k0s runtime config leftovers.
Fixes: #5399
Description
Fixes #5399
Type of change
How Has This Been Tested?
Checklist: