Skip to content

bugfix:fix limactl panic because of invalid digest #3779

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

Merged
merged 1 commit into from
Aug 4, 2025

Conversation

ningmingxiao
Copy link
Contributor

use wrong config

- location: "/home/nmx001/ubuntu-24.10-server-cloudimg-amd64.img"
  arch: "x86_64"
  digest: "69f31d3208895e5f646e345fbc95190e5e311ecd1359a4d6ee2c0b6483ceca03"
? Creating an instance "default" Proceed with the current configuration
panic: no ':' separator in digest "69f31d3208895e5f646e345fbc95190e5e311ecd1359a4d6ee2c0b6483ceca03"

goroutine 1 [running]:
github.com/opencontainers/go-digest.Digest.sepIndex({0xc001380a00, 0x40})
        /home/runner/go/pkg/mod/github.com/opencontainers/[email protected]/digest.go:153 +0x94
github.com/opencontainers/go-digest.Digest.Algorithm(...)
        /home/runner/go/pkg/mod/github.com/opencontainers/[email protected]/digest.go:122
github.com/lima-vm/lima/pkg/limayaml.validateFileObject({{0xc00140c780, 0x33}, {0xc0013fae70, 0x6}, {0xc001380a00, 0x40}}, {0xc0014b63e5, 0x9})
        /home/runner/work/lima/lima/pkg/limayaml/validate.go:434 +0x6de
github.com/lima-vm/lima/pkg/limayaml.Validate(0xc000863b08, 0x1)
        /home/runner/work/lima/lima/pkg/limayaml/validate.go:81 +0x1c72
github.com/lima-vm/lima/pkg/instance.Create({0x15fbda0, 0x25fd2e0}, {0x7ffc46b9d3f5, 0x7}, {0xc000482a00, 0xba6, 0x1500}, 0x1)
        /home/runner/work/lima/lima/pkg/instance/create.go:50 +0x205
main.loadOrCreateInstance(0xc0003fe608, {0xc0004ac870?, 0x0?, 0x0?}, 0x0)
        /home/runner/work/lima/lima/cmd/limactl/start.go:238 +0xdd2
main.startAction(0xc0003fe608, {0xc0004ac870, 0x1, 0x9})
        /home/runner/work/lima/lima/cmd/limactl/start.go:446 +0x78
github.com/spf13/cobra.(*Command).execute(0xc0003fe608, {0xc0004ac7e0, 0x9, 0x9})
        /home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:1015 +0xaaa
github.com/spf13/cobra.(*Command).ExecuteC(0xc0003fe008)
        /home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:1148 +0x46f
github.com/spf13/cobra.(*Command).Execute(...)
        /home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:1071

@ningmingxiao ningmingxiao force-pushed the fix_panic branch 2 times, most recently from af44a14 to 52fc827 Compare July 31, 2025 13:34
Copy link
Member

@afbjorklund afbjorklund left a comment

Choose a reason for hiding this comment

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

Thanks, much better. Make the unit test separate, and it should be OK

@ningmingxiao ningmingxiao force-pushed the fix_panic branch 2 times, most recently from b8a0ed8 to 6972b1f Compare August 1, 2025 06:05
@ningmingxiao
Copy link
Contributor Author

done. thanks

@@ -73,6 +73,15 @@ func TestValidateMinimumLimaVersion(t *testing.T) {
}
}

func TestValidateDigest(t *testing.T) {
images := `images: [{"location": "/",digest: "69f31d3208895e5f646e345fbc95190e5e311ecd1359a4d6ee2c0b6483ceca03"}]`
Copy link
Member

Choose a reason for hiding this comment

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

The location seems invalid

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done, I think we can create another pr to verify location. @AkihiroSuda

afbjorklund
afbjorklund previously approved these changes Aug 1, 2025
@AkihiroSuda AkihiroSuda added this to the v2.0.0 milestone Aug 1, 2025
@AkihiroSuda AkihiroSuda requested a review from afbjorklund August 4, 2025 06:17
Copy link
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

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

Thanks

@AkihiroSuda AkihiroSuda merged commit d12a3b2 into lima-vm:master Aug 4, 2025
36 checks passed
@ningmingxiao ningmingxiao deleted the fix_panic branch August 4, 2025 15:55
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.

4 participants