Skip to content

editflags: add --ssh-port flag #3791

New issue

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

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

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions cmd/limactl/editflags/editflags.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ func RegisterEdit(cmd *cobra.Command, commentPrefix string) {

flags.String("set", "", commentPrefix+"Modify the template inplace, using yq syntax")

flags.Uint16("ssh-port", 0, commentPrefix+"SSH port (0 for random)") // colima-compatible
_ = cmd.RegisterFlagCompletionFunc("ssh-port", func(*cobra.Command, []string, string) ([]string, cobra.ShellCompDirective) {
// Until Lima v2.0, 60022 was the default SSH port for the instance named "default".
return []string{"60022"}, cobra.ShellCompDirectiveNoFileComp
})

// negative performance impact: https://gitlab.com/qemu-project/qemu/-/issues/334
flags.Bool("video", false, commentPrefix+"Enable video output (has negative performance impact for QEMU)")

Expand Down Expand Up @@ -230,6 +236,7 @@ func YQExpressions(flags *flag.FlagSet, newInstance bool) ([]string, error) {
false,
false,
},
{"ssh-port", d(".ssh.localPort = %s"), false, false},
{"arch", d(".arch = %q"), true, false},
{
"containerd",
Expand Down
Loading