Skip to content

Cannot init a machine or machine add to local config file #117

@luislavena

Description

@luislavena

Hello!

I'm trying to store the uncloud configuration file relative to my project and not my user. Doing this so I can include this file in the repository and later I can deploy from the CI environment using the same cluster configuration file.

Doing uc machine init --uncloud-config myconfig.yaml results in the following message after all the steps have been completed:

$ uc machine init --uncloud-config blatta.yaml [email protected] --name blatta1 --no-dns --public-ip none
...
✓ Uncloud machine daemon started.
✓ Uncloud installed on the machine successfully! 🎉
Cluster initialised with machine 'blatta1' and saved as context 'default' in your local config (blatta.yaml)
Error: save cluster context to config: create config directory '': mkdir : no such file or directory

The file (blatta.yaml) does not exists, and nothing gets saved to the file after the command has been executed.

Workaround:

This gets solved if instead I use the local path ./blatta.yaml:

...
Cluster initialised with machine 'blatta1' and saved as context 'default' in your local config (./blatta.yaml)
Current cluster context is now 'default'.
Waiting for the machine to be ready...

[+] Deploying service caddy 7/2
 ✔ Container caddy-12rh on blatta1     Started                                                                                                                           6.2s
   ✔ Image caddy:2.10.2 on blatta1       Pulled                                                                                                                          5.5s

Skipping DNS records update as no cluster domain is reserved (see 'uc dns').

Impacts also machine add

This is present also in uc machine add:

$ uc machine add --uncloud-config blatta.yaml [email protected] --name blatta2 --public-ip none
...
Machine 'blatta2' added to the cluster (context 'default').
Error: save config: create config directory '': mkdir : no such file or directory

And blatta.yaml does not contain the new node:

$ cat blatta.yaml
current_context: default
contexts:
  default:
    connections:
      - ssh: [email protected]

And the correctly updated configuration file:

$ cat blatta.yaml
current_context: default
contexts:
  default:
    connections:
      - ssh: [email protected]
      - ssh: [email protected]

Thank you for for creating uncloud!
❤️ ❤️ ❤️

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions