mirror of
https://github.com/psviderski/uncloud.git
synced 2026-10-08 06:09:17 +00:00
add uncloud machine token command to print machine token to add machine to cluster
This commit is contained in:
1 parent
4656bdd132
commit
945eff471b
9 files changed
+327
-42
No files matched your search
@@ -41,12 +41,16 @@ func ConfigPath(dataDir string) string {
|
||||
func ParseConfig(path string) (*Config, error) {
|
||||
data, err := os.ReadFile(path)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("read config file %q: %w", path, err)
|
||||
return nil, fmt.Errorf("read config file: %w", err)
|
||||
}
|
||||
var config Config
|
||||
if err = json.Unmarshal(data, &config); err != nil {
|
||||
return nil, fmt.Errorf("parse config file %q: %w", path, err)
|
||||
}
|
||||
|
||||
if config.Network == nil {
|
||||
return nil, fmt.Errorf("missing network configuration in config file %q", path)
|
||||
}
|
||||
return &config, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user