Skip to content

Conversation

@jandubois
Copy link
Member

Before:

l ls --yq 'env(HOME)'
/Users/janl ls --yq 'load("/usr/local/share/lima/templates/ubuntu.yaml")'
{
    "minimumLimaVersion": "2.0.0",
    "base": [
        "template:_images/ubuntu-25.10",
        "template:_default/mounts"
    ]
}

After:

l ls --yq 'env(HOME)'
FATA[0000] env operations have been disabledl ls --yq 'load("/usr/local/share/lima/templates/ubuntu.yaml")'
FATA[0000] file operations have been disabled

Addresses objections to using YQ expressions for limactl list --filter in #4187.

@jandubois jandubois added this to the v2.1.0 (?) milestone Nov 25, 2025
Signed-off-by: Jan Dubois <jan.dubois@suse.com>
assert_output "foo"
}

@test '--yq cannot access environment variables' {
Copy link
Member

Choose a reason for hiding this comment

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

I think we can allow --yq to access env, as long as the upstream yq continues to allow accessing env by default.

The proposed --filter should be restrictive though

Copy link
Member Author

Choose a reason for hiding this comment

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

I think it is best to restrict it everywhere, except for limactl yq itself.

What is the use case for limactl list --yq or limactl info --yq to use env variables or load from files?

Copy link
Member Author

Choose a reason for hiding this comment

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

I continue to think that having just a single flavour of YQ expressions throughout Lima is preferable, especially since there are no known use-cases for the prohibited operations. Otherwise you have to document the kind of expression allowed separately for each option that takes a YQ expression.

And you can still do this if you really want to:

limactl list --json | limactl yq '...'

Because the yq command itself is not limited, only any expression used in Lima internally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants