fix: guard the initialize call if k3s is already installed

This commit is contained in:
Jose Diaz-Gonzalez
2024-01-12 23:57:43 -05:00
parent 7101d1bf7b
commit 6c234c66a3

View File

@@ -11,6 +11,10 @@ import (
// CommandInitialize initializes a k3s cluster on the local server
func CommandInitialize() error {
if common.FileExists("/usr/local/bin/k3s") {
return fmt.Errorf("k3s already installed, cannot re-initialize k3s")
}
client := resty.New()
resp, err := client.R().
Get("https://get.k3s.io")