Skip to content

docs: add limactl help yq concept guide to explain yqlib limitations#4886

Open
Mysterio-17 wants to merge 1 commit intolima-vm:masterfrom
Mysterio-17:docs/limactl-help-yq-limitations
Open

docs: add limactl help yq concept guide to explain yqlib limitations#4886
Mysterio-17 wants to merge 1 commit intolima-vm:masterfrom
Mysterio-17:docs/limactl-help-yq-limitations

Conversation

@Mysterio-17
Copy link
Copy Markdown
Contributor

Description

Addresses the missing documentation for the Lima yq dialect by adding a concept guide that clarifies which yq operators are disabled for security reasons.

Fixes: #4531

Changes

  • Added a limactl help yq command to document unsupported yq operators (env, load, load_str).
  • Integrated limactl yq into the root command so it appears natively under "Additional help topics".
  • Updated the --set flag description (used in limactl create, etc.) to explicitly point users to limactl help yq.

Testing

  • limactl help: Verified yq is listed under "Additional help topics".
  • limactl help yq: Verified it correctly prints the new concept guide.
  • limactl create --help: Verified the --set flag correctly references limactl help yq.
  • go test ./cmd/limactl/...: Tests passed successfully with no regressions.

Comment thread cmd/limactl/yq.go Outdated

func newYQHelpCommand() *cobra.Command {
return &cobra.Command{
Use: "yq",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This seems to conflict with the existing limactl yq command

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I missed that limactl yq is intercepted as a multicall binary. I've just pushed an update renaming the concept guide to yq-dialect, and I've updated the --set flag description to point there.

@Mysterio-17 Mysterio-17 force-pushed the docs/limactl-help-yq-limitations branch from ef0dfac to 41f1478 Compare April 25, 2026 06:55
Comment thread hack/cache-common-inc.sh Outdated
function check_location_without_cache() {
local -r location="$1"
curl -sIL -w "%{http_code} %header{Content-Length}" "${location}" -o /dev/null
curl --retry 5 --retry-connrefused -sIL -w "%{http_code} %header{Content-Length}" "${location}" -o /dev/null
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This seems unrelated to the issue

@Mysterio-17 Mysterio-17 force-pushed the docs/limactl-help-yq-limitations branch 2 times, most recently from b18afdd to 390ad8d Compare April 25, 2026 08:40
Comment thread cmd/limactl/editflags/editflags.go Outdated
Copy link
Copy Markdown
Member

@unsuman unsuman left a comment

Choose a reason for hiding this comment

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

Looks good, please squash the commits!

@Mysterio-17 Mysterio-17 force-pushed the docs/limactl-help-yq-limitations branch from 0b3ba6b to 39f0f5b Compare April 25, 2026 08:47
unsuman
unsuman previously approved these changes Apr 25, 2026
Copy link
Copy Markdown
Member

@unsuman unsuman 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 added this to the v2.1.2 milestone Apr 25, 2026
@AkihiroSuda AkihiroSuda requested a review from jandubois April 25, 2026 09:31
@jandubois
Copy link
Copy Markdown
Member

jandubois commented Apr 27, 2026

I think I would prefer yq-restrictions to yq-dialect. We don't use a different dialect, we use regular yq syntax, with just a few operators disabled.

I wonder if we should also mention that the new system operations are disabled as well? Of course they are also disabled by yq itself by default, but may be worth mentioning for completeness.

limactl yq -n 'system("ls")'
Error: system operations are disabled, use --security-enable-system-operator to enable

We probably should have a BATS tests to ensure we don't enable it by accident.

Some other observations:

  • restricted operations are now listed in 2 files, which is a maintenance issue: cmd/limactl/yq_dialect.go and cmd/limactl/start.go.

  • --set works on create, edit, and start, but the long help is only added in create. Maybe it should be shared (not duplicated) by all relevant subcommands.

  • Maybe the explanation should include not just the "what" but also "why" the operators have been restricted?

  • I think the yq-restrictions output should include a link to the upstream yq docs, explaining that we are using yq version 4 syntax.

Adds a 'yq-restrictions' help topic explaining which yq operators are disabled by Lima (env, load, load_str) and which are disabled by yqlib itself (system), along with the security rationale. Updates the --set flag description to point to it. Adds a BATS test to ensure system() stays disabled.

Signed-off-by: Mysterio-17 <mradultiwari1708@gmail.com>
@Mysterio-17
Copy link
Copy Markdown
Contributor Author

I think I would prefer yq-restrictions to yq-dialect. We don't use a different dialect, we use regular yq syntax, with just a few operators disabled.

I wonder if we should also mention that the new system operations are disabled as well? Of course they are also disabled by yq itself by default, but may be worth mentioning for completeness.

❯ limactl yq -n 'system("ls")'
Error: system operations are disabled, use --security-enable-system-operator to enable

We probably should have a BATS tests to ensure we don't enable it by accident.

Some other observations:

  • restricted operations are now listed in 2 files, which is a maintenance issue: cmd/limactl/yq_dialect.go and cmd/limactl/start.go.
  • --set works on create, edit, and start, but the long help is only added in create. Maybe it should be shared (not duplicated) by all relevant subcommands.
  • Maybe the explanation should include not just the "what" but also "why" the operators have been restricted?
  • I think the yq-restrictions output should include a link to the upstream yq docs, explaining that we are using yq version 4 syntax.

Hi @jandubois , I've made the changes:-

  • Renamed to yq-restrictions — makes more sense since it's regular yq with some ops disabled, not a different dialect.
  • Mentioned system as well (disabled by yqlib default), separated from the ones Lima explicitly disables (env, load, load_str).
  • Added a BATS test for system() so we catch it if it ever gets enabled by accident.
  • Moved all restriction details into limactl help yq-restrictions as the single source — the --set flag and create example just reference it now, no duplication.
  • Included the "why" (untrusted templates) and a link to the upstream yq v4 docs.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

limactl help should explain the limitation of the YQ expression support

4 participants