1
0
mirror of https://github.com/ko-build/ko.git synced 2025-07-12 23:50:31 +02:00

add kubectl check for ko delete, apply, and create (#120)

This commit is contained in:
Daniel Helfand
2020-01-16 13:27:43 -08:00
committed by jonjohnsonjr
parent b7e1a7fdbc
commit 2e28671384
4 changed files with 27 additions and 1 deletions

View File

@ -15,6 +15,8 @@
package commands
import (
"os/exec"
"github.com/spf13/cobra"
)
@ -31,3 +33,11 @@ func AddKubeCommands(topLevel *cobra.Command) {
addRun(topLevel)
addCompletion(topLevel)
}
// check if kubectl is installed
func isKubectlAvailable() bool {
if _, err := exec.LookPath("kubectl"); err != nil {
return false
}
return true
}