fix: guard the initialize call if k3s is already installed
This commit is contained in:
1 parent
7101d1bf7b
commit
6c234c66a3
1 file changed
+4
@@ -11,6 +11,10 @@ import (
|
|||||||
|
|
||||||
// CommandInitialize initializes a k3s cluster on the local server
|
// CommandInitialize initializes a k3s cluster on the local server
|
||||||
func CommandInitialize() error {
|
func CommandInitialize() error {
|
||||||
|
if common.FileExists("/usr/local/bin/k3s") {
|
||||||
|
return fmt.Errorf("k3s already installed, cannot re-initialize k3s")
|
||||||
|
}
|
||||||
|
|
||||||
client := resty.New()
|
client := resty.New()
|
||||||
resp, err := client.R().
|
resp, err := client.R().
|
||||||
Get("https://get.k3s.io")
|
Get("https://get.k3s.io")
|
||||||
|
|||||||
Reference in new issue
Block a user