Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.

Commit

Permalink
preflight: check runtime specific binary
Browse files Browse the repository at this point in the history
  • Loading branch information
chanwit committed Oct 14, 2019
1 parent 7ae2705 commit a044c83
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 0 additions & 1 deletion pkg/constants/dependencies.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ var BinaryDependencies = [...]string{
"e2fsck",
"resize2fs",
"strings",
"docker",
"dmsetup",
"ssh",
"git",
Expand Down
8 changes: 8 additions & 0 deletions pkg/preflight/checkers/checks.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,18 @@ func StartCmdChecks(vm *api.VM, ignoredPreflightErrors sets.String) error {
checks = append(checks, ExistingFileChecker{filePath: dependency})
}
}

checks = append(checks, providers.Runtime.PreflightChecker())
for _, port := range vm.Spec.Network.Ports {
checks = append(checks, PortOpenChecker{port: port.HostPort})
}

// Binary name of the runtime is just the runtime name in string, "docker" or "containerd"
// So it is OK for us to check only one of them, as people may installing only containerd but not docker
runtimeBinaryName := providers.RuntimeName.String()
checks = append(checks, BinInPathChecker{bin: runtimeBinaryName})

// Check common binaries
for _, dependency := range constants.BinaryDependencies {
checks = append(checks, BinInPathChecker{bin: dependency})
}
Expand Down

0 comments on commit a044c83

Please sign in to comment.