Skip to content

Commit

Permalink
config-manager: don't crash if no runtime is found running.
Browse files Browse the repository at this point in the history
Signed-off-by: Krisztian Litkey <[email protected]>
(cherry picked from commit d3122d1)
  • Loading branch information
klihub committed Oct 27, 2023
1 parent 4e91e62 commit 1f23b72
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/config-manager/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,10 @@ func detectRuntime() (string, error) {
return "", fmt.Errorf("failed to detect container runtime in use: %w", err)
}

if len(units) == 0 {
return "", fmt.Errorf("failed to detect container runtime in use: got 0 systemd units")
}

if len(units) > 1 {
return "", fmt.Errorf("detected more than one container runtime on the host, expected one")
}
Expand Down

0 comments on commit 1f23b72

Please sign in to comment.