-
Notifications
You must be signed in to change notification settings - Fork 696
Add yq
subcommands to limactl
and lima-guestagent
#3908
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
Conversation
We probably should include a comment that the |
aac9995
to
cfa73e3
Compare
I've modified the code to turn this into a proper multi-call binary: ❯ limactl --version
limactl version 1.2.0-204-gcfa73e3e.m
❯ limactl yq -n '.foo="bar"'
foo: bar
❯ ln -s $(which limactl) yq
❯ ./yq --version
yq (https://github.com/mikefarah/yq/) version v4.47.1
❯ ./yq -n '.foo="bar"'
foo: bar |
f8eabba
to
a5dc386
Compare
I've added a second commit to add a ❯ lima yq.lima --version
yq (https://github.com/mikefarah/yq/) version v4.47.1 I thought this fits in with our other I've kept it in a separate commit, in case we decide we don't want to do this. I can squash if we want to keep. I also have not tested the Windows command that copies the file instead of making a symlink. |
I'm kind of torn about installing I think I prefer to not install it on Windows; what do you think? |
This is confusing. The convention of |
An alternative is to just create a symlink on Windows too, and ignore the failure if the user doesn't have "Developer Mode" enabled on their system (to allow non-admins to create symlinks). |
Not really. It is a variant of the tool installed by Lima, that will automatically work with the daemons inside a Lima instance. But the tools run locally, as long as they are installed, and only fall back to running inside the VM when they don't exist locally. The only tools that always run inside the VM are The goal is to make the difference invisible. The |
Couldn't you use a shell wrapper on Windows, and call
The main difference is that they just call the external tool, like |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still don't think we should expose this dev tool to end users in the same way as other *.lima
helpers
Adding it to `lima-guestagent` allows us to use `yq` in provisioning scripts without having to install it from a package repository or downloading it from GitHub. Adding it to `limactl` makes it available to integration tests without having to install it. It is essentially free because we already use `yqlib` inside `limactl` anyways, , so the executable size doesn't really change. The size of the (compressed) guestagent for aarch64 increases from 12MB to 14MB, which seems acceptable. These are "hidden" commands that don't show up in --help output. Signed-off-by: Jan Dubois <jan.dubois@suse.com>
I don't know, I thought it was useful, and think it fits the scheme of adding useful utilities with a But whatever, I don't care that much, and have removed the extra commit. I only kept the change that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
Adding it to
lime-guestagent
allows us to useyq
in provisioning scripts without having to install it from a package repository or downloading it from GitHub.Adding it to
limactl
makes it available to integration tests without having to install it. It is essentially free because we already useyqlib
insidelimactl
anyways, so the executable size doesn't really change.The size of the (compressed) guestagent for
aarch64
increases from 12MB to 14MB, which seems acceptable.These are "hidden" commands that don't show up in
--help
output.This PR is meant to support the "yq provisioning mode" proposed in #3892, but I think is also valuable on its own.
I was initially thinking about making this a busybox-style "multi-call" binary, so you could put a symlink called
yq
into/usr/local/bin
and have it work as a regularyq
binary. But I'm worried about shadowing ayq
version installed by the user with a package manager, so didn't add this functionality.