Skip to content

Commit 16f1015

Browse files
committed
build(deps): bump github.com/tomwright/dasel to v2
1 parent 51b17e7 commit 16f1015

File tree

4 files changed

+23
-39
lines changed

4 files changed

+23
-39
lines changed

go.mod

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ require (
4242
github.com/slok/go-http-metrics v0.13.0
4343
github.com/spf13/cobra v1.8.1
4444
github.com/spf13/viper v1.19.0
45-
github.com/tomwright/dasel v1.27.3
45+
github.com/tomwright/dasel/v2 v2.8.1
4646
github.com/weaveworks/policy-agent/api v1.0.5
4747
github.com/yannh/kubeconform v0.6.7
4848
go.uber.org/zap v1.27.0
@@ -66,7 +66,6 @@ require (
6666
require (
6767
dario.cat/mergo v1.0.1 // indirect
6868
github.com/Masterminds/sprig v2.22.0+incompatible // indirect
69-
github.com/Masterminds/sprig/v3 v3.3.0 // indirect
7069
github.com/aws/aws-sdk-go v1.55.5 // indirect
7170
github.com/blang/semver/v4 v4.0.0 // indirect
7271
github.com/chai2010/gettext-go v1.0.3 // indirect
@@ -109,7 +108,6 @@ require (
109108
github.com/sagikazarmark/locafero v0.7.0 // indirect
110109
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
111110
github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 // indirect
112-
github.com/shopspring/decimal v1.4.0 // indirect
113111
github.com/sirupsen/logrus v1.9.3 // indirect
114112
github.com/skeema/knownhosts v1.3.0 // indirect
115113
github.com/sourcegraph/conc v0.3.0 // indirect
@@ -122,7 +120,6 @@ require (
122120
golang.org/x/sync v0.10.0 // indirect
123121
google.golang.org/genproto/googleapis/rpc v0.0.0-20250106144421-5f5ef82da422 // indirect
124122
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
125-
gopkg.in/yaml.v2 v2.4.0 // indirect
126123
)
127124

128125
require (
@@ -132,13 +129,10 @@ require (
132129
github.com/Masterminds/semver v1.5.0 // indirect
133130
github.com/Microsoft/go-winio v0.6.2 // indirect
134131
github.com/ProtonMail/go-crypto v1.1.3 // indirect
135-
github.com/alecthomas/chroma v0.10.0 // indirect
136132
github.com/beorn7/perks v1.0.1 // indirect
137133
github.com/cespare/xxhash/v2 v2.3.0 // indirect
138-
github.com/clbanning/mxj/v2 v2.7.0 // indirect
139134
github.com/cpuguy83/go-md2man/v2 v2.0.6 // indirect
140135
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
141-
github.com/dlclark/regexp2 v1.11.4 // indirect
142136
github.com/emirpasic/gods v1.18.1 // indirect
143137
github.com/exponent-io/jsonpath v0.0.0-20210407135951-1de76d718b3f // indirect
144138
github.com/fluxcd/pkg/apis/acl v0.5.0 // indirect
@@ -181,7 +175,6 @@ require (
181175
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
182176
github.com/modern-go/reflect2 v1.0.2 // indirect
183177
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
184-
github.com/pelletier/go-toml v1.9.5 // indirect
185178
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
186179
github.com/prometheus/client_golang v1.20.5
187180
github.com/prometheus/client_model v0.6.1 // indirect

go.sum

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,13 @@ github.com/Masterminds/semver/v3 v3.3.1 h1:QtNSWtVZ3nBfk8mAOu/B6v7FMJ+NHTIgUPi7r
1616
github.com/Masterminds/semver/v3 v3.3.1/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM=
1717
github.com/Masterminds/sprig v2.22.0+incompatible h1:z4yfnGrZ7netVz+0EDJ0Wi+5VZCSYp4Z0m2dk6cEM60=
1818
github.com/Masterminds/sprig v2.22.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o=
19-
github.com/Masterminds/sprig/v3 v3.3.0 h1:mQh0Yrg1XPo6vjYXgtf5OtijNAKJRNcTdOOGZe3tPhs=
20-
github.com/Masterminds/sprig/v3 v3.3.0/go.mod h1:Zy1iXRYNqNLUolqCpL4uhk6SHUMAOSCzdgBfDb35Lz0=
2119
github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY=
2220
github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY=
2321
github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU=
2422
github.com/NYTimes/gziphandler v1.1.1 h1:ZUDjpQae29j0ryrS0u/B8HZfJBtBQHjqw2rQ2cqUQ3I=
2523
github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c=
2624
github.com/ProtonMail/go-crypto v1.1.3 h1:nRBOetoydLeUb4nHajyO2bKqMLfWQ/ZPwkXqXxPxCFk=
2725
github.com/ProtonMail/go-crypto v1.1.3/go.mod h1:rA3QumHc/FZ8pAHreoekgiAbzpNsfQAosU5td4SnOrE=
28-
github.com/alecthomas/chroma v0.10.0 h1:7XDcGkCQopCNKjZHfYrNLraA+M7e0fMiJ/Mfikbfjek=
29-
github.com/alecthomas/chroma v0.10.0/go.mod h1:jtJATyUxlIORhUOFNA9NZDWGAQ8wpxQQqNSB4rjA/1s=
3026
github.com/alexedwards/scs/v2 v2.8.0 h1:h31yUYoycPuL0zt14c0gd+oqxfRwIj6SOjHdKRZxhEw=
3127
github.com/alexedwards/scs/v2 v2.8.0/go.mod h1:ToaROZxyKukJKT/xLcVQAChi5k6+Pn1Gvmdl7h3RRj8=
3228
github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFIImctFaOjnTIavg87rW78vTPkQqLI8=
@@ -59,8 +55,6 @@ github.com/chzyer/readline v1.5.1/go.mod h1:Eh+b79XXUwfKfcPLepksvw2tcLE/Ct21YObk
5955
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
6056
github.com/chzyer/test v1.0.0 h1:p3BQDXSxOhOG0P9z6/hGnII4LGiEPOYBhs8asl/fC04=
6157
github.com/chzyer/test v1.0.0/go.mod h1:2JlltgoNkt4TW/z9V/IzDdFaMTM2JPIi26O1pF38GC8=
62-
github.com/clbanning/mxj/v2 v2.7.0 h1:WA/La7UGCanFe5NpHF0Q3DNtnCsVoxbPKuyBNHWRyME=
63-
github.com/clbanning/mxj/v2 v2.7.0/go.mod h1:hNiWqW14h+kc+MdF9C6/YoRfjEJoR3ou6tn/Qo+ve2s=
6458
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
6559
github.com/cloudflare/circl v1.5.0 h1:hxIWksrX6XN5a1L2TI/h53AGPhNHoUBo+TD1ms9+pys=
6660
github.com/cloudflare/circl v1.5.0/go.mod h1:uddAzsPgqdMAYatqJ0lsjX1oECcQLIlRpzZh3pJrofs=
@@ -78,9 +72,6 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
7872
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
7973
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
8074
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
81-
github.com/dlclark/regexp2 v1.4.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc=
82-
github.com/dlclark/regexp2 v1.11.4 h1:rPYF9/LECdNymJufQKmri9gV604RvvABwgOA8un7yAo=
83-
github.com/dlclark/regexp2 v1.11.4/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8=
8475
github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
8576
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
8677
github.com/elazarl/goproxy v1.2.3 h1:xwIyKHbaP5yfT6O9KIeYJR5549MXRQkoQMRXGztz8YQ=
@@ -350,8 +341,6 @@ github.com/onsi/ginkgo/v2 v2.22.2 h1:/3X8Panh8/WwhU/3Ssa6rCKqPLuAkVY2I0RoyDLySlU
350341
github.com/onsi/ginkgo/v2 v2.22.2/go.mod h1:oeMosUL+8LtarXBHu/c0bx2D/K9zyQ6uX3cTyztHwsk=
351342
github.com/onsi/gomega v1.36.2 h1:koNYke6TVk6ZmnyHrCXba/T/MoLBXFjeC1PtvYgw0A8=
352343
github.com/onsi/gomega v1.36.2/go.mod h1:DdwyADRjrc825LhMEkD76cHR5+pUnjhUN8GlHlRPHzY=
353-
github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8=
354-
github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c=
355344
github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M=
356345
github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc=
357346
github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI=
@@ -398,8 +387,6 @@ github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN
398387
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4=
399388
github.com/sethvargo/go-limiter v1.0.0 h1:JqW13eWEMn0VFv86OKn8wiYJY/m250WoXdrjRV0kLe4=
400389
github.com/sethvargo/go-limiter v1.0.0/go.mod h1:01b6tW25Ap+MeLYBuD4aHunMrJoNO5PVUFdS9rac3II=
401-
github.com/shopspring/decimal v1.4.0 h1:bxl37RwXBklmTi0C79JfXCEBD1cqqHt0bbgBAGFp81k=
402-
github.com/shopspring/decimal v1.4.0/go.mod h1:gawqmDU56v4yIKSwfBSFip1HdCCXN8/+DMd9qYNcwME=
403390
github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
404391
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
405392
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
@@ -435,8 +422,8 @@ github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8
435422
github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
436423
github.com/theckman/yacspin v0.13.12 h1:CdZ57+n0U6JMuh2xqjnjRq5Haj6v1ner2djtLQRzJr4=
437424
github.com/theckman/yacspin v0.13.12/go.mod h1:Rd2+oG2LmQi5f3zC3yeZAOl245z8QOvrH4OPOJNZxLg=
438-
github.com/tomwright/dasel v1.27.3 h1:vnoaZsG8hbubcdh2IioRVjOt2DTg+txLtDGKQn1cdA8=
439-
github.com/tomwright/dasel v1.27.3/go.mod h1:/rESPoTvQxRkrtEH8lhSU8CB2UWPh/bM0kDrKVGf1kQ=
425+
github.com/tomwright/dasel/v2 v2.8.1 h1:mo5SlL0V2d3a0uPsD9Rrndn0cHWpbNDheB4+Fm++z8k=
426+
github.com/tomwright/dasel/v2 v2.8.1/go.mod h1:6bNDNAnmGEtGpuIvksuQwiNcAgQ87pmzndynsqTNglc=
440427
github.com/weaveworks/policy-agent/api v1.0.5 h1:4pqzzta8xPUsE9h9YhGJVg5XQ2NuAU/CDoU7zdCw5A0=
441428
github.com/weaveworks/policy-agent/api v1.0.5/go.mod h1:LlhTiipsV5GSHkL/q7Wa7qrJPZGR9Xtoq2npXTWp9bI=
442429
github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
@@ -642,7 +629,6 @@ gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRN
642629
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
643630
gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
644631
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
645-
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
646632
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
647633
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
648634
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=

pkg/utils/common.go

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ import (
1111
"strings"
1212
"time"
1313

14-
"github.com/tomwright/dasel"
15-
yaml "gopkg.in/yaml.v3"
16-
validation "k8s.io/apimachinery/pkg/api/validation"
14+
"github.com/tomwright/dasel/v2"
15+
"gopkg.in/yaml.v3"
16+
"k8s.io/apimachinery/pkg/api/validation"
1717
)
1818

1919
// WaitUntil runs checkDone until an error is NOT returned, or a timeout is reached.
@@ -130,30 +130,35 @@ func FindCoreConfig(dir string) WalkResult {
130130
docs = append(docs, entry)
131131
}
132132

133-
rootNode := dasel.New(docs)
134-
foundPartial := false
133+
rootNode := dasel.ValueOf(docs)
134+
var foundHelmRelease, foundHelmRepository bool
135135

136-
_, err = rootNode.QueryMultiple(fmt.Sprintf(".(kind=HelmRelease)(.metadata.name=%s)", coreManifestName))
137-
if err == nil {
138-
foundPartial = true
136+
val, err := dasel.Select(rootNode, fmt.Sprintf("all().filter(equal(kind,HelmRelease),equal(metadata.name,%s)).count()", coreManifestName))
137+
if err != nil {
138+
return nil
139139
}
140+
foundHelmRelease = val.Interfaces()[0] != 0
140141

141-
_, err = rootNode.QueryMultiple(fmt.Sprintf(".(kind=HelmRepository)(.metadata.name=%s)", coreManifestName))
142+
val, err = dasel.Select(rootNode, fmt.Sprintf("all().filter(equal(kind,HelmRepository),equal(metadata.name,%s)).count()", coreManifestName))
142143
if err != nil {
143-
if foundPartial {
144-
return WalkResult{Status: Partial, Path: path}
145-
}
144+
return nil
145+
}
146+
foundHelmRepository = val.Interfaces()[0] != 0
146147

148+
if foundHelmRelease != foundHelmRepository {
149+
return WalkResult{Status: Partial, Path: path}
150+
}
151+
if !foundHelmRelease && !foundHelmRepository {
147152
return nil
148153
}
149154

150155
// retrieve the number of top-level entries from the file
151-
val, err := rootNode.Query(".[#]")
156+
val, err = dasel.Select(rootNode, "all().count()")
152157
if err != nil {
153158
return nil
154159
}
155160

156-
if val.InterfaceValue() != coreManifestCount {
161+
if val.Interfaces()[0] != coreManifestCount {
157162
return WalkResult{Status: Embedded, Path: path}
158163
}
159164

pkg/utils/common_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ error occurred some error, retrying in 1s
127127
path := filepath.Join(dir, "config.yaml")
128128
Expect(os.WriteFile(path, partialConfigFile, 0o666)).To(Succeed())
129129

130-
Expect(FindCoreConfig(dir)).To(Equal(WalkResult{Status: Embedded, Path: path}))
130+
Expect(FindCoreConfig(dir)).To(Equal(WalkResult{Status: Partial, Path: path}))
131131
})
132132

133133
It("finds core configuration nested in dir containing one (regardless of name)", func() {

0 commit comments

Comments
 (0)