|
|
|
@ -1,12 +1,12 @@ |
|
|
|
|
package cmd |
|
|
|
|
|
|
|
|
|
import ( |
|
|
|
|
"bufio" |
|
|
|
|
"context" |
|
|
|
|
"git.jfdev.de/JonasFranzDEV/hal/hal" |
|
|
|
|
"git.jfdev.de/JonasFranzDEV/hal/parser" |
|
|
|
|
"github.com/spf13/cobra" |
|
|
|
|
"gopkg.in/yaml.v2" |
|
|
|
|
"io/ioutil" |
|
|
|
|
"os" |
|
|
|
|
) |
|
|
|
|
|
|
|
|
@ -27,13 +27,13 @@ func runClusterCommand(cmd *cobra.Command, args []string) error { |
|
|
|
|
if stats, err := os.Stat(configFile); err != nil || stats.IsDir() { |
|
|
|
|
return err |
|
|
|
|
} |
|
|
|
|
file, err := os.Open(configFile) |
|
|
|
|
|
|
|
|
|
file, err := ioutil.ReadFile(configFile) |
|
|
|
|
if err != nil { |
|
|
|
|
return err |
|
|
|
|
} |
|
|
|
|
scanner := bufio.NewScanner(file) |
|
|
|
|
config := &hal.ClusterConfig{} |
|
|
|
|
if err := yaml.Unmarshal(scanner.Bytes(), config); err != nil { |
|
|
|
|
if err := yaml.Unmarshal(file, config); err != nil { |
|
|
|
|
return err |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|