Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

limactl: add limactl create command #1643

Merged
merged 1 commit into from
Jun 27, 2023

Conversation

AkihiroSuda
Copy link
Member

limactl create is similar to limactl start but it does not start the created instance, and it does not accept an existing instance name as an argument.

Now it is discouraged (not deprecated) to use limactl start for creating new instances.

Discouraged form:

limactl start --name=foo template://docker

Recommended form:

limactl create --name=foo template://docker
limactl start foo

@afbjorklund
Copy link
Member

afbjorklund commented Jun 23, 2023

Sounds good to me, more similar to docker-machine. For podman they ended up with both init and --now.

docker-machine create default

podman machine init --now

You might end up having to keep the discouraged form forever, or by adding a --start flag to the create command?

limactl start --name=docker template://docker

limactl create --name=docker template://docker --start

@AkihiroSuda AkihiroSuda requested a review from a team June 26, 2023 06:12
@jandubois
Copy link
Member

limactl start should be included in the command reference in README.md.

There are still lots of instances of run "limactl start" to create an instance:

$ ag "start.*create.*inst"
cmd/apptainer.lima
6:  echo "instance \"$LIMA_INSTANCE\" does not exist, run \`limactl start --name=$LIMA_INSTANCE template://apptainer\` to create a new instance" >&2

cmd/docker.lima
7:  echo "instance \"$LIMA_INSTANCE\" does not exist, run \`limactl start --name=$LIMA_INSTANCE template://docker\` to create a new instance" >&2

cmd/limactl/copy.go
81:					return fmt.Errorf("instance %q does not exist, run `limactl start %s` to create a new instance", instName, instName)

cmd/limactl/list.go
122:		logrus.Warn("No instance found. Run `limactl start` to create an instance.")

cmd/limactl/show_ssh.go
71:			return fmt.Errorf("instance %q does not exist, run `limactl start %s` to create a new instance", instName, instName)

cmd/podman.lima
7:  echo "instance \"$LIMA_INSTANCE\" does not exist, run \`limactl start --name=$LIMA_INSTANCE template://podman\` to create a new instance" >&2

cmd/kubectl.lima
19:  echo "instance \"$LIMA_INSTANCE\" does not exist, run \`limactl start --name=$LIMA_INSTANCE\` to create a new instance" >&2

cmd/limactl/shell.go
73:			return fmt.Errorf("instance %q does not exist, run `limactl start %s` to create a new instance", instName, instName)

examples/README.md
70:Run `limactl start fedora.yaml` to create a Lima instance named "fedora".

@AkihiroSuda
Copy link
Member Author

limactl start should be included in the command reference in README.md.

I guess you meant limactl create?
I'll update them right after making a release, to avoid "I followed README.md but it doesn't work" reports

`limactl create` is similar to `limactl start` but it does not start the
created instance, and it does not accept an existing instance name as an argument.

Now it is discouraged (not deprecated) to use `limactl start` for
creating new instances.

Discouraged form:
```
limactl start --name=foo template://docker
```

Recommended form:
```
limactl create --name=foo template://docker
limactl start foo
```

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
@jandubois
Copy link
Member

I guess you meant limactl create?

Yes, sorry, muscle memory... 😄

I'll update them right after making a release, to avoid "I followed README.md but it doesn't work" reports

Ok, that makes sense.

Copy link
Member

@jandubois jandubois left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM

@AkihiroSuda AkihiroSuda merged commit 87f5a06 into lima-vm:master Jun 27, 2023
@AkihiroSuda AkihiroSuda added the area/cli limactl CLI user experience label Jul 30, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
area/cli limactl CLI user experience
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants