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]>
  • Loading branch information
klihub committed Oct 25, 2023
1 parent 2be40af commit 44995dc
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 44995dc

Please sign in to comment.