fix: guard the initialize call if k3s is already installed

This commit is contained in:
Jose Diaz-Gonzalez committed 2024-01-23 03:00:27 -05:00
1 parent 7101d1bf7b
commit 6c234c66a3
1 file changed
+4
+4
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")