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:
committed by
jonjohnsonjr
parent
b7e1a7fdbc
commit
2e28671384
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user