From 1aace356d01747eea16a2677ed13bdcbbd4bb082 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 23 Aug 2024 17:20:51 +0200 Subject: [PATCH] Update module github.com/jsonnet-bundler/jsonnet-bundler to v0.6.0 (#197) * Update module github.com/jsonnet-bundler/jsonnet-bundler to v0.6.0 * Use orderedMap methods to get, set and delete dependencies --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Matthias Loibl --- go.mod | 3 ++- go.sum | 4 ++++ pkg/jsonnetbundler/install.go | 10 +++++++--- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index fcbe4c8..9d7d35b 100644 --- a/go.mod +++ b/go.mod @@ -16,6 +16,7 @@ require ( github.com/Masterminds/semver/v3 v3.2.0 // indirect github.com/Masterminds/sprig/v3 v3.2.3 // indirect github.com/edsrzf/mmap-go v1.1.0 // indirect + github.com/elliotchance/orderedmap/v2 v2.2.0 // indirect github.com/facette/natsort v0.0.0-20181210072756-2cd4dd1e2dcb // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect @@ -58,7 +59,7 @@ require ( github.com/gobuffalo/packr/v2 v2.8.3 github.com/google/go-jsonnet v0.20.0 github.com/grafana/tanka v0.28.0 - github.com/jsonnet-bundler/jsonnet-bundler v0.5.1 + github.com/jsonnet-bundler/jsonnet-bundler v0.6.0 github.com/pkg/errors v0.9.1 github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/prometheus/client_golang v1.19.1 // indirect diff --git a/go.sum b/go.sum index 17fb38b..6b76476 100644 --- a/go.sum +++ b/go.sum @@ -96,6 +96,8 @@ github.com/dennwc/varint v1.0.0 h1:kGNFFSSw8ToIy3obO/kKr8U9GZYUAxQEVuix4zfDWzE= github.com/dennwc/varint v1.0.0/go.mod h1:hnItb35rvZvJrbTALZtY/iQfDs48JKRG1RPpgziApxA= github.com/edsrzf/mmap-go v1.1.0 h1:6EUwBLQ/Mcr1EYLE4Tn1VdW1A4ckqCQWZBw8Hr0kjpQ= github.com/edsrzf/mmap-go v1.1.0/go.mod h1:19H/e8pUPLicwkyNgOykDXkJ9F0MHE+Z52B8EIth78Q= +github.com/elliotchance/orderedmap/v2 v2.2.0 h1:7/2iwO98kYT4XkOjA9mBEIwvi4KpGB4cyHeOFOnj4Vk= +github.com/elliotchance/orderedmap/v2 v2.2.0/go.mod h1:85lZyVbpGaGvHvnKa7Qhx7zncAdBIBq6u56Hb1PRU5Q= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= @@ -256,6 +258,8 @@ github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/jsonnet-bundler/jsonnet-bundler v0.5.1 h1:eUd6EA1Qzz73Q4NLNLOrNkMb96+6NTTERbX9lqaxVwk= github.com/jsonnet-bundler/jsonnet-bundler v0.5.1/go.mod h1:Qrdw/7mOFS2SKCOALKFfEH8gdvXJi8XZjw9g5ilpf4I= +github.com/jsonnet-bundler/jsonnet-bundler v0.6.0 h1:DBnynmjyWBVQ9gUBmTh49x3Dw5/u4CvGO3k2k1CsYNo= +github.com/jsonnet-bundler/jsonnet-bundler v0.6.0/go.mod h1:5esRxD59TyScj6qxT3o7GH0sryBKvVmx2zaEYDXtQkg= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= diff --git a/pkg/jsonnetbundler/install.go b/pkg/jsonnetbundler/install.go index 3bfbc7a..a5a4fee 100644 --- a/pkg/jsonnetbundler/install.go +++ b/pkg/jsonnetbundler/install.go @@ -71,12 +71,16 @@ func InstallCommand(dir, jsonnetHome string, uris []string, single bool) error { d.Single = true } - if !depEqual(jsonnetFile.Dependencies[d.Name()], *d) { + value, ok := jsonnetFile.Dependencies.Get(d.Name()) + if !ok { + return fmt.Errorf("failed to find package %s", d.Name()) + } + if !depEqual(value, *d) { // the dep passed on the cli is different from the jsonnetFile - jsonnetFile.Dependencies[d.Name()] = *d + jsonnetFile.Dependencies.Set(d.Name(), *d) // we want to install the passed version (ignore the lock) - delete(lockFile.Dependencies, d.Name()) + lockFile.Dependencies.Delete(d.Name()) } }