-
Notifications
You must be signed in to change notification settings - Fork 379
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: prevent false positives in already running k0s instance detection
The main bugfix is to check if a possibly running pid from the runtime config not only exists as a process, but also is the same excutable image that is checking. All platforms use a common library for ps-style checks now in this implementation. This changes the behavior for all platforms to use a common library to perform the "is k0s running" checks on startup. The advantage is, that the code is much more simple, the disadvantage that an additional library is now required with additional sub-dependencies. This commit also refactors the function checkPid into checkInstanceRunning, since the previous implementation did not allow for more complex error handling and would have hidden errors. More complex error handling is now required because the implementation is more complex. Signed-off-by: Peter Honeder <[email protected]>
- Loading branch information
1 parent
d43f482
commit de62d7c
Showing
6 changed files
with
209 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.