mirror of
https://github.com/psviderski/uncloud.git
synced 2026-08-27 11:33:33 +00:00
add uncloud machine token command to print machine token to add machine to cluster
This commit is contained in:
@@ -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