Repository: lima-vm/lima
Pull request #2949 (2024-11-28 01:15:40)

build(deps): bump github.com/goccy/go-yaml from 1.13.6 to 1.15.3
@jandubois: I've added a commit to fix the incompatibilities (`yaml.DisallowDuplicateKey` no longer exists, and is the default now), and bumped to the latest 1.15.3 release.

I've also adjusted for 2 test failures:

* load_test needs to match a different upstream error message now
* validate_test had incorrect YAML that wasn't detected with older versions
<hr>

Bumps [github.com/goccy/go-yaml](https://github.com/goccy/go-yaml) from 1.13.6 to 1.15.2.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/goccy/go-yaml/releases">github.com/goccy/go-yaml's releases</a>.</em></p>
<blockquote>
<h2>1.15.2</h2>
<h2>What's Changed</h2>
<ul>
<li>Guard stack overflow at decoding by <a href="https://github.com/goccy"><code>@​goccy</code></a> in <a href="https://redirect.github.com/goccy/go-yaml/pull/549">goccy/go-yaml#549</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a href="https://github.com/goccy/go-yaml/compare/v1.15.1...v1.15.2">https://github.com/goccy/go-yaml/compare/v1.15.1...v1.15.2</a></p>
<h2>1.15.1</h2>
<h2>What's Changed</h2>
<ul>
<li>Inventorying test cases of YAML Test Suite by <a href="https://github.com/goccy"><code>@​goccy</code></a> in <a href="https://redirect.github.com/goccy/go-yaml/pull/547">goccy/go-yaml#547</a></li>
<li>Add first fuzzing test by <a href="https://github.com/goccy"><code>@​goccy</code></a> in <a href="https://redirect.github.com/goccy/go-yaml/pull/548">goccy/go-yaml#548</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a href="https://github.com/goccy/go-yaml/compare/v1.15.0...v1.15.1">https://github.com/goccy/go-yaml/compare/v1.15.0...v1.15.1</a></p>
<h2>1.15.0</h2>
<h2>What's Changed</h2>
<ul>
<li>Add YAML Test Suite by <a href="https://github.com/goccy"><code>@​goccy</code></a> in <a href="https://redirect.github.com/goccy/go-yaml/pull/541">goccy/go-yaml#541</a></li>
<li>Fix parser by using yaml-test-suite by <a href="https://github.com/goccy"><code>@​goccy</code></a> in <a href="https://redirect.github.com/goccy/go-yaml/pull/542">goccy/go-yaml#542</a></li>
<li>Refactor parser by <a href="https://github.com/goccy"><code>@​goccy</code></a> in <a href="https://redirect.github.com/goccy/go-yaml/pull/545">goccy/go-yaml#545</a></li>
<li>Fix parser by <a href="https://github.com/goccy"><code>@​goccy</code></a> in <a href="https://redirect.github.com/goccy/go-yaml/pull/546">goccy/go-yaml#546</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a href="https://github.com/goccy/go-yaml/compare/v1.14.3...v1.15.0">https://github.com/goccy/go-yaml/compare/v1.14.3...v1.15.0</a></p>
<h2>1.14.3</h2>
<h2>What's Changed</h2>
<ul>
<li>Clear pathMap keys by <a href="https://github.com/goccy"><code>@​goccy</code></a> in <a href="https://redirect.github.com/goccy/go-yaml/pull/539">goccy/go-yaml#539</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a href="https://github.com/goccy/go-yaml/compare/v1.14.2...v1.14.3">https://github.com/goccy/go-yaml/compare/v1.14.2...v1.14.3</a></p>
<h2>1.14.2</h2>
<h2>What's Changed</h2>
<ul>
<li>Fix invalid token error by <a href="https://github.com/goccy"><code>@​goccy</code></a> in <a href="https://redirect.github.com/goccy/go-yaml/pull/536">goccy/go-yaml#536</a></li>
<li>Fix parsing of tab character in double-quote by <a href="https://github.com/goccy"><code>@​goccy</code></a> in <a href="https://redirect.github.com/goccy/go-yaml/pull/538">goccy/go-yaml#538</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a href="https://github.com/goccy/go-yaml/compare/v1.14.1...v1.14.2">https://github.com/goccy/go-yaml/compare/v1.14.1...v1.14.2</a></p>
<h2>1.14.1</h2>
<h2>What's Changed</h2>
<ul>
<li>Fix comment position of map node has multiple values by <a href="https://github.com/goccy"><code>@​goccy</code></a> in <a href="https://redirect.github.com/goccy/go-yaml/pull/532">goccy/go-yaml#532</a></li>
<li>Fix error by <a href="https://github.com/goccy"><code>@​goccy</code></a> in <a href="https://redirect.github.com/goccy/go-yaml/pull/535">goccy/go-yaml#535</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a href="https://github.com/goccy/go-yaml/compare/v1.14.0...v1.14.1">https://github.com/goccy/go-yaml/compare/v1.14.0...v1.14.1</a></p>
<h2>1.14.0</h2>
<h2>What's Changed</h2>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/goccy/go-yaml/commit/3584ab7d9c402e6bada57a1490de4442c1755c00"><code>3584ab7</code></a> guard stack overflow at decoding (<a href="https://redirect.github.com/goccy/go-yaml/issues/549">#549</a>)</li>
<li><a href="https://github.com/goccy/go-yaml/commit/23c92341504cbbddace215c4f66e79387bcc7fe1"><code>23c9234</code></a> add fuzzing test (<a href="https://redirect.github.com/goccy/go-yaml/issues/548">#548</a>)</li>
<li><a href="https://github.com/goccy/go-yaml/commit/639f493c28d768dcae36b0edb233ab948de613bb"><code>639f493</code></a> inventorying test cases (<a href="https://redirect.github.com/goccy/go-yaml/issues/547">#547</a>)</li>
<li><a href="https://github.com/goccy/go-yaml/commit/339908482797d14c30d665bb8af25304f4e613a9"><code>3399084</code></a> Fix parser (<a href="https://redirect.github.com/goccy/go-yaml/issues/546">#546</a>)</li>
<li><a href="https://github.com/goccy/go-yaml/commit/deb129adad1020efd37a2db734242d92d6e44236"><code>deb129a</code></a> Refactor parser (<a href="https://redirect.github.com/goccy/go-yaml/issues/545">#545</a>)</li>
<li><a href="https://github.com/goccy/go-yaml/commit/ff5d41fe8eb22ba2b6c8f27541b40a859c17728f"><code>ff5d41f</code></a> Fix parser by using yaml-test-suite (<a href="https://redirect.github.com/goccy/go-yaml/issues/542">#542</a>)</li>
<li><a href="https://github.com/goccy/go-yaml/commit/c3128820b19a41b555555e1051b025152c44ba7d"><code>c312882</code></a> Add YAML Test Suite (<a href="https://redirect.github.com/goccy/go-yaml/issues/541">#541</a>)</li>
<li><a href="https://github.com/goccy/go-yaml/commit/69159b35ce8155dacda698328fe110a7a7b1eb24"><code>69159b3</code></a> clear pathMap keys (<a href="https://redirect.github.com/goccy/go-yaml/issues/539">#539</a>)</li>
<li><a href="https://github.com/goccy/go-yaml/commit/d7847dbcfd7df97a7b74c90b3eff88b278cf178c"><code>d7847db</code></a> fix parsing of tab character in double-quote (<a href="https://redirect.github.com/goccy/go-yaml/issues/538">#538</a>)</li>
<li><a href="https://github.com/goccy/go-yaml/commit/8b2110bca955e6cfb99d81433de9b8d3df02f6e2"><code>8b2110b</code></a> fix invalid token error (<a href="https://redirect.github.com/goccy/go-yaml/issues/536">#536</a>)</li>
<li>Additional commits viewable in <a href="https://github.com/goccy/go-yaml/compare/v1.13.6...v1.15.2">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/goccy/go-yaml&package-manager=go_modules&previous-version=1.13.6&new-version=1.15.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>


Patch:
diff --git a/go.mod b/go.mod
index 711d5994..9108f6bd 100644
--- a/go.mod
+++ b/go.mod
@@ -21,7 +21,7 @@ require (
 	github.com/docker/go-units v0.5.0
 	github.com/elastic/go-libaudit/v2 v2.6.1
 	github.com/foxcpp/go-mockdns v1.1.0
-	github.com/goccy/go-yaml v1.13.6
+	github.com/goccy/go-yaml v1.15.3
 	github.com/google/go-cmp v0.6.0
 	github.com/google/yamlfmt v0.14.0
 	github.com/invopop/jsonschema v0.12.0
diff --git a/go.sum b/go.sum
index 699c5400..10ac97b6 100644
--- a/go.sum
+++ b/go.sum
@@ -93,8 +93,6 @@ github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nos
 github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
 github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E=
 github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ=
-github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0=
-github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk=
 github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
 github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
 github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE=
@@ -104,20 +102,16 @@ github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En
 github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14=
 github.com/go-openapi/swag v0.22.4 h1:QLMzNJnMGPRNDCbySlcj1x01tzU8/9LTTL9hZZZogBU=
 github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14=
-github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=
-github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=
-github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=
-github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
-github.com/go-playground/validator/v10 v10.22.1 h1:40JcKH+bBNGFczGuoBYgX4I6m/i27HYW8P9FDk5PbgA=
-github.com/go-playground/validator/v10 v10.22.1/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM=
 github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI=
 github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8=
 github.com/go-test/deep v1.0.8 h1:TDsG77qcSprGbC6vTN8OuXp5g+J+b5Pcguhf7Zt61VM=
 github.com/go-test/deep v1.0.8/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE=
 github.com/goccy/go-json v0.10.3 h1:KZ5WoDbxAIgm2HNbYckL0se1fHD6rz5j4ywS6ebzDqA=
 github.com/goccy/go-json v0.10.3/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M=
-github.com/goccy/go-yaml v1.13.6 h1:pa3JkBPBseTtfqpG9DiSFhyxNPSpJ0BFa39BlMZE16E=
-github.com/goccy/go-yaml v1.13.6/go.mod h1:IjYwxUiJDoqpx2RmbdjMUceGHZwYLon3sfOGl5Hi9lc=
+github.com/goccy/go-yaml v1.15.2 h1:L5+IGnoVlaBoaopwk66lBs1ilKPOkge4h6lBeRk4dfQ=
+github.com/goccy/go-yaml v1.15.2/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA=
+github.com/goccy/go-yaml v1.15.3 h1:wQ4UwLFkgbSazdi+i9AVmZE3vKTktlNlI2kQqXo5L+I=
+github.com/goccy/go-yaml v1.15.3/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA=
 github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
 github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
 github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
@@ -177,8 +171,6 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
 github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
 github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
 github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
-github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=
-github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI=
 github.com/lima-vm/go-qcow2reader v0.6.0 h1:dNstUGQxEUPbmiiVnu/cek2x7scrHe2VJy5JseLLflo=
 github.com/lima-vm/go-qcow2reader v0.6.0/go.mod h1:ay45SlGOzU+2Vc21g5/lmQgPn7Hmf0JpPhm8cuOK1FI=
 github.com/lima-vm/sshocker v0.3.4 h1:5rn6vMkfqwZSZiBW+Udo505OIRhPB4xbLUDdEnFgWwI=
diff --git a/pkg/limayaml/marshal.go b/pkg/limayaml/marshal.go
index 324bc0d9..9e390b63 100644
--- a/pkg/limayaml/marshal.go
+++ b/pkg/limayaml/marshal.go
@@ -36,7 +36,7 @@ func unmarshalDisk(dst *Disk, b []byte) error {
 }
 
 func Unmarshal(data []byte, v interface{}, comment string) error {
-	if err := yaml.UnmarshalWithOptions(data, v, yaml.DisallowDuplicateKey(), yaml.CustomUnmarshaler[Disk](unmarshalDisk)); err != nil {
+	if err := yaml.UnmarshalWithOptions(data, v, yaml.CustomUnmarshaler[Disk](unmarshalDisk)); err != nil {
 		return fmt.Errorf("failed to unmarshal YAML (%s): %w", comment, err)
 	}
 	// the go-yaml library doesn't catch all markup errors, unfortunately
diff --git a/pkg/networks/config.go b/pkg/networks/config.go
index c051111e..a7707d36 100644
--- a/pkg/networks/config.go
+++ b/pkg/networks/config.go
@@ -132,7 +132,7 @@ func loadCache() {
 		if cache.err != nil {
 			return
 		}
-		cache.err = yaml.UnmarshalWithOptions(b, &cache.cfg, yaml.DisallowDuplicateKey())
+		cache.err = yaml.Unmarshal(b, &cache.cfg)
 		if cache.err != nil {
 			cache.err = fmt.Errorf("cannot parse %q: %w", cfgFile, cache.err)
 			return


Test patch:
diff --git a/pkg/limayaml/load_test.go b/pkg/limayaml/load_test.go
index a4a489f1..c5bb5c2d 100644
--- a/pkg/limayaml/load_test.go
+++ b/pkg/limayaml/load_test.go
@@ -28,7 +28,7 @@ provision:
     echo three
 `
 	_, err := Load([]byte(s), "error.yaml")
-	assert.ErrorContains(t, err, "did not find expected key")
+	assert.ErrorContains(t, err, "map key-value is pre-defined")
 }
 
 func TestLoadDiskString(t *testing.T) {
diff --git a/pkg/limayaml/validate_test.go b/pkg/limayaml/validate_test.go
index b45ae18d..51254757 100644
--- a/pkg/limayaml/validate_test.go
+++ b/pkg/limayaml/validate_test.go
@@ -33,14 +33,14 @@ func TestValidateDefault(t *testing.T) {
 
 func TestValidateProbes(t *testing.T) {
 	images := `images: [{"location": "/"}]`
-	validProbe := `probes: ["script": "#!foo"]`
+	validProbe := `probes: [{"script": "#!foo"}]`
 	y, err := Load([]byte(validProbe+"\n"+images), "lima.yaml")
 	assert.NilError(t, err)
 
 	err = Validate(y, false)
 	assert.NilError(t, err)
 
-	invalidProbe := `probes: ["script": "foo"]`
+	invalidProbe := `probes: [{"script": "foo"}]`
 	y, err = Load([]byte(invalidProbe+"\n"+images), "lima.yaml")
 	assert.NilError(t, err)