fix: improve error message when creating cluster

Add extra context to error message when unable to properly
open the talos config file when creating a cluster.

Signed-off-by: Tim Jones <tim.jones@siderolabs.com>
This commit is contained in:
Tim Jones 2022-05-24 13:40:15 +02:00
parent f03002ec68
commit bafa1f49d4
No known key found for this signature in database
GPG Key ID: A2A702DD5B689F45

View File

@ -698,7 +698,7 @@ func postCreate(ctx context.Context, clusterAccess *access.Adapter) error {
func saveConfig(talosConfigObj *clientconfig.Config) (err error) { func saveConfig(talosConfigObj *clientconfig.Config) (err error) {
c, err := clientconfig.Open(talosconfig) c, err := clientconfig.Open(talosconfig)
if err != nil { if err != nil {
return err return fmt.Errorf("error opening talos config: %s", err)
} }
renames := c.Merge(talosConfigObj) renames := c.Merge(talosConfigObj)