diff --git a/.bingo/Variables.mk b/.bingo/Variables.mk index 1d179a2df..a4753b600 100644 --- a/.bingo/Variables.mk +++ b/.bingo/Variables.mk @@ -29,6 +29,12 @@ $(GINKGO): $(BINGO_DIR)/ginkgo.mod @echo "(re)installing $(GOBIN)/ginkgo-v2.22.2" @cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=ginkgo.mod -o=$(GOBIN)/ginkgo-v2.22.2 "github.com/onsi/ginkgo/v2/ginkgo" +GOLANGCI_LINT := $(GOBIN)/golangci-lint-v1.63.4 +$(GOLANGCI_LINT): $(BINGO_DIR)/golangci-lint.mod + @# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies. + @echo "(re)installing $(GOBIN)/golangci-lint-v1.63.4" + @cd $(BINGO_DIR) && GOWORK=off $(GO) build -mod=mod -modfile=golangci-lint.mod -o=$(GOBIN)/golangci-lint-v1.63.4 "github.com/golangci/golangci-lint/cmd/golangci-lint" + GORELEASER := $(GOBIN)/goreleaser-v1.26.2 $(GORELEASER): $(BINGO_DIR)/goreleaser.mod @# Install binary/ries using Go 1.14+ build command. This is using bwplotka/bingo-controlled, separate go module with pinned dependencies. diff --git a/.bingo/golangci-lint.mod b/.bingo/golangci-lint.mod new file mode 100644 index 000000000..8104ff4ba --- /dev/null +++ b/.bingo/golangci-lint.mod @@ -0,0 +1,5 @@ +module _ // Auto generated by https://github.com/bwplotka/bingo. DO NOT EDIT + +go 1.22.5 + +require github.com/golangci/golangci-lint v1.63.4 // cmd/golangci-lint diff --git a/.bingo/golangci-lint.sum b/.bingo/golangci-lint.sum new file mode 100644 index 000000000..bcc2ba2df --- /dev/null +++ b/.bingo/golangci-lint.sum @@ -0,0 +1,1071 @@ +4d63.com/gocheckcompilerdirectives v1.2.1 h1:AHcMYuw56NPjq/2y615IGg2kYkBdTvOaojYCBcRE7MA= +4d63.com/gocheckcompilerdirectives v1.2.1/go.mod h1:yjDJSxmDTtIHHCqX0ufRYZDL6vQtMG7tJdKVeWwsqvs= +4d63.com/gochecknoglobals v0.2.1 h1:1eiorGsgHOFOuoOiJDy2psSrQbRdIHrlge0IJIkUgDc= +4d63.com/gochecknoglobals v0.2.1/go.mod h1:KRE8wtJB3CXCsb1xy421JfTHIIbmT3U5ruxw2Qu8fSU= +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= +cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= +cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= +cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= +cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= +cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= +cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= +cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= +cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= +cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= +cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= +cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= +cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= +cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +github.com/4meepo/tagalign v1.3.4 h1:P51VcvBnf04YkHzjfclN6BbsopfJR5rxs1n+5zHt+w8= +github.com/4meepo/tagalign v1.3.4/go.mod h1:M+pnkHH2vG8+qhE5bVc/zeP7HS/j910Fwa9TUSyZVI0= +github.com/4meepo/tagalign v1.4.1 h1:GYTu2FaPGOGb/xJalcqHeD4il5BiCywyEYZOA55P6J4= +github.com/4meepo/tagalign v1.4.1/go.mod h1:2H9Yu6sZ67hmuraFgfZkNcg5Py9Ch/Om9l2K/2W1qS4= +github.com/Abirdcfly/dupword v0.1.1 h1:Bsxe0fIw6OwBtXMIncaTxCLHYO5BB+3mcsR5E8VXloY= +github.com/Abirdcfly/dupword v0.1.1/go.mod h1:B49AcJdTYYkpd4HjgAcutNGG9HZ2JWwKunH9Y2BA6sM= +github.com/Abirdcfly/dupword v0.1.3 h1:9Pa1NuAsZvpFPi9Pqkd93I7LIYRURj+A//dFd5tgBeE= +github.com/Abirdcfly/dupword v0.1.3/go.mod h1:8VbB2t7e10KRNdwTVoxdBaxla6avbhGzb8sCTygUMhw= +github.com/Antonboom/errname v0.1.13 h1:JHICqsewj/fNckzrfVSe+T33svwQxmjC+1ntDsHOVvM= +github.com/Antonboom/errname v0.1.13/go.mod h1:uWyefRYRN54lBg6HseYCFhs6Qjcy41Y3Jl/dVhA87Ns= +github.com/Antonboom/errname v1.0.0 h1:oJOOWR07vS1kRusl6YRSlat7HFnb3mSfMl6sDMRoTBA= +github.com/Antonboom/errname v1.0.0/go.mod h1:gMOBFzK/vrTiXN9Oh+HFs+e6Ndl0eTFbtsRTSRdXyGI= +github.com/Antonboom/nilnil v0.1.9 h1:eKFMejSxPSA9eLSensFmjW2XTgTwJMjZ8hUHtV4s/SQ= +github.com/Antonboom/nilnil v0.1.9/go.mod h1:iGe2rYwCq5/Me1khrysB4nwI7swQvjclR8/YRPl5ihQ= +github.com/Antonboom/nilnil v1.0.1 h1:C3Tkm0KUxgfO4Duk3PM+ztPncTFlOf0b2qadmS0s4xs= +github.com/Antonboom/nilnil v1.0.1/go.mod h1:CH7pW2JsRNFgEh8B2UaPZTEPhCMuFowP/e8Udp9Nnb0= +github.com/Antonboom/testifylint v1.4.3 h1:ohMt6AHuHgttaQ1xb6SSnxCeK4/rnK7KKzbvs7DmEck= +github.com/Antonboom/testifylint v1.4.3/go.mod h1:+8Q9+AOLsz5ZiQiiYujJKs9mNz398+M6UgslP4qgJLA= +github.com/Antonboom/testifylint v1.5.2 h1:4s3Xhuv5AvdIgbd8wOOEeo0uZG7PbDKQyKY5lGoQazk= +github.com/Antonboom/testifylint v1.5.2/go.mod h1:vxy8VJ0bc6NavlYqjZfmp6EfqXMtBgQ4+mhCojwC1P8= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c h1:pxW6RcqyfI9/kWtOwnv/G+AzdKuy2ZrqINhenH4HyNs= +github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/Crocmagnon/fatcontext v0.5.2 h1:vhSEg8Gqng8awhPju2w7MKHqMlg4/NI+gSDHtR3xgwA= +github.com/Crocmagnon/fatcontext v0.5.2/go.mod h1:87XhRMaInHP44Q7Tlc7jkgKKB7kZAOPiDkFMdKCC+74= +github.com/Crocmagnon/fatcontext v0.5.3 h1:zCh/wjc9oyeF+Gmp+V60wetm8ph2tlsxocgg/J0hOps= +github.com/Crocmagnon/fatcontext v0.5.3/go.mod h1:XoCQYY1J+XTfyv74qLXvNw4xFunr3L1wkopIIKG7wGM= +github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 h1:sHglBQTwgx+rWPdisA5ynNEsoARbiCBOyGcJM4/OzsM= +github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs= +github.com/GaijinEntertainment/go-exhaustruct/v3 v3.3.0 h1:/fTUt5vmbkAcMBt4YQiuC23cV0kEsN1MVMNqeOW43cU= +github.com/GaijinEntertainment/go-exhaustruct/v3 v3.3.0/go.mod h1:ONJg5sxcbsdQQ4pOW8TGdTidT2TMAUy/2Xhr8mrYaao= +github.com/Masterminds/semver/v3 v3.3.0 h1:B8LGeaivUe71a5qox1ICM/JLl0NqZSW5CHyL+hmvYS0= +github.com/Masterminds/semver/v3 v3.3.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM= +github.com/OpenPeeDeeP/depguard/v2 v2.2.0 h1:vDfG60vDtIuf0MEOhmLlLLSzqaRM8EMcgJPdp74zmpA= +github.com/OpenPeeDeeP/depguard/v2 v2.2.0/go.mod h1:CIzddKRvLBC4Au5aYP/i3nyaWQ+ClszLIuVocRiCYFQ= +github.com/alecthomas/go-check-sumtype v0.1.4 h1:WCvlB3l5Vq5dZQTFmodqL2g68uHiSwwlWcT5a2FGK0c= +github.com/alecthomas/go-check-sumtype v0.1.4/go.mod h1:WyYPfhfkdhyrdaligV6svFopZV8Lqdzn5pyVBaV6jhQ= +github.com/alecthomas/go-check-sumtype v0.3.1 h1:u9aUvbGINJxLVXiFvHUlPEaD7VDULsrxJb4Aq31NLkU= +github.com/alecthomas/go-check-sumtype v0.3.1/go.mod h1:A8TSiN3UPRw3laIgWEUOHHLPa6/r9MtoigdlP5h3K/E= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= +github.com/alexkohler/nakedret/v2 v2.0.4 h1:yZuKmjqGi0pSmjGpOC016LtPJysIL0WEUiaXW5SUnNg= +github.com/alexkohler/nakedret/v2 v2.0.4/go.mod h1:bF5i0zF2Wo2o4X4USt9ntUWve6JbFv02Ff4vlkmS/VU= +github.com/alexkohler/nakedret/v2 v2.0.5 h1:fP5qLgtwbx9EJE8dGEERT02YwS8En4r9nnZ71RK+EVU= +github.com/alexkohler/nakedret/v2 v2.0.5/go.mod h1:bF5i0zF2Wo2o4X4USt9ntUWve6JbFv02Ff4vlkmS/VU= +github.com/alexkohler/prealloc v1.0.0 h1:Hbq0/3fJPQhNkN0dR95AVrr6R7tou91y0uHG5pOcUuw= +github.com/alexkohler/prealloc v1.0.0/go.mod h1:VetnK3dIgFBBKmg0YnD9F9x6Icjd+9cvfHR56wJVlKE= +github.com/alingse/asasalint v0.0.11 h1:SFwnQXJ49Kx/1GghOFz1XGqHYKp21Kq1nHad/0WQRnw= +github.com/alingse/asasalint v0.0.11/go.mod h1:nCaoMhw7a9kSJObvQyVzNTPBDbNpdocqrSP7t/cW5+I= +github.com/alingse/nilnesserr v0.1.1 h1:7cYuJewpy9jFNMEA72Q1+3Nm3zKHzg+Q28D5f2bBFUA= +github.com/alingse/nilnesserr v0.1.1/go.mod h1:1xJPrXonEtX7wyTq8Dytns5P2hNzoWymVUIaKm4HNFg= +github.com/ashanbrown/forbidigo v1.6.0 h1:D3aewfM37Yb3pxHujIPSpTf6oQk9sc9WZi8gerOIVIY= +github.com/ashanbrown/forbidigo v1.6.0/go.mod h1:Y8j9jy9ZYAEHXdu723cUlraTqbzjKF1MUyfOKL+AjcU= +github.com/ashanbrown/makezero v1.1.1 h1:iCQ87C0V0vSyO+M9E/FZYbu65auqH0lnsOkf5FcB28s= +github.com/ashanbrown/makezero v1.1.1/go.mod h1:i1bJLCRSCHOcOa9Y6MyF2FTfMZMFdHvxKHxgO5Z1axI= +github.com/ashanbrown/makezero v1.2.0 h1:/2Lp1bypdmK9wDIq7uWBlDF1iMUpIIS4A+pF6C9IEUU= +github.com/ashanbrown/makezero v1.2.0/go.mod h1:dxlPhHbDMC6N6xICzFBSK+4njQDdK8euNO0qjQMtGY4= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/bkielbasa/cyclop v1.2.1 h1:AeF71HZDob1P2/pRm1so9cd1alZnrpyc4q2uP2l0gJY= +github.com/bkielbasa/cyclop v1.2.1/go.mod h1:K/dT/M0FPAiYjBgQGau7tz+3TMh4FWAEqlMhzFWCrgM= +github.com/bkielbasa/cyclop v1.2.3 h1:faIVMIGDIANuGPWH031CZJTi2ymOQBULs9H21HSMa5w= +github.com/bkielbasa/cyclop v1.2.3/go.mod h1:kHTwA9Q0uZqOADdupvcFJQtp/ksSnytRMe8ztxG8Fuo= +github.com/blizzy78/varnamelen v0.8.0 h1:oqSblyuQvFsW1hbBHh1zfwrKe3kcSj0rnXkKzsQ089M= +github.com/blizzy78/varnamelen v0.8.0/go.mod h1:V9TzQZ4fLJ1DSrjVDfl89H7aMnTvKkApdHeyESmyR7k= +github.com/bombsimon/wsl/v4 v4.4.1 h1:jfUaCkN+aUpobrMO24zwyAMwMAV5eSziCkOKEauOLdw= +github.com/bombsimon/wsl/v4 v4.4.1/go.mod h1:Xu/kDxGZTofQcDGCtQe9KCzhHphIe0fDuyWTxER9Feo= +github.com/bombsimon/wsl/v4 v4.5.0 h1:iZRsEvDdyhd2La0FVi5k6tYehpOR/R7qIUjmKk7N74A= +github.com/bombsimon/wsl/v4 v4.5.0/go.mod h1:NOQ3aLF4nD7N5YPXMruR6ZXDOAqLoM0GEpLwTdvmOSc= +github.com/breml/bidichk v0.2.7 h1:dAkKQPLl/Qrk7hnP6P+E0xOodrq8Us7+U0o4UBOAlQY= +github.com/breml/bidichk v0.2.7/go.mod h1:YodjipAGI9fGcYM7II6wFvGhdMYsC5pHDlGzqvEW3tQ= +github.com/breml/bidichk v0.3.2 h1:xV4flJ9V5xWTqxL+/PMFF6dtJPvZLPsyixAoPe8BGJs= +github.com/breml/bidichk v0.3.2/go.mod h1:VzFLBxuYtT23z5+iVkamXO386OB+/sVwZOpIj6zXGos= +github.com/breml/errchkjson v0.3.6 h1:VLhVkqSBH96AvXEyclMR37rZslRrY2kcyq+31HCsVrA= +github.com/breml/errchkjson v0.3.6/go.mod h1:jhSDoFheAF2RSDOlCfhHO9KqhZgAYLyvHe7bRCX8f/U= +github.com/breml/errchkjson v0.4.0 h1:gftf6uWZMtIa/Is3XJgibewBm2ksAQSY/kABDNFTAdk= +github.com/breml/errchkjson v0.4.0/go.mod h1:AuBOSTHyLSaaAFlWsRSuRBIroCh3eh7ZHh5YeelDIk8= +github.com/butuzov/ireturn v0.3.0 h1:hTjMqWw3y5JC3kpnC5vXmFJAWI/m31jaCYQqzkS6PL0= +github.com/butuzov/ireturn v0.3.0/go.mod h1:A09nIiwiqzN/IoVo9ogpa0Hzi9fex1kd9PSD6edP5ZA= +github.com/butuzov/ireturn v0.3.1 h1:mFgbEI6m+9W8oP/oDdfA34dLisRFCj2G6o/yiI1yZrY= +github.com/butuzov/ireturn v0.3.1/go.mod h1:ZfRp+E7eJLC0NQmk1Nrm1LOrn/gQlOykv+cVPdiXH5M= +github.com/butuzov/mirror v1.2.0 h1:9YVK1qIjNspaqWutSv8gsge2e/Xpq1eqEkslEUHy5cs= +github.com/butuzov/mirror v1.2.0/go.mod h1:DqZZDtzm42wIAIyHXeN8W/qb1EPlb9Qn/if9icBOpdQ= +github.com/butuzov/mirror v1.3.0 h1:HdWCXzmwlQHdVhwvsfBb2Au0r3HyINry3bDWLYXiKoc= +github.com/butuzov/mirror v1.3.0/go.mod h1:AEij0Z8YMALaq4yQj9CPPVYOyJQyiexpQEQgihajRfI= +github.com/catenacyber/perfsprint v0.7.1 h1:PGW5G/Kxn+YrN04cRAZKC+ZuvlVwolYMrIyyTJ/rMmc= +github.com/catenacyber/perfsprint v0.7.1/go.mod h1:/wclWYompEyjUD2FuIIDVKNkqz7IgBIWXIH3V0Zol50= +github.com/ccojocar/zxcvbn-go v1.0.2 h1:na/czXU8RrhXO4EZme6eQJLR4PzcGsahsBOAwU6I3Vg= +github.com/ccojocar/zxcvbn-go v1.0.2/go.mod h1:g1qkXtUSvHP8lhHp5GrSmTz6uWALGRMQdw6Qnz/hi60= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= +github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/charithe/durationcheck v0.0.10 h1:wgw73BiocdBDQPik+zcEoBG/ob8uyBHf2iyoHGPf5w4= +github.com/charithe/durationcheck v0.0.10/go.mod h1:bCWXb7gYRysD1CU3C+u4ceO49LoGOY1C1L6uouGNreQ= +github.com/chavacava/garif v0.1.0 h1:2JHa3hbYf5D9dsgseMKAmc/MZ109otzgNFk5s87H9Pc= +github.com/chavacava/garif v0.1.0/go.mod h1:XMyYCkEL58DF0oyW4qDjjnPWONs2HBqYKI+UIPD+Gww= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/ckaznocha/intrange v0.2.0 h1:FykcZuJ8BD7oX93YbO1UY9oZtkRbp+1/kJcDjkefYLs= +github.com/ckaznocha/intrange v0.2.0/go.mod h1:r5I7nUlAAG56xmkOpw4XVr16BXhwYTUdcuRFeevn1oE= +github.com/ckaznocha/intrange v0.3.0 h1:VqnxtK32pxgkhJgYQEeOArVidIPg+ahLP7WBOXZd5ZY= +github.com/ckaznocha/intrange v0.3.0/go.mod h1:+I/o2d2A1FBHgGELbGxzIcyd3/9l9DuwjM8FsbSS3Lo= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/curioswitch/go-reassign v0.2.0 h1:G9UZyOcpk/d7Gd6mqYgd8XYWFMw/znxwGDUstnC9DIo= +github.com/curioswitch/go-reassign v0.2.0/go.mod h1:x6OpXuWvgfQaMGks2BZybTngWjT84hqJfKoO8Tt/Roc= +github.com/curioswitch/go-reassign v0.3.0 h1:dh3kpQHuADL3cobV/sSGETA8DOv457dwl+fbBAhrQPs= +github.com/curioswitch/go-reassign v0.3.0/go.mod h1:nApPCCTtqLJN/s8HfItCcKV0jIPwluBOvZP+dsJGA88= +github.com/daixiang0/gci v0.13.5 h1:kThgmH1yBmZSBCh1EJVxQ7JsHpm5Oms0AMed/0LaH4c= +github.com/daixiang0/gci v0.13.5/go.mod h1:12etP2OniiIdP4q+kjUGrC/rUagga7ODbqsom5Eo5Yk= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/denis-tingaikin/go-header v0.5.0 h1:SRdnP5ZKvcO9KKRP1KJrhFR3RrlGuD+42t4429eC9k8= +github.com/denis-tingaikin/go-header v0.5.0/go.mod h1:mMenU5bWrok6Wl2UsZjy+1okegmwQ3UgWl4V1D8gjlY= +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= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/ettle/strcase v0.2.0 h1:fGNiVF21fHXpX1niBgk0aROov1LagYsOwV/xqKDKR/Q= +github.com/ettle/strcase v0.2.0/go.mod h1:DajmHElDSaX76ITe3/VHVyMin4LWSJN5Z909Wp+ED1A= +github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4= +github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI= +github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= +github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU= +github.com/fatih/structtag v1.2.0 h1:/OdNE99OxoI/PqaW/SuSK9uxxT3f/tcSZgon/ssNSx4= +github.com/fatih/structtag v1.2.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4/aAZl94= +github.com/firefart/nonamedreturns v1.0.5 h1:tM+Me2ZaXs8tfdDw3X6DOX++wMCOqzYUho6tUTYIdRA= +github.com/firefart/nonamedreturns v1.0.5/go.mod h1:gHJjDqhGM4WyPt639SOZs+G89Ko7QKH5R5BhnO6xJhw= +github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI= +github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= +github.com/fzipp/gocyclo v0.6.0 h1:lsblElZG7d3ALtGMx9fmxeTKZaLLpU8mET09yN4BBLo= +github.com/fzipp/gocyclo v0.6.0/go.mod h1:rXPyn8fnlpa0R2csP/31uerbiVBugk5whMdlyaLkLoA= +github.com/ghostiam/protogetter v0.3.6 h1:R7qEWaSgFCsy20yYHNIJsU9ZOb8TziSRRxuAOTVKeOk= +github.com/ghostiam/protogetter v0.3.6/go.mod h1:7lpeDnEJ1ZjL/YtyoN99ljO4z0pd3H0d18/t2dPBxHw= +github.com/ghostiam/protogetter v0.3.8 h1:LYcXbYvybUyTIxN2Mj9h6rHrDZBDwZloPoKctWrFyJY= +github.com/ghostiam/protogetter v0.3.8/go.mod h1:WZ0nw9pfzsgxuRsPOFQomgDVSWtDLJRfQJEhsGbmQMA= +github.com/go-critic/go-critic v0.11.4 h1:O7kGOCx0NDIni4czrkRIXTnit0mkyKOCePh3My6OyEU= +github.com/go-critic/go-critic v0.11.4/go.mod h1:2QAdo4iuLik5S9YG0rT4wcZ8QxwHYkrr6/2MWAiv/vc= +github.com/go-critic/go-critic v0.11.5 h1:TkDTOn5v7EEngMxu8KbuFqFR43USaaH8XRJLz1jhVYA= +github.com/go-critic/go-critic v0.11.5/go.mod h1:wu6U7ny9PiaHaZHcvMDmdysMqvDem162Rh3zWTrqk8M= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-toolsmith/astcast v1.1.0 h1:+JN9xZV1A+Re+95pgnMgDboWNVnIMMQXwfBwLRPgSC8= +github.com/go-toolsmith/astcast v1.1.0/go.mod h1:qdcuFWeGGS2xX5bLM/c3U9lewg7+Zu4mr+xPwZIB4ZU= +github.com/go-toolsmith/astcopy v1.1.0 h1:YGwBN0WM+ekI/6SS6+52zLDEf8Yvp3n2seZITCUBt5s= +github.com/go-toolsmith/astcopy v1.1.0/go.mod h1:hXM6gan18VA1T/daUEHCFcYiW8Ai1tIwIzHY6srfEAw= +github.com/go-toolsmith/astequal v1.0.3/go.mod h1:9Ai4UglvtR+4up+bAD4+hCj7iTo4m/OXVTSLnCyTAx4= +github.com/go-toolsmith/astequal v1.1.0/go.mod h1:sedf7VIdCL22LD8qIvv7Nn9MuWJruQA/ysswh64lffQ= +github.com/go-toolsmith/astequal v1.2.0 h1:3Fs3CYZ1k9Vo4FzFhwwewC3CHISHDnVUPC4x0bI2+Cw= +github.com/go-toolsmith/astequal v1.2.0/go.mod h1:c8NZ3+kSFtFY/8lPso4v8LuJjdJiUFVnSuU3s0qrrDY= +github.com/go-toolsmith/astfmt v1.1.0 h1:iJVPDPp6/7AaeLJEruMsBUlOYCmvg0MoCfJprsOmcco= +github.com/go-toolsmith/astfmt v1.1.0/go.mod h1:OrcLlRwu0CuiIBp/8b5PYF9ktGVZUjlNMV634mhwuQ4= +github.com/go-toolsmith/astp v1.1.0 h1:dXPuCl6u2llURjdPLLDxJeZInAeZ0/eZwFJmqZMnpQA= +github.com/go-toolsmith/astp v1.1.0/go.mod h1:0T1xFGz9hicKs8Z5MfAqSUitoUYS30pDMsRVIDHs8CA= +github.com/go-toolsmith/strparse v1.0.0/go.mod h1:YI2nUKP9YGZnL/L1/DLFBfixrcjslWct4wyljWhSRy8= +github.com/go-toolsmith/strparse v1.1.0 h1:GAioeZUK9TGxnLS+qfdqNbA4z0SSm5zVNtCQiyP2Bvw= +github.com/go-toolsmith/strparse v1.1.0/go.mod h1:7ksGy58fsaQkGQlY8WVoBFNyEPMGuJin1rfoPS4lBSQ= +github.com/go-toolsmith/typep v1.1.0 h1:fIRYDyF+JywLfqzyhdiHzRop/GQDxxNhLGQ6gFUNHus= +github.com/go-toolsmith/typep v1.1.0/go.mod h1:fVIw+7zjdsMxDA3ITWnH1yOiw1rnTQKCsF/sk2H/qig= +github.com/go-viper/mapstructure/v2 v2.1.0 h1:gHnMa2Y/pIxElCH2GlZZ1lZSsn6XMtufpGyP1XxdC/w= +github.com/go-viper/mapstructure/v2 v2.1.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +github.com/go-viper/mapstructure/v2 v2.2.1 h1:ZAaOCxANMuZx5RCeg0mBdEZk7DZasvvZIxtHqx8aGss= +github.com/go-viper/mapstructure/v2 v2.2.1/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +github.com/go-xmlfmt/xmlfmt v1.1.2 h1:Nea7b4icn8s57fTx1M5AI4qQT5HEM3rVUO8MuE6g80U= +github.com/go-xmlfmt/xmlfmt v1.1.2/go.mod h1:aUCEOzzezBEjDBbFBoSiya/gduyIiWYRP6CnSFIV8AM= +github.com/go-xmlfmt/xmlfmt v1.1.3 h1:t8Ey3Uy7jDSEisW2K3somuMKIpzktkWptA0iFCnRUWY= +github.com/go-xmlfmt/xmlfmt v1.1.3/go.mod h1:aUCEOzzezBEjDBbFBoSiya/gduyIiWYRP6CnSFIV8AM= +github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= +github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= +github.com/gofrs/flock v0.12.1 h1:MTLVXXHf8ekldpJk3AKicLij9MdwOWkZ+a/jHHZby9E= +github.com/gofrs/flock v0.12.1/go.mod h1:9zxTsyu5xtJ9DK+1tFZyibEV7y3uwDxPPfbxeeHCoD0= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a h1:w8hkcTqaFpzKqonE9uMCefW1WDie15eSP/4MssdenaM= +github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a/go.mod h1:ryS0uhF+x9jgbj/N71xsEqODy9BN81/GonCZiOzirOk= +github.com/golangci/go-printf-func-name v0.1.0 h1:dVokQP+NMTO7jwO4bwsRwLWeudOVUPPyAKJuzv8pEJU= +github.com/golangci/go-printf-func-name v0.1.0/go.mod h1:wqhWFH5mUdJQhweRnldEywnR5021wTdZSNgwYceV14s= +github.com/golangci/gofmt v0.0.0-20240816233607-d8596aa466a9 h1:/1322Qns6BtQxUZDTAT4SdcoxknUki7IAoK4SAXr8ME= +github.com/golangci/gofmt v0.0.0-20240816233607-d8596aa466a9/go.mod h1:Oesb/0uFAyWoaw1U1qS5zyjCg5NP9C9iwjnI4tIsXEE= +github.com/golangci/gofmt v0.0.0-20241223200906-057b0627d9b9 h1:t5wybL6RtO83VwoMOb7U/Peqe3gGKQlPIC66wXmnkvM= +github.com/golangci/gofmt v0.0.0-20241223200906-057b0627d9b9/go.mod h1:Ag3L7sh7E28qAp/5xnpMMTuGYqxLZoSaEHZDkZB1RgU= +github.com/golangci/golangci-lint v1.61.0 h1:VvbOLaRVWmyxCnUIMTbf1kDsaJbTzH20FAMXTAlQGu8= +github.com/golangci/golangci-lint v1.61.0/go.mod h1:e4lztIrJJgLPhWvFPDkhiMwEFRrWlmFbrZea3FsJyN8= +github.com/golangci/golangci-lint v1.63.4 h1:bJQFQ3hSfUto597dkL7ipDzOxsGEpiWdLiZ359OWOBI= +github.com/golangci/golangci-lint v1.63.4/go.mod h1:Hx0B7Lg5/NXbaOHem8+KU+ZUIzMI6zNj/7tFwdnn10I= +github.com/golangci/misspell v0.6.0 h1:JCle2HUTNWirNlDIAUO44hUsKhOFqGPoC4LZxlaSXDs= +github.com/golangci/misspell v0.6.0/go.mod h1:keMNyY6R9isGaSAu+4Q8NMBwMPkh15Gtc8UCVoDtAWo= +github.com/golangci/modinfo v0.3.4 h1:oU5huX3fbxqQXdfspamej74DFX0kyGLkw1ppvXoJ8GA= +github.com/golangci/modinfo v0.3.4/go.mod h1:wytF1M5xl9u0ij8YSvhkEVPP3M5Mc7XLl1pxH3B2aUM= +github.com/golangci/plugin-module-register v0.1.1 h1:TCmesur25LnyJkpsVrupv1Cdzo+2f7zX0H6Jkw1Ol6c= +github.com/golangci/plugin-module-register v0.1.1/go.mod h1:TTpqoB6KkwOJMV8u7+NyXMrkwwESJLOkfl9TxR1DGFc= +github.com/golangci/revgrep v0.5.3 h1:3tL7c1XBMtWHHqVpS5ChmiAAoe4PF/d5+ULzV9sLAzs= +github.com/golangci/revgrep v0.5.3/go.mod h1:U4R/s9dlXZsg8uJmaR1GrloUr14D7qDl8gi2iPXJH8k= +github.com/golangci/unconvert v0.0.0-20240309020433-c5143eacb3ed h1:IURFTjxeTfNFP0hTEi1YKjB/ub8zkpaOqFFMApi2EAs= +github.com/golangci/unconvert v0.0.0-20240309020433-c5143eacb3ed/go.mod h1:XLXN8bNw4CGRPaqgl3bv/lhz7bsGPh4/xSaMTbo2vkQ= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/gordonklaus/ineffassign v0.1.0 h1:y2Gd/9I7MdY1oEIt+n+rowjBNDcLQq3RsH5hwJd0f9s= +github.com/gordonklaus/ineffassign v0.1.0/go.mod h1:Qcp2HIAYhR7mNUVSIxZww3Guk4it82ghYcEXIAk+QT0= +github.com/gostaticanalysis/analysisutil v0.7.1 h1:ZMCjoue3DtDWQ5WyU16YbjbQEQ3VuzwxALrpYd+HeKk= +github.com/gostaticanalysis/analysisutil v0.7.1/go.mod h1:v21E3hY37WKMGSnbsw2S/ojApNWb6C1//mXO48CXbVc= +github.com/gostaticanalysis/comment v1.4.1/go.mod h1:ih6ZxzTHLdadaiSnF5WY3dxUoXfXAlTaRzuaNDlSado= +github.com/gostaticanalysis/comment v1.4.2 h1:hlnx5+S2fY9Zo9ePo4AhgYsYHbM2+eAv8m/s1JiCd6Q= +github.com/gostaticanalysis/comment v1.4.2/go.mod h1:KLUTGDv6HOCotCH8h2erHKmpci2ZoR8VPu34YA2uzdM= +github.com/gostaticanalysis/forcetypeassert v0.1.0 h1:6eUflI3DiGusXGK6X7cCcIgVCpZ2CiZ1Q7jl6ZxNV70= +github.com/gostaticanalysis/forcetypeassert v0.1.0/go.mod h1:qZEedyP/sY1lTGV1uJ3VhWZ2mqag3IkWsDHVbplHXak= +github.com/gostaticanalysis/nilerr v0.1.1 h1:ThE+hJP0fEp4zWLkWHWcRyI2Od0p7DlgYG3Uqrmrcpk= +github.com/gostaticanalysis/nilerr v0.1.1/go.mod h1:wZYb6YI5YAxxq0i1+VJbY0s2YONW0HU0GPE3+5PWN4A= +github.com/gostaticanalysis/testutil v0.3.1-0.20210208050101-bfb5c8eec0e4/go.mod h1:D+FIZ+7OahH3ePw/izIEeH5I06eKs1IKI4Xr64/Am3M= +github.com/hashicorp/go-immutable-radix/v2 v2.1.0 h1:CUW5RYIcysz+D3B+l1mDeXrQ7fUvGGCwJfdASSzbrfo= +github.com/hashicorp/go-immutable-radix/v2 v2.1.0/go.mod h1:hgdqLXA4f6NIjRVisM1TJ9aOJVNRqKZj+xDGF6m7PBw= +github.com/hashicorp/go-version v1.2.1/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY= +github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= +github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= +github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= +github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= +github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= +github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/jgautheron/goconst v1.7.1 h1:VpdAG7Ca7yvvJk5n8dMwQhfEZJh95kl/Hl9S1OI5Jkk= +github.com/jgautheron/goconst v1.7.1/go.mod h1:aAosetZ5zaeC/2EfMeRswtxUFBpe2Hr7HzkgX4fanO4= +github.com/jingyugao/rowserrcheck v1.1.1 h1:zibz55j/MJtLsjP1OF4bSdgXxwL1b+Vn7Tjzq7gFzUs= +github.com/jingyugao/rowserrcheck v1.1.1/go.mod h1:4yvlZSDb3IyDTUZJUmpZfm2Hwok+Dtp+nu2qOq+er9c= +github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af h1:KA9BjwUk7KlCh6S9EAGWBt1oExIUv9WyNCiRz5amv48= +github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af/go.mod h1:HEWGJkRDzjJY2sqdDwxccsGicWEf9BQOZsq2tV+xzM0= +github.com/jjti/go-spancheck v0.6.2 h1:iYtoxqPMzHUPp7St+5yA8+cONdyXD3ug6KK15n7Pklk= +github.com/jjti/go-spancheck v0.6.2/go.mod h1:+X7lvIrR5ZdUTkxFYqzJ0abr8Sb5LOo80uOhWNqIrYA= +github.com/jjti/go-spancheck v0.6.4 h1:Tl7gQpYf4/TMU7AT84MN83/6PutY21Nb9fuQjFTpRRc= +github.com/jjti/go-spancheck v0.6.4/go.mod h1:yAEYdKJ2lRkDA8g7X+oKUHXOWVAXSBJRv04OhF+QUjk= +github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +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/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= +github.com/julz/importas v0.1.0 h1:F78HnrsjY3cR7j0etXy5+TU1Zuy7Xt08X/1aJnH5xXY= +github.com/julz/importas v0.1.0/go.mod h1:oSFU2R4XK/P7kNBrnL/FEQlDGN1/6WoxXEjSSXO0DV0= +github.com/julz/importas v0.2.0 h1:y+MJN/UdL63QbFJHws9BVC5RpA2iq0kpjrFajTGivjQ= +github.com/julz/importas v0.2.0/go.mod h1:pThlt589EnCYtMnmhmRYY/qn9lCf/frPOK+WMx3xiJY= +github.com/karamaru-alpha/copyloopvar v1.1.0 h1:x7gNyKcC2vRBO1H2Mks5u1VxQtYvFiym7fCjIP8RPos= +github.com/karamaru-alpha/copyloopvar v1.1.0/go.mod h1:u7CIfztblY0jZLOQZgH3oYsJzpC2A7S6u/lfgSXHy0k= +github.com/kisielk/errcheck v1.7.0 h1:+SbscKmWJ5mOK/bO1zS60F5I9WwZDWOfRsC4RwfwRV0= +github.com/kisielk/errcheck v1.7.0/go.mod h1:1kLL+jV4e+CFfueBmI1dSK2ADDyQnlrnrY/FqKluHJQ= +github.com/kisielk/errcheck v1.8.0 h1:ZX/URYa7ilESY19ik/vBmCn6zdGQLxACwjAcWbHlYlg= +github.com/kisielk/errcheck v1.8.0/go.mod h1:1kLL+jV4e+CFfueBmI1dSK2ADDyQnlrnrY/FqKluHJQ= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/kkHAIKE/contextcheck v1.1.5 h1:CdnJh63tcDe53vG+RebdpdXJTc9atMgGqdx8LXxiilg= +github.com/kkHAIKE/contextcheck v1.1.5/go.mod h1:O930cpht4xb1YQpK+1+AgoM3mFsvxr7uyFptcnWTYUA= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +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/kulti/thelper v0.6.3 h1:ElhKf+AlItIu+xGnI990no4cE2+XaSu1ULymV2Yulxs= +github.com/kulti/thelper v0.6.3/go.mod h1:DsqKShOvP40epevkFrvIwkCMNYxMeTNjdWL4dqWHZ6I= +github.com/kunwardeep/paralleltest v1.0.10 h1:wrodoaKYzS2mdNVnc4/w31YaXFtsc21PCTdvWJ/lDDs= +github.com/kunwardeep/paralleltest v1.0.10/go.mod h1:2C7s65hONVqY7Q5Efj5aLzRCNLjw2h4eMc9EcypGjcY= +github.com/kyoh86/exportloopref v0.1.11 h1:1Z0bcmTypkL3Q4k+IDHMWTcnCliEZcaPiIe0/ymEyhQ= +github.com/kyoh86/exportloopref v0.1.11/go.mod h1:qkV4UF1zGl6EkF1ox8L5t9SwyeBAZ3qLMd6up458uqA= +github.com/lasiar/canonicalheader v1.1.1 h1:wC+dY9ZfiqiPwAexUApFush/csSPXeIi4QqyxXmng8I= +github.com/lasiar/canonicalheader v1.1.1/go.mod h1:cXkb3Dlk6XXy+8MVQnF23CYKWlyA7kfQhSw2CcZtZb0= +github.com/lasiar/canonicalheader v1.1.2 h1:vZ5uqwvDbyJCnMhmFYimgMZnJMjwljN5VGY0VKbMXb4= +github.com/lasiar/canonicalheader v1.1.2/go.mod h1:qJCeLFS0G/QlLQ506T+Fk/fWMa2VmBUiEI2cuMK4djI= +github.com/ldez/exptostd v0.3.1 h1:90yWWoAKMFHeovTK8uzBms9Ppp8Du/xQ20DRO26Ymrw= +github.com/ldez/exptostd v0.3.1/go.mod h1:iZBRYaUmcW5jwCR3KROEZ1KivQQp6PHXbDPk9hqJKCQ= +github.com/ldez/gomoddirectives v0.2.4 h1:j3YjBIjEBbqZ0NKtBNzr8rtMHTOrLPeiwTkfUJZ3alg= +github.com/ldez/gomoddirectives v0.2.4/go.mod h1:oWu9i62VcQDYp9EQ0ONTfqLNh+mDLWWDO+SO0qSQw5g= +github.com/ldez/gomoddirectives v0.6.0 h1:Jyf1ZdTeiIB4dd+2n4qw+g4aI9IJ6JyfOZ8BityWvnA= +github.com/ldez/gomoddirectives v0.6.0/go.mod h1:TuwOGYoPAoENDWQpe8DMqEm5nIfjrxZXmxX/CExWyZ4= +github.com/ldez/grignotin v0.7.0 h1:vh0dI32WhHaq6LLPZ38g7WxXuZ1+RzyrJ7iPG9JMa8c= +github.com/ldez/grignotin v0.7.0/go.mod h1:uaVTr0SoZ1KBii33c47O1M8Jp3OP3YDwhZCmzT9GHEk= +github.com/ldez/tagliatelle v0.5.0 h1:epgfuYt9v0CG3fms0pEgIMNPuFf/LpPIfjk4kyqSioo= +github.com/ldez/tagliatelle v0.5.0/go.mod h1:rj1HmWiL1MiKQuOONhd09iySTEkUuE/8+5jtPYz9xa4= +github.com/ldez/tagliatelle v0.7.1 h1:bTgKjjc2sQcsgPiT902+aadvMjCeMHrY7ly2XKFORIk= +github.com/ldez/tagliatelle v0.7.1/go.mod h1:3zjxUpsNB2aEZScWiZTHrAXOl1x25t3cRmzfK1mlo2I= +github.com/ldez/usetesting v0.4.2 h1:J2WwbrFGk3wx4cZwSMiCQQ00kjGR0+tuuyW0Lqm4lwA= +github.com/ldez/usetesting v0.4.2/go.mod h1:eEs46T3PpQ+9RgN9VjpY6qWdiw2/QmfiDeWmdZdrjIQ= +github.com/leonklingele/grouper v1.1.2 h1:o1ARBDLOmmasUaNDesWqWCIFH3u7hoFlM84YrjT3mIY= +github.com/leonklingele/grouper v1.1.2/go.mod h1:6D0M/HVkhs2yRKRFZUoGjeDy7EZTfFBE9gl4kjmIGkA= +github.com/lufeee/execinquery v1.2.1 h1:hf0Ems4SHcUGBxpGN7Jz78z1ppVkP/837ZlETPCEtOM= +github.com/lufeee/execinquery v1.2.1/go.mod h1:EC7DrEKView09ocscGHC+apXMIaorh4xqSxS/dy8SbM= +github.com/macabu/inamedparam v0.1.3 h1:2tk/phHkMlEL/1GNe/Yf6kkR/hkcUdAEY3L0hjYV1Mk= +github.com/macabu/inamedparam v0.1.3/go.mod h1:93FLICAIk/quk7eaPPQvbzihUdn/QkGDwIZEoLtpH6I= +github.com/magiconair/properties v1.8.6 h1:5ibWZ6iY0NctNGWo87LalDlEZ6R41TqbbDamhfG/Qzo= +github.com/magiconair/properties v1.8.6/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= +github.com/maratori/testableexamples v1.0.0 h1:dU5alXRrD8WKSjOUnmJZuzdxWOEQ57+7s93SLMxb2vI= +github.com/maratori/testableexamples v1.0.0/go.mod h1:4rhjL1n20TUTT4vdh3RDqSizKLyXp7K2u6HgraZCGzE= +github.com/maratori/testpackage v1.1.1 h1:S58XVV5AD7HADMmD0fNnziNHqKvSdDuEKdPD1rNTU04= +github.com/maratori/testpackage v1.1.1/go.mod h1:s4gRK/ym6AMrqpOa/kEbQTV4Q4jb7WeLZzVhVVVOQMc= +github.com/matoous/godox v0.0.0-20230222163458-006bad1f9d26 h1:gWg6ZQ4JhDfJPqlo2srm/LN17lpybq15AryXIRcWYLE= +github.com/matoous/godox v0.0.0-20230222163458-006bad1f9d26/go.mod h1:1BELzlh859Sh1c6+90blK8lbYy0kwQf1bYlBhBysy1s= +github.com/matryer/is v1.4.0/go.mod h1:8I/i5uYgLzgsgEloJE1U6xx5HkBQpAZvepWuujKwMRU= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= +github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= +github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc= +github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/mgechev/revive v1.3.9 h1:18Y3R4a2USSBF+QZKFQwVkBROUda7uoBlkEuBD+YD1A= +github.com/mgechev/revive v1.3.9/go.mod h1:+uxEIr5UH0TjXWHTno3xh4u7eg6jDpXKzQccA9UGhHU= +github.com/mgechev/revive v1.5.1 h1:hE+QPeq0/wIzJwOphdVyUJ82njdd8Khp4fUIHGZHW3M= +github.com/mgechev/revive v1.5.1/go.mod h1:lC9AhkJIBs5zwx8wkudyHrU+IJkrEKmpCmGMnIJPk4o= +github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= +github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= +github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/moricho/tparallel v0.3.2 h1:odr8aZVFA3NZrNybggMkYO3rgPRcqjeQUlBBFVxKHTI= +github.com/moricho/tparallel v0.3.2/go.mod h1:OQ+K3b4Ln3l2TZveGCywybl68glfLEwFGqvnjok8b+U= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/nakabonne/nestif v0.3.1 h1:wm28nZjhQY5HyYPx+weN3Q65k6ilSBxDb8v5S81B81U= +github.com/nakabonne/nestif v0.3.1/go.mod h1:9EtoZochLn5iUprVDmDjqGKPofoUEBL8U4Ngq6aY7OE= +github.com/nishanths/exhaustive v0.12.0 h1:vIY9sALmw6T/yxiASewa4TQcFsVYZQQRUQJhKRf3Swg= +github.com/nishanths/exhaustive v0.12.0/go.mod h1:mEZ95wPIZW+x8kC4TgC+9YCUgiST7ecevsVDTgc2obs= +github.com/nishanths/predeclared v0.2.2 h1:V2EPdZPliZymNAn79T8RkNApBjMmVKh5XRpLm/w98Vk= +github.com/nishanths/predeclared v0.2.2/go.mod h1:RROzoN6TnGQupbC+lqggsOlcgysk3LMK/HI84Mp280c= +github.com/nunnatsa/ginkgolinter v0.16.2 h1:8iLqHIZvN4fTLDC0Ke9tbSZVcyVHoBs0HIbnVSxfHJk= +github.com/nunnatsa/ginkgolinter v0.16.2/go.mod h1:4tWRinDN1FeJgU+iJANW/kz7xKN5nYRAOfJDQUS9dOQ= +github.com/nunnatsa/ginkgolinter v0.18.4 h1:zmX4KUR+6fk/vhUFt8DOP6KwznekhkmVSzzVJve2vyM= +github.com/nunnatsa/ginkgolinter v0.18.4/go.mod h1:AMEane4QQ6JwFz5GgjI5xLUM9S/CylO+UyM97fN2iBI= +github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= +github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= +github.com/otiai10/copy v1.2.0/go.mod h1:rrF5dJ5F0t/EWSYODDu4j9/vEeYHMkc8jt0zJChqQWw= +github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJG+0mI8eUu6xqkFDYS2kb2saOteoSB3cE= +github.com/otiai10/curr v1.0.0/go.mod h1:LskTG5wDwr8Rs+nNQ+1LlxRjAtTZZjtJW4rMXl6j4vs= +github.com/otiai10/mint v1.3.0/go.mod h1:F5AjcsTsWUqX+Na9fpHb52P8pcRX2CI6A3ctIT91xUo= +github.com/otiai10/mint v1.3.1/go.mod h1:/yxELlJQ0ufhjUwhshSj+wFjZ78CnZ48/1wtmBH1OTc= +github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= +github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= +github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M= +github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/polyfloyd/go-errorlint v1.6.0 h1:tftWV9DE7txiFzPpztTAwyoRLKNj9gpVm2cg8/OwcYY= +github.com/polyfloyd/go-errorlint v1.6.0/go.mod h1:HR7u8wuP1kb1NeN1zqTd1ZMlqUKPPHF+Id4vIPvDqVw= +github.com/polyfloyd/go-errorlint v1.7.0 h1:Zp6lzCK4hpBDj8y8a237YK4EPrMXQWvOe3nGoH4pFrU= +github.com/polyfloyd/go-errorlint v1.7.0/go.mod h1:dGWKu85mGHnegQ2SWpEybFityCg3j7ZbwsVUxAOk9gY= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= +github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= +github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= +github.com/prometheus/client_golang v1.12.1 h1:ZiaPsmm9uiBeaSMRznKsCDNtPCS0T3JVDGF+06gjBzk= +github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= +github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= +github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= +github.com/prometheus/common v0.32.1 h1:hWIdL3N2HoUx3B8j3YN9mWor0qhY/NlEKZEaXxuIRh4= +github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= +github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/quasilyte/go-ruleguard v0.4.3-0.20240823090925-0fe6f58b47b1 h1:+Wl/0aFp0hpuHM3H//KMft64WQ1yX9LdJY64Qm/gFCo= +github.com/quasilyte/go-ruleguard v0.4.3-0.20240823090925-0fe6f58b47b1/go.mod h1:GJLgqsLeo4qgavUoL8JeGFNS7qcisx3awV/w9eWTmNI= +github.com/quasilyte/go-ruleguard/dsl v0.3.22 h1:wd8zkOhSNr+I+8Qeciml08ivDt1pSXe60+5DqOpCjPE= +github.com/quasilyte/go-ruleguard/dsl v0.3.22/go.mod h1:KeCP03KrjuSO0H1kTuZQCWlQPulDV6YMIXmpQss17rU= +github.com/quasilyte/gogrep v0.5.0 h1:eTKODPXbI8ffJMN+W2aE0+oL0z/nh8/5eNdiO34SOAo= +github.com/quasilyte/gogrep v0.5.0/go.mod h1:Cm9lpz9NZjEoL1tgZ2OgeUKPIxL1meE7eo60Z6Sk+Ng= +github.com/quasilyte/regex/syntax v0.0.0-20210819130434-b3f0c404a727 h1:TCg2WBOl980XxGFEZSS6KlBGIV0diGdySzxATTWoqaU= +github.com/quasilyte/regex/syntax v0.0.0-20210819130434-b3f0c404a727/go.mod h1:rlzQ04UMyJXu/aOvhd8qT+hvDrFpiwqp8MRXDY9szc0= +github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567 h1:M8mH9eK4OUR4lu7Gd+PU1fV2/qnDNfzT635KRSObncs= +github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567/go.mod h1:DWNGW8A4Y+GyBgPuaQJuWiy0XYftx4Xm/y5Jqk9I6VQ= +github.com/raeperd/recvcheck v0.2.0 h1:GnU+NsbiCqdC2XX5+vMZzP+jAJC5fht7rcVTAhX74UI= +github.com/raeperd/recvcheck v0.2.0/go.mod h1:n04eYkwIR0JbgD73wT8wL4JjPC3wm0nFtzBnWNocnYU= +github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= +github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= +github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/ryancurrah/gomodguard v1.3.5 h1:cShyguSwUEeC0jS7ylOiG/idnd1TpJ1LfHGpV3oJmPU= +github.com/ryancurrah/gomodguard v1.3.5/go.mod h1:MXlEPQRxgfPQa62O8wzK3Ozbkv9Rkqr+wKjSxTdsNJE= +github.com/ryanrolds/sqlclosecheck v0.5.1 h1:dibWW826u0P8jNLsLN+En7+RqWWTYrjCB9fJfSfdyCU= +github.com/ryanrolds/sqlclosecheck v0.5.1/go.mod h1:2g3dUjoS6AL4huFdv6wn55WpLIDjY7ZgUR4J8HOO/XQ= +github.com/sanposhiho/wastedassign/v2 v2.0.7 h1:J+6nrY4VW+gC9xFzUc+XjPD3g3wF3je/NsJFwFK7Uxc= +github.com/sanposhiho/wastedassign/v2 v2.0.7/go.mod h1:KyZ0MWTwxxBmfwn33zh3k1dmsbF2ud9pAAGfoLfjhtI= +github.com/sanposhiho/wastedassign/v2 v2.1.0 h1:crurBF7fJKIORrV85u9UUpePDYGWnwvv3+A96WvwXT0= +github.com/sanposhiho/wastedassign/v2 v2.1.0/go.mod h1:+oSmSC+9bQ+VUAxA66nBb0Z7N8CK7mscKTDYC6aIek4= +github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 h1:lZUw3E0/J3roVtGQ+SCrUrg3ON6NgVqpn3+iol9aGu4= +github.com/santhosh-tekuri/jsonschema/v5 v5.3.1/go.mod h1:uToXkOrWAZ6/Oc07xWQrPOhJotwFIyu2bBVN41fcDUY= +github.com/santhosh-tekuri/jsonschema/v6 v6.0.1 h1:PKK9DyHxif4LZo+uQSgXNqs0jj5+xZwwfKHgph2lxBw= +github.com/santhosh-tekuri/jsonschema/v6 v6.0.1/go.mod h1:JXeL+ps8p7/KNMjDQk3TCwPpBy0wYklyWTfbkIzdIFU= +github.com/sashamelentyev/interfacebloat v1.1.0 h1:xdRdJp0irL086OyW1H/RTZTr1h/tMEOsumirXcOJqAw= +github.com/sashamelentyev/interfacebloat v1.1.0/go.mod h1:+Y9yU5YdTkrNvoX0xHc84dxiN1iBi9+G8zZIhPVoNjQ= +github.com/sashamelentyev/usestdlibvars v1.27.0 h1:t/3jZpSXtRPRf2xr0m63i32ZrusyurIGT9E5wAvXQnI= +github.com/sashamelentyev/usestdlibvars v1.27.0/go.mod h1:9nl0jgOfHKWNFS43Ojw0i7aRoS4j6EBye3YBhmAIRF8= +github.com/sashamelentyev/usestdlibvars v1.28.0 h1:jZnudE2zKCtYlGzLVreNp5pmCdOxXUzwsMDBkR21cyQ= +github.com/sashamelentyev/usestdlibvars v1.28.0/go.mod h1:9nl0jgOfHKWNFS43Ojw0i7aRoS4j6EBye3YBhmAIRF8= +github.com/securego/gosec/v2 v2.21.2 h1:deZp5zmYf3TWwU7A7cR2+SolbTpZ3HQiwFqnzQyEl3M= +github.com/securego/gosec/v2 v2.21.2/go.mod h1:au33kg78rNseF5PwPnTWhuYBFf534bvJRvOrgZ/bFzU= +github.com/securego/gosec/v2 v2.21.4 h1:Le8MSj0PDmOnHJgUATjD96PaXRvCpKC+DGJvwyy0Mlk= +github.com/securego/gosec/v2 v2.21.4/go.mod h1:Jtb/MwRQfRxCXyCm1rfM1BEiiiTfUOdyzzAhlr6lUTA= +github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c h1:W65qqJCIOVP4jpqPQ0YvHYKwcMEMVWIzWC5iNQQfBTU= +github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c/go.mod h1:/PevMnwAxekIXwN8qQyfc5gl2NlkB3CQlkizAbOkeBs= +github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= +github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= +github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= +github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= +github.com/sivchari/containedctx v1.0.3 h1:x+etemjbsh2fB5ewm5FeLNi5bUjK0V8n0RB+Wwfd0XE= +github.com/sivchari/containedctx v1.0.3/go.mod h1:c1RDvCbnJLtH4lLcYD/GqwiBSSf4F5Qk0xld2rBqzJ4= +github.com/sivchari/tenv v1.10.0 h1:g/hzMA+dBCKqGXgW8AV/1xIWhAvDrx0zFKNR48NFMg0= +github.com/sivchari/tenv v1.10.0/go.mod h1:tdY24masnVoZFxYrHv/nD6Tc8FbkEtAQEEziXpyMgqY= +github.com/sivchari/tenv v1.12.1 h1:+E0QzjktdnExv/wwsnnyk4oqZBUfuh89YMQT1cyuvSY= +github.com/sivchari/tenv v1.12.1/go.mod h1:1LjSOUCc25snIr5n3DtGGrENhX3LuWefcplwVGC24mw= +github.com/sonatard/noctx v0.0.2 h1:L7Dz4De2zDQhW8S0t+KUjY0MAQJd6SgVwhzNIc4ok00= +github.com/sonatard/noctx v0.0.2/go.mod h1:kzFz+CzWSjQ2OzIm46uJZoXuBpa2+0y3T36U18dWqIo= +github.com/sonatard/noctx v0.1.0 h1:JjqOc2WN16ISWAjAk8M5ej0RfExEXtkEyExl2hLW+OM= +github.com/sonatard/noctx v0.1.0/go.mod h1:0RvBxqY8D4j9cTTTWE8ylt2vqj2EPI8fHmrxHdsaZ2c= +github.com/sourcegraph/go-diff v0.7.0 h1:9uLlrd5T46OXs5qpp8L/MTltk0zikUGi0sNNyCpA8G0= +github.com/sourcegraph/go-diff v0.7.0/go.mod h1:iBszgVvyxdc8SFZ7gm69go2KDdt3ag071iBaWPF6cjs= +github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8= +github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY= +github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= +github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= +github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= +github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= +github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= +github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.12.0 h1:CZ7eSOd3kZoaYDLbXnmzgQI5RlciuXBMA+18HwHRfZQ= +github.com/spf13/viper v1.12.0/go.mod h1:b6COn30jlNxbm/V2IqWiNWkJ+vZNiMNksliPCiuKtSI= +github.com/ssgreg/nlreturn/v2 v2.2.1 h1:X4XDI7jstt3ySqGU86YGAURbxw3oTDPK9sPEi6YEwQ0= +github.com/ssgreg/nlreturn/v2 v2.2.1/go.mod h1:E/iiPB78hV7Szg2YfRgyIrk1AD6JVMTRkkxBiELzh2I= +github.com/stbenjam/no-sprintf-host-port v0.1.1 h1:tYugd/yrm1O0dV+ThCbaKZh195Dfm07ysF0U6JQXczc= +github.com/stbenjam/no-sprintf-host-port v0.1.1/go.mod h1:TLhvtIvONRzdmkFiio4O8LHsN9N74I+PhRquPsxpL0I= +github.com/stbenjam/no-sprintf-host-port v0.2.0 h1:i8pxvGrt1+4G0czLr/WnmyH7zbZ8Bg8etvARQ1rpyl4= +github.com/stbenjam/no-sprintf-host-port v0.2.0/go.mod h1:eL0bQ9PasS0hsyTyfTjjG+E80QIyPnBVQbYZyv20Jfk= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= +github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/subosito/gotenv v1.4.1 h1:jyEFiXpy21Wm81FBN71l9VoMMV8H8jG+qIK3GCpY6Qs= +github.com/subosito/gotenv v1.4.1/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0= +github.com/tdakkota/asciicheck v0.2.0 h1:o8jvnUANo0qXtnslk2d3nMKTFNlOnJjRrNcj0j9qkHM= +github.com/tdakkota/asciicheck v0.2.0/go.mod h1:Qb7Y9EgjCLJGup51gDHFzbI08/gbGhL/UVhYIPWG2rg= +github.com/tdakkota/asciicheck v0.3.0 h1:LqDGgZdholxZMaJgpM6b0U9CFIjDCbFdUF00bDnBKOQ= +github.com/tdakkota/asciicheck v0.3.0/go.mod h1:KoJKXuX/Z/lt6XzLo8WMBfQGzak0SrAKZlvRr4tg8Ac= +github.com/tenntenn/modver v1.0.1/go.mod h1:bePIyQPb7UeioSRkw3Q0XeMhYZSMx9B8ePqg6SAMGH0= +github.com/tenntenn/text/transform v0.0.0-20200319021203-7eef512accb3/go.mod h1:ON8b8w4BN/kE1EOhwT0o+d62W65a6aPw1nouo9LMgyY= +github.com/tetafro/godot v1.4.17 h1:pGzu+Ye7ZUEFx7LHU0dAKmCOXWsPjl7qA6iMGndsjPs= +github.com/tetafro/godot v1.4.17/go.mod h1:2oVxTBSftRTh4+MVfUaUXR6bn2GDXCaMcOG4Dk3rfio= +github.com/tetafro/godot v1.4.20 h1:z/p8Ek55UdNvzt4TFn2zx2KscpW4rWqcnUrdmvWJj7E= +github.com/tetafro/godot v1.4.20/go.mod h1:2oVxTBSftRTh4+MVfUaUXR6bn2GDXCaMcOG4Dk3rfio= +github.com/timakin/bodyclose v0.0.0-20230421092635-574207250966 h1:quvGphlmUVU+nhpFa4gg4yJyTRJ13reZMDHrKwYw53M= +github.com/timakin/bodyclose v0.0.0-20230421092635-574207250966/go.mod h1:27bSVNWSBOHm+qRp1T9qzaIpsWEP6TbUnei/43HK+PQ= +github.com/timakin/bodyclose v0.0.0-20241017074812-ed6a65f985e3 h1:y4mJRFlM6fUyPhoXuFg/Yu02fg/nIPFMOY8tOqppoFg= +github.com/timakin/bodyclose v0.0.0-20241017074812-ed6a65f985e3/go.mod h1:mkjARE7Yr8qU23YcGMSALbIxTQ9r9QBVahQOBRfU460= +github.com/timonwong/loggercheck v0.9.4 h1:HKKhqrjcVj8sxL7K77beXh0adEm6DLjV/QOGeMXEVi4= +github.com/timonwong/loggercheck v0.9.4/go.mod h1:caz4zlPcgvpEkXgVnAJGowHAMW2NwHaNlpS8xDbVhTg= +github.com/timonwong/loggercheck v0.10.1 h1:uVZYClxQFpw55eh+PIoqM7uAOHMrhVcDoWDery9R8Lg= +github.com/timonwong/loggercheck v0.10.1/go.mod h1:HEAWU8djynujaAVX7QI65Myb8qgfcZ1uKbdpg3ZzKl8= +github.com/tomarrell/wrapcheck/v2 v2.9.0 h1:801U2YCAjLhdN8zhZ/7tdjB3EnAoRlJHt/s+9hijLQ4= +github.com/tomarrell/wrapcheck/v2 v2.9.0/go.mod h1:g9vNIyhb5/9TQgumxQyOEqDHsmGYcGsVMOx/xGkqdMo= +github.com/tomarrell/wrapcheck/v2 v2.10.0 h1:SzRCryzy4IrAH7bVGG4cK40tNUhmVmMDuJujy4XwYDg= +github.com/tomarrell/wrapcheck/v2 v2.10.0/go.mod h1:g9vNIyhb5/9TQgumxQyOEqDHsmGYcGsVMOx/xGkqdMo= +github.com/tommy-muehle/go-mnd/v2 v2.5.1 h1:NowYhSdyE/1zwK9QCLeRb6USWdoif80Ie+v+yU8u1Zw= +github.com/tommy-muehle/go-mnd/v2 v2.5.1/go.mod h1:WsUAkMJMYww6l/ufffCD3m+P7LEvr8TnZn9lwVDlgzw= +github.com/ultraware/funlen v0.1.0 h1:BuqclbkY6pO+cvxoq7OsktIXZpgBSkYTQtmwhAK81vI= +github.com/ultraware/funlen v0.1.0/go.mod h1:XJqmOQja6DpxarLj6Jj1U7JuoS8PvL4nEqDaQhy22p4= +github.com/ultraware/funlen v0.2.0 h1:gCHmCn+d2/1SemTdYMiKLAHFYxTYz7z9VIDRaTGyLkI= +github.com/ultraware/funlen v0.2.0/go.mod h1:ZE0q4TsJ8T1SQcjmkhN/w+MceuatI6pBFSxxyteHIJA= +github.com/ultraware/whitespace v0.1.1 h1:bTPOGejYFulW3PkcrqkeQwOd6NKOOXvmGD9bo/Gk8VQ= +github.com/ultraware/whitespace v0.1.1/go.mod h1:XcP1RLD81eV4BW8UhQlpaR+SDc2givTvyI8a586WjW8= +github.com/ultraware/whitespace v0.2.0 h1:TYowo2m9Nfj1baEQBjuHzvMRbp19i+RCcRYrSWoFa+g= +github.com/ultraware/whitespace v0.2.0/go.mod h1:XcP1RLD81eV4BW8UhQlpaR+SDc2givTvyI8a586WjW8= +github.com/uudashr/gocognit v1.1.3 h1:l+a111VcDbKfynh+airAy/DJQKaXh2m9vkoysMPSZyM= +github.com/uudashr/gocognit v1.1.3/go.mod h1:aKH8/e8xbTRBwjbCkwZ8qt4l2EpKXl31KMHgSS+lZ2U= +github.com/uudashr/gocognit v1.2.0 h1:3BU9aMr1xbhPlvJLSydKwdLN3tEUUrzPSSM8S4hDYRA= +github.com/uudashr/gocognit v1.2.0/go.mod h1:k/DdKPI6XBZO1q7HgoV2juESI2/Ofj9AcHPZhBBdrTU= +github.com/uudashr/iface v1.3.0 h1:zwPch0fs9tdh9BmL5kcgSpvnObV+yHjO4JjVBl8IA10= +github.com/uudashr/iface v1.3.0/go.mod h1:4QvspiRd3JLPAEXBQ9AiZpLbJlrWWgRChOKDJEuQTdg= +github.com/xen0n/gosmopolitan v1.2.2 h1:/p2KTnMzwRexIW8GlKawsTWOxn7UHA+jCMF/V8HHtvU= +github.com/xen0n/gosmopolitan v1.2.2/go.mod h1:7XX7Mj61uLYrj0qmeN0zi7XDon9JRAEhYQqAPLVNTeg= +github.com/yagipy/maintidx v1.0.0 h1:h5NvIsCz+nRDapQ0exNv4aJ0yXSI0420omVANTv3GJM= +github.com/yagipy/maintidx v1.0.0/go.mod h1:0qNf/I/CCZXSMhsRsrEPDZ+DkekpKLXAJfsTACwgXLk= +github.com/yeya24/promlinter v0.3.0 h1:JVDbMp08lVCP7Y6NP3qHroGAO6z2yGKQtS5JsjqtoFs= +github.com/yeya24/promlinter v0.3.0/go.mod h1:cDfJQQYv9uYciW60QT0eeHlFodotkYZlL+YcPQN+mW4= +github.com/ykadowak/zerologlint v0.1.5 h1:Gy/fMz1dFQN9JZTPjv1hxEk+sRWm05row04Yoolgdiw= +github.com/ykadowak/zerologlint v0.1.5/go.mod h1:KaUskqF3e/v59oPmdq1U1DnKcuHokl2/K1U4pmIELKg= +github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +gitlab.com/bosi/decorder v0.4.2 h1:qbQaV3zgwnBZ4zPMhGLW4KZe7A7NwxEhJx39R3shffo= +gitlab.com/bosi/decorder v0.4.2/go.mod h1:muuhHoaJkA9QLcYHq4Mj8FJUwDZ+EirSHRiaTcTf6T8= +go-simpler.org/musttag v0.12.2 h1:J7lRc2ysXOq7eM8rwaTYnNrHd5JwjppzB6mScysB2Cs= +go-simpler.org/musttag v0.12.2/go.mod h1:uN1DVIasMTQKk6XSik7yrJoEysGtR2GRqvWnI9S7TYM= +go-simpler.org/musttag v0.13.0 h1:Q/YAW0AHvaoaIbsPj3bvEI5/QFP7w696IMUpnKXQfCE= +go-simpler.org/musttag v0.13.0/go.mod h1:FTzIGeK6OkKlUDVpj0iQUXZLUO1Js9+mvykDQy9C5yM= +go-simpler.org/sloglint v0.7.2 h1:Wc9Em/Zeuu7JYpl+oKoYOsQSy2X560aVueCW/m6IijY= +go-simpler.org/sloglint v0.7.2/go.mod h1:US+9C80ppl7VsThQclkM7BkCHQAzuz8kHLsW3ppuluo= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= +go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/automaxprocs v1.5.3 h1:kWazyxZUrS3Gs4qUpbwo5kEIMGe/DAvi5Z4tl2NW4j8= +go.uber.org/automaxprocs v1.5.3/go.mod h1:eRbA25aqJrxAbsLO0xy5jVwPt7FQnRgjW+efnwa1WM0= +go.uber.org/automaxprocs v1.6.0 h1:O3y2/QNTOdbF+e/dpXNNW7Rx2hZ4sTIPyybbxyNqTUs= +go.uber.org/automaxprocs v1.6.0/go.mod h1:ifeIMSnPZuznNm6jmdzmU3/bfk01Fe2fotchwEFJ8r8= +go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4= +go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= +go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= +golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= +golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/exp v0.0.0-20240904232852-e7e105dedf7e h1:I88y4caeGeuDQxgdoFPUq097j7kNfw6uvuiNxUBfcBk= +golang.org/x/exp v0.0.0-20240904232852-e7e105dedf7e/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ= +golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 h1:e66Fs6Z+fZTbFBAxKfP3PALWBtpfqks2bwGcexMxgtk= +golang.org/x/exp v0.0.0-20240909161429-701f63a606c0/go.mod h1:2TbTHSBQa924w8M6Xs1QcRcFwyucIwBGpK1p2f1YFFY= +golang.org/x/exp/typeparams v0.0.0-20220428152302-39d4317da171/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= +golang.org/x/exp/typeparams v0.0.0-20230203172020-98cc5a0785f9/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= +golang.org/x/exp/typeparams v0.0.0-20240314144324-c7f7c6466f7f h1:phY1HzDcf18Aq9A8KkmRtY9WvOFIxN8wgfvy6Zm1DV8= +golang.org/x/exp/typeparams v0.0.0-20240314144324-c7f7c6466f7f/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= +golang.org/x/exp/typeparams v0.0.0-20241108190413-2d47ceb2692f h1:WTyX8eCCyfdqiPYkRGm0MqElSfYFH3yR1+rl/mct9sA= +golang.org/x/exp/typeparams v0.0.0-20241108190413-2d47ceb2692f/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= +golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= +golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI= +golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.13.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.21.0 h1:vvrHzRwRfVKSiLrG+d4FMl/Qi4ukBCE6kZlTUkDYRT0= +golang.org/x/mod v0.21.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= +golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4= +golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= +golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= +golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= +golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= +golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= +golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= +golang.org/x/net v0.16.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= +golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= +golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211105183446-c75c47738b0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= +golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= +golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= +golang.org/x/term v0.4.0/go.mod h1:9P2UbLfCdcvo3p/nzKvsmas4TnlujnuoV9hGgYzW1lQ= +golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= +golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= +golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= +golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= +golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= +golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= +golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= +golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= +golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190321232350-e250d351ecad/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190910044552-dd2b5c81c578/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200324003944-a576cf524670/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200329025819-fd4102a86c65/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200724022722-7017fd6b1305/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200820010801-b793a1359eac/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20201023174141-c8cfbd0f21e6/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= +golang.org/x/tools v0.1.1-0.20210205202024-ef80cdb6ec6d/go.mod h1:9bzcO0MWcOuT0tm1iBGzDVPshzfwoVvREIui8C+MHqU= +golang.org/x/tools v0.1.1-0.20210302220138-2ac05c832e1a/go.mod h1:9bzcO0MWcOuT0tm1iBGzDVPshzfwoVvREIui8C+MHqU= +golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.9/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= +golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= +golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k= +golang.org/x/tools v0.5.0/go.mod h1:N+Kgy78s5I24c24dU8OfWNEotWjutIs8SnJvn5IDq+k= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= +golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= +golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= +golang.org/x/tools v0.14.0/go.mod h1:uYBEerGOWcJyEORxN+Ek8+TT266gXkNlHdJBwexUsBg= +golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24= +golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ= +golang.org/x/tools v0.28.0 h1:WuB6qZ4RPCQo5aP3WdKZS7i595EdWqWR8vqJTlwTVK8= +golang.org/x/tools v0.28.0/go.mod h1:dcIOrVd3mfQKTgrDVQHqCPMWy6lnhfhtX3hLXYVLfRw= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= +google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= +google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= +gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.5.1 h1:4bH5o3b5ZULQ4UrBmP+63W9r7qIkqJClEA9ko5YKx+I= +honnef.co/go/tools v0.5.1/go.mod h1:e9irvo83WDG9/irijV44wr3tbhcFeRnfpVlRqVwpzMs= +mvdan.cc/gofumpt v0.7.0 h1:bg91ttqXmi9y2xawvkuMXyvAA/1ZGJqYAEGjXuP0JXU= +mvdan.cc/gofumpt v0.7.0/go.mod h1:txVFJy/Sc/mvaycET54pV8SW8gWxTlUuGHVEcncmNUo= +mvdan.cc/unparam v0.0.0-20240528143540-8a5130ca722f h1:lMpcwN6GxNbWtbpI1+xzFLSW8XzX0u72NttUGVFjO3U= +mvdan.cc/unparam v0.0.0-20240528143540-8a5130ca722f/go.mod h1:RSLa7mKKCNeTTMHBw5Hsy2rfJmd6O2ivt9Dw9ZqCQpQ= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/.bingo/variables.env b/.bingo/variables.env index 8b1c16cdf..4f607b50d 100644 --- a/.bingo/variables.env +++ b/.bingo/variables.env @@ -12,6 +12,8 @@ BINGO="${GOBIN}/bingo-v0.9.0" GINKGO="${GOBIN}/ginkgo-v2.22.2" +GOLANGCI_LINT="${GOBIN}/golangci-lint-v1.63.4" + GORELEASER="${GOBIN}/goreleaser-v1.26.2" PROTOC_GEN_GO_GRPC="${GOBIN}/protoc-gen-go-grpc-v1.3.0" diff --git a/.github/dependabot.yml b/.github/dependabot.yml index a0efd7fc1..025457d21 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -8,6 +8,14 @@ updates: directory: "/" schedule: interval: "daily" + groups: + k8s-dependencies: + patterns: + - "k8s.io/*" + - "sigs.k8s.io/*" + golang-x-deps: + patterns: + - "golang.org/x/*" - package-exosystem: "docker" directory: "/" schedule: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a1b6559d6..a353509cf 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,7 +11,7 @@ on: jobs: e2e: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 @@ -19,11 +19,8 @@ jobs: go-version-file: 'go.mod' - name: Install podman run: | - . /etc/os-release - echo "deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/ /" | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list - curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_${VERSION_ID}/Release.key | sudo apt-key add - sudo apt-get update - sudo apt-get -y install conntrack podman + sudo apt-get -y install podman podman version - name: Create kind cluster and setup local docker registry run: | diff --git a/.golangci.yaml b/.golangci.yaml new file mode 100644 index 000000000..0bc5d1097 --- /dev/null +++ b/.golangci.yaml @@ -0,0 +1,83 @@ +######## +# NOTE +# +# This file is duplicated in the following repos: +# - operator-framework/kubectl-operator +# - operator-framework/catalogd +# - operator-framework/operator-controller +# - operator-framework/operator-registry +# +# If you are making a change, please make it in ALL +# of the above repositories! +# +# TODO: Find a way to have a shared golangci config. +######## + +run: + # Default timeout is 1m, up to give more room + timeout: 4m + +linters: + enable: + - asciicheck + - bodyclose + - errorlint + - gci + - gofmt + - govet + - gosec + - importas + - misspell + - nestif + - nonamedreturns + - prealloc + - stylecheck + - testifylint + - tparallel + - unconvert + - unparam + - unused + - whitespace + +linters-settings: + gci: + sections: + - standard + - dot + - default + - prefix(github.com/operator-framework) + - localmodule + custom-order: true + + errorlint: + errorf: false + + importas: + alias: + - pkg: k8s.io/apimachinery/pkg/apis/meta/v1 + alias: metav1 + - pkg: k8s.io/apimachinery/pkg/api/errors + alias: apierrors + - pkg: k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1 + alias: apiextensionsv1 + - pkg: k8s.io/apimachinery/pkg/util/runtime + alias: utilruntime + - pkg: "^k8s\\.io/api/([^/]+)/(v[^/]+)$" + alias: $1$2 + - pkg: sigs.k8s.io/controller-runtime + alias: ctrl + - pkg: github.com/blang/semver/v4 + alias: bsemver + +issues: + # exclusion rules, mostly to avoid functionally complete areas and reduce unit test noise + exclude-rules: + - path: _test\.go + linters: + - unused + - govet + + +output: + formats: + - format: tab diff --git a/Makefile b/Makefile index 31bcb7d4d..c2992c598 100644 --- a/Makefile +++ b/Makefile @@ -102,8 +102,14 @@ image-upstream: docker build -f upstream-example.Dockerfile . .PHONY: lint -lint: - find . -type f -name '*.go' ! -name '*.pb.go' -print0 | xargs -0 goimports -w +#lint: +# find . -type f -name '*.go' ! -name '*.pb.go' -print0 | xargs -0 goimports -w +lint: $(GOLANGCI_LINT) + $(GOLANGCI_LINT) run $(GOLANGCI_LINT_ARGS) + +.PHONY: fix-lint +fix-lint: $(GOLANGCI_LINT) + $(GOLANGCI_LINT) run --fix $(GOLANGCI_LINT_ARGS) .PHONY: bingo-upgrade bingo-upgrade: $(BINGO) #EXHELP Upgrade tools diff --git a/alpha/action/migrate_test.go b/alpha/action/migrate_test.go index 6a69ec4f3..a0b5d2771 100644 --- a/alpha/action/migrate_test.go +++ b/alpha/action/migrate_test.go @@ -125,7 +125,7 @@ func TestMigrate(t *testing.T) { return } actualFS := os.DirFS(s.migrate.OutputDir) - fs.WalkDir(actualFS, ".", func(path string, d fs.DirEntry, err error) error { + require.NoError(t, fs.WalkDir(actualFS, ".", func(path string, d fs.DirEntry, err error) error { require.NoError(t, err) if d.IsDir() { return nil @@ -136,7 +136,7 @@ func TestMigrate(t *testing.T) { require.True(t, ok, "output directory contained unexpected file %q", path) require.Equal(t, expectedData, string(actualData)) return nil - }) + })) }) } } @@ -291,7 +291,6 @@ relatedImages: name: operator schema: olm.bundle ` - } func migrateBarCatalogSqlite() string { diff --git a/alpha/action/migrations/migrations_test.go b/alpha/action/migrations/migrations_test.go index 2d8eee035..d3b1ad074 100644 --- a/alpha/action/migrations/migrations_test.go +++ b/alpha/action/migrations/migrations_test.go @@ -8,10 +8,12 @@ import ( "testing" "github.com/google/go-cmp/cmp" + "github.com/stretchr/testify/require" + "github.com/operator-framework/api/pkg/operators/v1alpha1" + "github.com/operator-framework/operator-registry/alpha/declcfg" "github.com/operator-framework/operator-registry/alpha/property" - "github.com/stretchr/testify/require" ) func TestMigrations(t *testing.T) { @@ -57,7 +59,7 @@ func TestMigrations(t *testing.T) { for _, test := range tests { t.Run(test.name, func(t *testing.T) { - var config declcfg.DeclarativeConfig = unmigratedCatalogFBC() + var config = unmigratedCatalogFBC() for _, m := range test.migrators.Migrations { err := m.Migrate(&config) diff --git a/alpha/action/render.go b/alpha/action/render.go index 07631b7c4..ad7a066b4 100644 --- a/alpha/action/render.go +++ b/alpha/action/render.go @@ -70,10 +70,13 @@ func (r Render) Run(ctx context.Context) (*declcfg.DeclarativeConfig, error) { if err != nil { return nil, fmt.Errorf("create registry: %v", err) } - defer reg.Destroy() + defer func() { + _ = reg.Destroy() + }() r.Registry = reg } + // nolint:prealloc var cfgs []declcfg.DeclarativeConfig for _, ref := range r.Refs { cfg, err := r.renderReference(ctx, ref) @@ -123,6 +126,7 @@ func (r Render) renderReference(ctx context.Context, ref string) (*declcfg.Decla if err != nil { return r.imageToDeclcfg(ctx, ref) } + // nolint:nestif if stat.IsDir() { dirEntries, err := os.ReadDir(ref) if err != nil { @@ -178,6 +182,7 @@ func (r Render) imageToDeclcfg(ctx context.Context, imageRef string) (*declcfg.D } var cfg *declcfg.DeclarativeConfig + // nolint:nestif if dbFile, ok := labels[containertools.DbLocationLabel]; ok { if !r.AllowedRefMask.Allowed(RefSqliteImage) { return nil, fmt.Errorf("cannot render sqlite image: %w", ErrNotAllowed) @@ -279,6 +284,7 @@ func populateDBRelatedImages(ctx context.Context, cfg *declcfg.DeclarativeConfig } defer rows.Close() + // nolint:staticcheck images := map[string]sets.String{} for rows.Next() { var ( @@ -326,10 +332,10 @@ func bundleToDeclcfg(bundle *registry.Bundle) (*declcfg.Bundle, error) { return nil, fmt.Errorf("get related images for bundle %q: %v", bundle.Name, err) } - var csvJson []byte + var csvJSON []byte for _, obj := range bundle.Objects { if obj.GetKind() == "ClusterServiceVersion" { - csvJson, err = json.Marshal(obj) + csvJSON, err = json.Marshal(obj) if err != nil { return nil, fmt.Errorf("marshal CSV JSON for bundle %q: %v", bundle.Name, err) } @@ -344,7 +350,7 @@ func bundleToDeclcfg(bundle *registry.Bundle) (*declcfg.Bundle, error) { Properties: props, RelatedImages: relatedImages, Objects: objs, - CsvJSON: string(csvJson), + CsvJSON: string(csvJSON), }, nil } diff --git a/alpha/action/render_test.go b/alpha/action/render_test.go index 3c69d4a26..72fdd8a4e 100644 --- a/alpha/action/render_test.go +++ b/alpha/action/render_test.go @@ -4,7 +4,6 @@ import ( "context" "embed" "encoding/json" - "errors" "fmt" "io/fs" "os" @@ -13,7 +12,6 @@ import ( "testing/fstest" "text/template" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "k8s.io/apimachinery/pkg/util/yaml" @@ -86,11 +84,11 @@ func TestRender(t *testing.T) { image.SimpleReference("test.registry/foo-operator/foo-bundle:v0.1.0"): "testdata/foo-bundle-v0.1.0", image.SimpleReference("test.registry/foo-operator/foo-bundle:v0.2.0"): "testdata/foo-bundle-v0.2.0", } - assert.NoError(t, generateSqliteFile(dbFile, imageMap)) + require.NoError(t, generateSqliteFile(dbFile, imageMap)) testMigrations := migrations.Migrations{ Migrations: []migrations.Migration{ fauxMigration{"faux-migration", "my help text", func(d *declcfg.DeclarativeConfig) error { - for i, _ := range d.Bundles { + for i := range d.Bundles { d.Bundles[i].Name = fmt.Sprintf("%s-MIGRATED", d.Bundles[i].Name) } return nil @@ -1235,7 +1233,7 @@ func TestAllowRefMask(t *testing.T) { image.SimpleReference("test.registry/foo-operator/foo-bundle:v0.1.0"): "testdata/foo-bundle-v0.1.0", image.SimpleReference("test.registry/foo-operator/foo-bundle:v0.2.0"): "testdata/foo-bundle-v0.2.0", } - assert.NoError(t, generateSqliteFile(dbFile, imageMap)) + require.NoError(t, generateSqliteFile(dbFile, imageMap)) specs := []spec{ { @@ -1365,18 +1363,17 @@ func TestAllowRefMask(t *testing.T) { for _, s := range specs { t.Run(s.name, func(t *testing.T) { _, err := s.render.Run(context.Background()) - require.True(t, errors.Is(err, s.expectErr), "expected error %#v to be %#v", err, s.expectErr) + require.ErrorIs(t, err, s.expectErr, "expected error %#v to be %#v", err, s.expectErr) }) } } func TestAllowRefMaskAllowed(t *testing.T) { type spec struct { - name string - mask action.RefType - pass []action.RefType - fail []action.RefType - expect bool + name string + mask action.RefType + pass []action.RefType + fail []action.RefType } specs := []spec{ diff --git a/alpha/declcfg/declcfg.go b/alpha/declcfg/declcfg.go index 7797baa49..9e4f752ee 100644 --- a/alpha/declcfg/declcfg.go +++ b/alpha/declcfg/declcfg.go @@ -6,13 +6,12 @@ import ( "errors" "fmt" - prettyunmarshaler "github.com/operator-framework/operator-registry/pkg/prettyunmarshaler" - "golang.org/x/text/cases" utilerrors "k8s.io/apimachinery/pkg/util/errors" "k8s.io/apimachinery/pkg/util/sets" "github.com/operator-framework/operator-registry/alpha/property" + prettyunmarshaler "github.com/operator-framework/operator-registry/pkg/prettyunmarshaler" ) const ( diff --git a/alpha/declcfg/declcfg_to_model.go b/alpha/declcfg/declcfg_to_model.go index 2657efb16..342cab403 100644 --- a/alpha/declcfg/declcfg_to_model.go +++ b/alpha/declcfg/declcfg_to_model.go @@ -178,7 +178,6 @@ func ConvertToModel(cfg DeclarativeConfig) (model.Model, error) { deprecationsByPackage := sets.New[string]() for i, deprecation := range cfg.Deprecations { - // no need to validate schema, since it could not be unmarshaled if missing/invalid if deprecation.Package == "" { @@ -246,6 +245,7 @@ func ConvertToModel(cfg DeclarativeConfig) (model.Model, error) { } func relatedImagesToModelRelatedImages(in []RelatedImage) []model.RelatedImage { + // nolint:prealloc var out []model.RelatedImage for _, p := range in { out = append(out, model.RelatedImage{ diff --git a/alpha/declcfg/declcfg_to_model_test.go b/alpha/declcfg/declcfg_to_model_test.go index 469bfba76..de8639c1b 100644 --- a/alpha/declcfg/declcfg_to_model_test.go +++ b/alpha/declcfg/declcfg_to_model_test.go @@ -484,7 +484,6 @@ func TestConvertToModelBundle(t *testing.T) { assert.Len(t, b.PropertiesP.BundleObjects, 2) assert.Len(t, b.PropertiesP.Packages, 1) assert.Equal(t, semver.MustParse("0.1.0"), b.Version) - } func TestConvertToModelRoundtrip(t *testing.T) { @@ -499,7 +498,7 @@ func TestConvertToModelRoundtrip(t *testing.T) { assert.Equal(t, expected.Packages, actual.Packages) assert.Equal(t, expected.Bundles, actual.Bundles) - assert.Len(t, actual.Others, 0, "expected unrecognized schemas not to make the roundtrip") + assert.Empty(t, actual.Others, "expected unrecognized schemas not to make the roundtrip") } func hasError(expectedError string) require.ErrorAssertionFunc { diff --git a/alpha/declcfg/helpers_test.go b/alpha/declcfg/helpers_test.go index ff39b7d5f..1d55f9e2a 100644 --- a/alpha/declcfg/helpers_test.go +++ b/alpha/declcfg/helpers_test.go @@ -146,7 +146,7 @@ func withNoBundleData() func(*Bundle) { } func newTestBundle(packageName, version string, opts ...bundleOpt) Bundle { - csvJson := fmt.Sprintf(`{"kind": "ClusterServiceVersion", "apiVersion": "operators.coreos.com/v1alpha1", "metadata":{"name":%q}}`, testBundleName(packageName, version)) + csvJSON := fmt.Sprintf(`{"kind": "ClusterServiceVersion", "apiVersion": "operators.coreos.com/v1alpha1", "metadata":{"name":%q}}`, testBundleName(packageName, version)) b := Bundle{ Schema: SchemaBundle, Name: testBundleName(packageName, version), @@ -154,7 +154,7 @@ func newTestBundle(packageName, version string, opts ...bundleOpt) Bundle { Image: testBundleImage(packageName, version), Properties: []property.Property{ property.MustBuildPackage(packageName, version), - property.MustBuildBundleObject([]byte(csvJson)), + property.MustBuildBundleObject([]byte(csvJSON)), property.MustBuildBundleObject([]byte(`{"kind": "CustomResourceDefinition", "apiVersion": "apiextensions.k8s.io/v1"}`)), }, RelatedImages: []RelatedImage{ @@ -163,9 +163,9 @@ func newTestBundle(packageName, version string, opts ...bundleOpt) Bundle { Image: testBundleImage(packageName, version), }, }, - CsvJSON: csvJson, + CsvJSON: csvJSON, Objects: []string{ - csvJson, + csvJSON, `{"kind": "CustomResourceDefinition", "apiVersion": "apiextensions.k8s.io/v1"}`, }, } diff --git a/alpha/declcfg/load.go b/alpha/declcfg/load.go index f811b3145..5db111b87 100644 --- a/alpha/declcfg/load.go +++ b/alpha/declcfg/load.go @@ -174,7 +174,7 @@ func sendPaths(ctx context.Context, root fs.FS, pathChan chan<- string) error { }) } -func parseMetaPaths(ctx context.Context, root fs.FS, pathChan <-chan string, walkFn WalkMetasFSFunc, options LoadOptions) error { +func parseMetaPaths(ctx context.Context, root fs.FS, pathChan <-chan string, walkFn WalkMetasFSFunc, _ LoadOptions) error { for { select { case <-ctx.Done(): // don't block on receiving from pathChan @@ -183,15 +183,20 @@ func parseMetaPaths(ctx context.Context, root fs.FS, pathChan <-chan string, wal if !ok { return nil } - file, err := root.Open(path) + err := func() error { // using closure to ensure file is closed immediately after use + file, err := root.Open(path) + if err != nil { + return err + } + defer file.Close() + + return WalkMetasReader(file, func(meta *Meta, err error) error { + return walkFn(path, meta, err) + }) + }() if err != nil { return err } - if err := WalkMetasReader(file, func(meta *Meta, err error) error { - return walkFn(path, meta, err) - }); err != nil { - return err - } } } } @@ -205,11 +210,11 @@ func readBundleObjects(b *Bundle) error { if err := json.Unmarshal(props.Value, &obj); err != nil { return fmt.Errorf("package %q, bundle %q: parse property at index %d as bundle object: %v", b.Package, b.Name, i, err) } - objJson, err := yaml.ToJSON(obj.Data) + objJSON, err := yaml.ToJSON(obj.Data) if err != nil { return fmt.Errorf("package %q, bundle %q: convert bundle object property at index %d to JSON: %v", b.Package, b.Name, i, err) } - b.Objects = append(b.Objects, string(objJson)) + b.Objects = append(b.Objects, string(objJSON)) } b.CsvJSON = extractCSV(b.Objects) return nil diff --git a/alpha/declcfg/load_benchmark_test.go b/alpha/declcfg/load_benchmark_test.go index 780620c5c..46f3138be 100644 --- a/alpha/declcfg/load_benchmark_test.go +++ b/alpha/declcfg/load_benchmark_test.go @@ -2,17 +2,19 @@ package declcfg_test import ( "context" + "crypto/rand" "encoding/base64" "fmt" - "math/rand" + "math/big" "os" "runtime" "testing" "github.com/blang/semver/v4" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/operator-framework/api/pkg/lib/version" "github.com/operator-framework/api/pkg/operators/v1alpha1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/operator-framework/operator-registry/alpha/declcfg" "github.com/operator-framework/operator-registry/alpha/property" @@ -64,7 +66,11 @@ func generateFBC(b *testing.B, numPackages, numChannels, numBundles int) *declcf }) } for i := 0; i < numChannels; i++ { - pkgName := fbc.Packages[rand.Intn(numPackages)].Name + r, err := rand.Int(rand.Reader, big.NewInt(int64(numPackages))) + if err != nil { + b.Error(err) + } + pkgName := fbc.Packages[r.Int64()].Name channelName := fmt.Sprintf("channel-%d", i) fbc.Channels = append(fbc.Channels, declcfg.Channel{ Schema: declcfg.SchemaChannel, @@ -73,7 +79,11 @@ func generateFBC(b *testing.B, numPackages, numChannels, numBundles int) *declcf }) } for i := 0; i < numBundles; i++ { - pkgName := fbc.Packages[rand.Intn(numPackages)].Name + r, err := rand.Int(rand.Reader, big.NewInt(int64(numPackages))) + if err != nil { + b.Error(err) + } + pkgName := fbc.Packages[r.Int64()].Name bundleName := fmt.Sprintf("bundle-%d", i) version := fmt.Sprintf("0.%d.0", i) bundle := declcfg.Bundle{ @@ -93,7 +103,11 @@ func generateFBC(b *testing.B, numPackages, numChannels, numBundles int) *declcf bundle.Properties = append(bundle.Properties, property.MustBuildCSVMetadata(csv)) fbc.Bundles = append(fbc.Bundles, bundle) - chIdx := rand.Intn(numChannels) + p, err := rand.Int(rand.Reader, big.NewInt(int64(numChannels))) + if err != nil { + b.Error(err) + } + chIdx := p.Int64() ch := fbc.Channels[chIdx] replaces := "" if len(ch.Entries) > 0 { diff --git a/alpha/declcfg/load_test.go b/alpha/declcfg/load_test.go index 9f8f90fda..392fbd795 100644 --- a/alpha/declcfg/load_test.go +++ b/alpha/declcfg/load_test.go @@ -989,9 +989,9 @@ func TestLoadFile(t *testing.T) { path: "unrecognized-schema.json", assertion: require.NoError, expect: func(t *testing.T, d *DeclarativeConfig) { - require.Equal(t, 1, len(d.Packages)) - require.Equal(t, 1, len(d.Bundles)) - require.Equal(t, 1, len(d.Others)) + require.Len(t, d.Packages, 1) + require.Len(t, d.Bundles, 1) + require.Len(t, d.Others, 1) }, }, { @@ -1000,9 +1000,9 @@ func TestLoadFile(t *testing.T) { path: "etcd.yaml", assertion: require.NoError, expect: func(t *testing.T, d *DeclarativeConfig) { - require.Equal(t, 1, len(d.Packages)) - require.Equal(t, 6, len(d.Bundles)) - require.Equal(t, 0, len(d.Others)) + require.Len(t, d.Packages, 1) + require.Len(t, d.Bundles, 6) + require.Empty(t, d.Others) }, }, { @@ -1011,10 +1011,10 @@ func TestLoadFile(t *testing.T) { path: "deprecations.yaml", assertion: require.NoError, expect: func(t *testing.T, d *DeclarativeConfig) { - require.Equal(t, 0, len(d.Packages)) - require.Equal(t, 0, len(d.Bundles)) - require.Equal(t, 0, len(d.Others)) - require.Equal(t, 1, len(d.Deprecations)) + require.Empty(t, d.Packages) + require.Empty(t, d.Bundles) + require.Empty(t, d.Others) + require.Len(t, d.Deprecations, 1) }, }, } diff --git a/alpha/declcfg/model_to_declcfg.go b/alpha/declcfg/model_to_declcfg.go index 14424d9f0..fabb0d0d2 100644 --- a/alpha/declcfg/model_to_declcfg.go +++ b/alpha/declcfg/model_to_declcfg.go @@ -103,6 +103,7 @@ func traverseModelChannels(mpkg model.Package) ([]Channel, []Bundle) { channels = append(channels, c) } + // nolint:prealloc var bundles []Bundle for _, b := range bundleMap { b.Properties = property.Deduplicate(b.Properties) @@ -120,6 +121,7 @@ func traverseModelChannels(mpkg model.Package) ([]Channel, []Bundle) { } func ModelRelatedImagesToRelatedImages(relatedImages []model.RelatedImage) []RelatedImage { + // nolint:prealloc var out []RelatedImage for _, ri := range relatedImages { out = append(out, RelatedImage{ diff --git a/alpha/declcfg/model_to_declcfg_test.go b/alpha/declcfg/model_to_declcfg_test.go index b5e18dd03..07fe7d577 100644 --- a/alpha/declcfg/model_to_declcfg_test.go +++ b/alpha/declcfg/model_to_declcfg_test.go @@ -4,6 +4,7 @@ import ( "testing" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" "github.com/operator-framework/operator-registry/alpha/model" ) @@ -26,7 +27,7 @@ func TestConvertFromModel(t *testing.T) { for _, s := range specs { t.Run(s.name, func(t *testing.T) { s.m.Normalize() - assert.NoError(t, s.m.Validate()) + require.NoError(t, s.m.Validate()) actual := ConvertFromModel(s.m) removeJSONWhitespace(&s.expectCfg) diff --git a/alpha/declcfg/write.go b/alpha/declcfg/write.go index 9856c2e1e..293d9363b 100644 --- a/alpha/declcfg/write.go +++ b/alpha/declcfg/write.go @@ -128,6 +128,7 @@ func (writer *MermaidWriter) WriteChannels(cfg DeclarativeConfig, out io.Writer) for _, c := range cfg.Channels { filteredChannel := writer.filterChannel(&c, versionMap, minVersion, minEdgePackage) + // nolint:nestif if filteredChannel != nil { pkgBuilder, ok := pkgs[c.Package] if !ok { @@ -154,17 +155,17 @@ func (writer *MermaidWriter) WriteChannels(cfg DeclarativeConfig, out io.Writer) bundleDeprecation = ":::deprecated" } - entryId := fmt.Sprintf("%s-%s", channelID, ce.Name) - pkgBuilder.WriteString(fmt.Sprintf(" %s[%q]%s\n", entryId, ce.Name, bundleDeprecation)) + entryID := fmt.Sprintf("%s-%s", channelID, ce.Name) + pkgBuilder.WriteString(fmt.Sprintf(" %s[%q]%s\n", entryID, ce.Name, bundleDeprecation)) if len(ce.Replaces) > 0 { - replacesId := fmt.Sprintf("%s-%s", channelID, ce.Replaces) - pkgBuilder.WriteString(fmt.Sprintf(" %s[%q]-- %s --> %s[%q]\n", replacesId, ce.Replaces, "replace", entryId, ce.Name)) + replacesID := fmt.Sprintf("%s-%s", channelID, ce.Replaces) + pkgBuilder.WriteString(fmt.Sprintf(" %s[%q]-- %s --> %s[%q]\n", replacesID, ce.Replaces, "replace", entryID, ce.Name)) } if len(ce.Skips) > 0 { for _, s := range ce.Skips { - skipsId := fmt.Sprintf("%s-%s", channelID, s) - pkgBuilder.WriteString(fmt.Sprintf(" %s[%q]-- %s --> %s[%q]\n", skipsId, s, "skip", entryId, ce.Name)) + skipsID := fmt.Sprintf("%s-%s", channelID, s) + pkgBuilder.WriteString(fmt.Sprintf(" %s[%q]-- %s --> %s[%q]\n", skipsID, s, "skip", entryID, ce.Name)) } } if len(ce.SkipRange) > 0 { @@ -172,8 +173,8 @@ func (writer *MermaidWriter) WriteChannels(cfg DeclarativeConfig, out io.Writer) if err == nil { for _, edgeName := range filteredChannel.Entries { if skipRange(versionMap[edgeName.Name]) { - skipRangeId := fmt.Sprintf("%s-%s", channelID, edgeName.Name) - pkgBuilder.WriteString(fmt.Sprintf(" %s[%q]-- \"%s(%s)\" --> %s[%q]\n", skipRangeId, edgeName.Name, "skipRange", ce.SkipRange, entryId, ce.Name)) + skipRangeID := fmt.Sprintf("%s-%s", channelID, edgeName.Name) + pkgBuilder.WriteString(fmt.Sprintf(" %s[%q]-- \"%s(%s)\" --> %s[%q]\n", skipRangeID, edgeName.Name, "skipRange", ce.SkipRange, entryID, ce.Name)) } } } else { @@ -186,8 +187,8 @@ func (writer *MermaidWriter) WriteChannels(cfg DeclarativeConfig, out io.Writer) } } - out.Write([]byte("graph LR\n")) - out.Write([]byte(fmt.Sprintf(" classDef deprecated fill:#E8960F\n"))) + _, _ = out.Write([]byte("graph LR\n")) + _, _ = out.Write([]byte(" classDef deprecated fill:#E8960F\n")) pkgNames := []string{} for pname := range pkgs { pkgNames = append(pkgNames, pname) @@ -196,19 +197,19 @@ func (writer *MermaidWriter) WriteChannels(cfg DeclarativeConfig, out io.Writer) return pkgNames[i] < pkgNames[j] }) for _, pkgName := range pkgNames { - out.Write([]byte(fmt.Sprintf(" %%%% package %q\n", pkgName))) - out.Write([]byte(fmt.Sprintf(" subgraph %q\n", pkgName))) - out.Write([]byte(pkgs[pkgName].String())) - out.Write([]byte(" end\n")) + _, _ = out.Write([]byte(fmt.Sprintf(" %%%% package %q\n", pkgName))) + _, _ = out.Write([]byte(fmt.Sprintf(" subgraph %q\n", pkgName))) + _, _ = out.Write([]byte(pkgs[pkgName].String())) + _, _ = out.Write([]byte(" end\n")) } if deprecatedPackage != "" { - out.Write([]byte(fmt.Sprintf("style %s fill:#989695\n", deprecatedPackage))) + _, _ = out.Write([]byte(fmt.Sprintf("style %s fill:#989695\n", deprecatedPackage))) } if len(deprecatedChannels) > 0 { for _, deprecatedChannel := range deprecatedChannels { - out.Write([]byte(fmt.Sprintf("style %s fill:#DCD0FF\n", deprecatedChannel))) + _, _ = out.Write([]byte(fmt.Sprintf("style %s fill:#DCD0FF\n", deprecatedChannel))) } } @@ -236,6 +237,7 @@ func (writer *MermaidWriter) filterChannel(c *Channel, versionMap map[string]sem out := &Channel{Name: c.Name, Package: c.Package, Properties: c.Properties, Entries: []ChannelEntry{}} for _, ce := range c.Entries { filteredCe := ChannelEntry{Name: ce.Name} + // nolint:nestif if writer.MinEdgeName == "" { // no minimum-edge specified filteredCe.SkipRange = ce.SkipRange @@ -535,7 +537,7 @@ func writeFile(cfg DeclarativeConfig, filename string, writeFunc WriteFunc) erro if err := writeFunc(cfg, buf); err != nil { return fmt.Errorf("write to buffer for %q: %v", filename, err) } - if err := os.WriteFile(filename, buf.Bytes(), 0666); err != nil { + if err := os.WriteFile(filename, buf.Bytes(), 0600); err != nil { return fmt.Errorf("write file %q: %v", filename, err) } return nil diff --git a/alpha/declcfg/write_test.go b/alpha/declcfg/write_test.go index 9e98e4c54..eca428768 100644 --- a/alpha/declcfg/write_test.go +++ b/alpha/declcfg/write_test.go @@ -500,13 +500,13 @@ func removeJSONWhitespace(cfg *DeclarativeConfig) { for ib := range cfg.Bundles { for ip := range cfg.Bundles[ib].Properties { var buf bytes.Buffer - json.Compact(&buf, cfg.Bundles[ib].Properties[ip].Value) + _ = json.Compact(&buf, cfg.Bundles[ib].Properties[ip].Value) cfg.Bundles[ib].Properties[ip].Value = buf.Bytes() } } for io := range cfg.Others { var buf bytes.Buffer - json.Compact(&buf, cfg.Others[io].Blob) + _ = json.Compact(&buf, cfg.Others[io].Blob) cfg.Others[io].Blob = buf.Bytes() } } diff --git a/alpha/model/error.go b/alpha/model/error.go index 0ad0f7adb..e99cb2ca8 100644 --- a/alpha/model/error.go +++ b/alpha/model/error.go @@ -2,6 +2,7 @@ package model import ( "bytes" + "errors" "fmt" "strings" ) @@ -31,7 +32,7 @@ func (v *validationError) Error() string { func (v *validationError) errorPrefix(prefix []rune, last bool, seen []error) string { for _, s := range seen { - if v == s { + if errors.Is(v, s) { return "" } } @@ -56,7 +57,9 @@ func (v *validationError) errorPrefix(prefix []rune, last bool, seen []error) st } else { subPrefix = append(subPrefix, []rune("├── ")...) } - if verr, ok := serr.(*validationError); ok { + + var verr *validationError + if errors.As(serr, &verr) { errMsg.WriteString(verr.errorPrefix(subPrefix, subLast, seen)) } else { errMsg.WriteString(fmt.Sprintf("%s%s\n", string(subPrefix), serr)) diff --git a/alpha/model/model.go b/alpha/model/model.go index d570f93c3..9b4e3ae85 100644 --- a/alpha/model/model.go +++ b/alpha/model/model.go @@ -161,6 +161,7 @@ func (i *Icon) Validate() error { return result.orNil() } +// nolint:unused func (i *Icon) validateData() error { if !filetype.IsImage(i.Data) { return errors.New("icon data is not an image") diff --git a/alpha/model/model_test.go b/alpha/model/model_test.go index 3273b2941..11391b74c 100644 --- a/alpha/model/model_test.go +++ b/alpha/model/model_test.go @@ -3,6 +3,7 @@ package model import ( "encoding/base64" "encoding/json" + "errors" "testing" "github.com/blang/semver/v4" @@ -184,7 +185,8 @@ func hasError(expectedError string) require.ErrorAssertionFunc { if err == nil { continue } - if verr, ok := err.(*validationError); ok { + var verr *validationError + if errors.As(err, &verr) { if verr.message == expectedError { return } diff --git a/alpha/property/property.go b/alpha/property/property.go index 6869b2e67..6fb792dda 100644 --- a/alpha/property/property.go +++ b/alpha/property/property.go @@ -7,8 +7,9 @@ import ( "fmt" "reflect" - "github.com/operator-framework/api/pkg/operators/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/operator-framework/api/pkg/operators/v1alpha1" ) type Property struct { @@ -177,6 +178,7 @@ func Deduplicate(in []Property) []Property { } props := map[key]Property{} + // nolint:prealloc var out []Property for _, p := range in { k := key{p.Type, string(p.Value)} diff --git a/alpha/template/converter/converter.go b/alpha/template/converter/converter.go index 33e28ddcd..03e3e0a97 100644 --- a/alpha/template/converter/converter.go +++ b/alpha/template/converter/converter.go @@ -6,9 +6,10 @@ import ( "io" "os" + "sigs.k8s.io/yaml" + "github.com/operator-framework/operator-registry/alpha/template/basic" "github.com/operator-framework/operator-registry/pkg/image" - "sigs.k8s.io/yaml" ) type Converter struct { diff --git a/alpha/template/semver/semver.go b/alpha/template/semver/semver.go index d44e1c9d9..afd7e898c 100644 --- a/alpha/template/semver/semver.go +++ b/alpha/template/semver/semver.go @@ -22,6 +22,7 @@ func (t Template) Render(ctx context.Context) (*declcfg.DeclarativeConfig, error return nil, fmt.Errorf("render: unable to read file: %v", err) } + // nolint:prealloc var cfgs []declcfg.DeclarativeConfig bundleDict := buildBundleList(*sv) @@ -211,6 +212,7 @@ func (sv *semverTemplate) generateChannels(semverChannels *bundleVersions) []dec // sort the channel archetypes in ascending order so we can traverse the bundles in order of // their source channel's priority + // nolint:prealloc var archetypesByPriority []channelArchetype for k := range channelPriorities { archetypesByPriority = append(archetypesByPriority, k) @@ -370,7 +372,7 @@ func newPackage(name string) *declcfg.Package { func newChannel(pkgName string, chName string) *declcfg.Channel { return &declcfg.Channel{ Schema: "olm.channel", - Name: string(chName), + Name: chName, Package: pkgName, Entries: []declcfg.ChannelEntry{}, } @@ -391,6 +393,7 @@ func getMinorVersion(v semver.Version) semver.Version { } } +// nolint:unused func getMajorVersion(v semver.Version) semver.Version { return semver.Version{ Major: v.Major, diff --git a/alpha/template/semver/semver_test.go b/alpha/template/semver/semver_test.go index f1bc07e8a..68cd84e66 100644 --- a/alpha/template/semver/semver_test.go +++ b/alpha/template/semver/semver_test.go @@ -544,7 +544,6 @@ func TestGetVersionsFromStandardChannel(t *testing.T) { require.EqualValues(t, "a", iosv.pkg) // verify that we learned the package name and stashed it in the receiver }) } - } func TestBailOnVersionBuildMetadata(t *testing.T) { @@ -597,7 +596,6 @@ func TestBailOnVersionBuildMetadata(t *testing.T) { } func TestReadFile(t *testing.T) { - templateFstr := `--- schema: olm.semver generateMajorChannels: %s diff --git a/cmd/configmap-server/main.go b/cmd/configmap-server/main.go index 5b5ec2b71..0bf97474b 100644 --- a/cmd/configmap-server/main.go +++ b/cmd/configmap-server/main.go @@ -129,10 +129,12 @@ func runCmdFunc(cmd *cobra.Command, args []string) error { } var store registry.Query + // nolint:staticcheck store, err = sqlite.NewSQLLiteQuerier(dbName) if err != nil { logger.WithError(err).Warnf("failed to load db") } + // nolint:staticcheck if store == nil { store = registry.NewEmptyQuerier() } diff --git a/cmd/opm/alpha/bundle/build.go b/cmd/opm/alpha/bundle/build.go index bb392ada2..b428813cc 100644 --- a/cmd/opm/alpha/bundle/build.go +++ b/cmd/opm/alpha/bundle/build.go @@ -1,9 +1,10 @@ package bundle import ( - "github.com/operator-framework/operator-registry/pkg/lib/bundle" log "github.com/sirupsen/logrus" "github.com/spf13/cobra" + + "github.com/operator-framework/operator-registry/pkg/lib/bundle" ) var ( diff --git a/cmd/opm/alpha/bundle/extract.go b/cmd/opm/alpha/bundle/extract.go index 3952a52b8..3cc7e968f 100644 --- a/cmd/opm/alpha/bundle/extract.go +++ b/cmd/opm/alpha/bundle/extract.go @@ -33,7 +33,7 @@ func init() { extractCmd.Flags().StringP("namespace", "n", "openshift-operator-lifecycle-manager", "namespace to write configmap data") extractCmd.Flags().Uint64P("datalimit", "l", 1<<20, "maximum limit in bytes for total bundle data") extractCmd.Flags().BoolP("gzip", "z", false, "enable gzip compression of configmap data") - extractCmd.MarkPersistentFlagRequired("configmapname") + _ = extractCmd.MarkPersistentFlagRequired("configmapname") } func runExtractCmd(cmd *cobra.Command, _ []string) error { diff --git a/cmd/opm/alpha/bundle/unpack.go b/cmd/opm/alpha/bundle/unpack.go index 82bddff77..369442eb0 100644 --- a/cmd/opm/alpha/bundle/unpack.go +++ b/cmd/opm/alpha/bundle/unpack.go @@ -58,6 +58,7 @@ func unpackBundle(cmd *cobra.Command, args []string) error { return err } + // nolint:nestif if info, err := os.Stat(out); err != nil { if os.IsNotExist(err) { err = os.MkdirAll(out, 0755) diff --git a/cmd/opm/alpha/convert-template/convert.go b/cmd/opm/alpha/convert-template/convert.go index 00df3352d..a5587c004 100644 --- a/cmd/opm/alpha/convert-template/convert.go +++ b/cmd/opm/alpha/convert-template/convert.go @@ -36,7 +36,6 @@ This command outputs a basic catalog template to STDOUT from input FBC. If no argument is specified or is '-' input is assumed from STDIN. `, RunE: func(c *cobra.Command, args []string) error { - switch output { case "yaml", "json": converter.OutputFormat = output diff --git a/cmd/opm/alpha/list/cmd.go b/cmd/opm/alpha/list/cmd.go index 0f234e39b..79f9fd9c8 100644 --- a/cmd/opm/alpha/list/cmd.go +++ b/cmd/opm/alpha/list/cmd.go @@ -43,7 +43,9 @@ func newPackagesCmd() *cobra.Command { if err != nil { logger.Fatal(err) } - defer reg.Destroy() + defer func() { + _ = reg.Destroy() + }() lp := action.ListPackages{IndexReference: args[0], Registry: reg} res, err := lp.Run(cmd.Context()) if err != nil { @@ -72,7 +74,9 @@ func newChannelsCmd() *cobra.Command { if err != nil { logger.Fatal(err) } - defer reg.Destroy() + defer func() { + _ = reg.Destroy() + }() lc := action.ListChannels{IndexReference: args[0], Registry: reg} if len(args) > 1 { lc.PackageName = args[1] @@ -106,7 +110,9 @@ for each channel in which the bundle is present). if err != nil { logger.Fatal(err) } - defer reg.Destroy() + defer func() { + _ = reg.Destroy() + }() lb := action.ListBundles{IndexReference: args[0], Registry: reg} if len(args) > 1 { lb.PackageName = args[1] diff --git a/cmd/opm/alpha/template/basic.go b/cmd/opm/alpha/template/basic.go index 4195bd0fe..de6aed367 100644 --- a/cmd/opm/alpha/template/basic.go +++ b/cmd/opm/alpha/template/basic.go @@ -62,7 +62,9 @@ When FILE is '-' or not provided, the template is read from standard input`, if err != nil { log.Fatalf("creating containerd registry: %v", err) } - defer reg.Destroy() + defer func() { + _ = reg.Destroy() + }() var m *migrations.Migrations if migrateLevel != "" { diff --git a/cmd/opm/alpha/template/semver.go b/cmd/opm/alpha/template/semver.go index 97dccbc6c..eb07ab568 100644 --- a/cmd/opm/alpha/template/semver.go +++ b/cmd/opm/alpha/template/semver.go @@ -68,7 +68,9 @@ When FILE is '-' or not provided, the template is read from standard input`, if err != nil { log.Fatalf("creating containerd registry: %v", err) } - defer reg.Destroy() + defer func() { + _ = reg.Destroy() + }() var m *migrations.Migrations if migrateLevel != "" { diff --git a/cmd/opm/generate/cmd.go b/cmd/opm/generate/cmd.go index 0bf5b6c9b..7eb2315d8 100644 --- a/cmd/opm/generate/cmd.go +++ b/cmd/opm/generate/cmd.go @@ -99,7 +99,7 @@ A separate builder and base image can be specified. The builder image may not be cmd.Flags().StringVarP(&baseImage, "base-image", "i", containertools.DefaultBinarySourceImage, "Image base to use to build catalog.") cmd.Flags().StringVarP(&builderImage, "builder-image", "b", containertools.DefaultBinarySourceImage, "Image to use as a build stage.") cmd.Flags().StringSliceVarP(&extraLabelStrs, "extra-labels", "l", []string{}, "Extra labels to include in the generated Dockerfile. Labels should be of the form 'key=value'.") - cmd.Flags().MarkDeprecated("binary-image", "use --base-image instead") + _ = cmd.Flags().MarkDeprecated("binary-image", "use --base-image instead") cmd.MarkFlagsMutuallyExclusive("binary-image", "base-image") return cmd } diff --git a/cmd/opm/index/add.go b/cmd/opm/index/add.go index e3db1854a..7e8c8cb39 100644 --- a/cmd/opm/index/add.go +++ b/cmd/opm/index/add.go @@ -90,7 +90,6 @@ func addIndexAddCmd(parent *cobra.Command, showAlphaHelp bool) { // Set the example after the parent has been set to get the correct command path parent.AddCommand(indexCmd) indexCmd.Example = fmt.Sprintf(addExample, indexCmd.CommandPath()) - } func runIndexAddCmdFunc(cmd *cobra.Command, _ []string) error { @@ -213,7 +212,7 @@ func getContainerTools(cmd *cobra.Command) (string, string, error) { return "", "", err } - // Backwards compatiblity mode + // Backwards compatibility mode if containerTool != "" { if pullTool == "" && buildTool == "" { return containerTool, containerTool, nil diff --git a/cmd/opm/index/delete.go b/cmd/opm/index/delete.go index f7970676a..39a905f10 100644 --- a/cmd/opm/index/delete.go +++ b/cmd/opm/index/delete.go @@ -52,7 +52,6 @@ func newIndexDeleteCmd() *cobra.Command { } return indexCmd - } func runIndexDeleteCmdFunc(cmd *cobra.Command, _ []string) error { diff --git a/cmd/opm/index/export.go b/cmd/opm/index/export.go index 2541cbba6..f18674b09 100644 --- a/cmd/opm/index/export.go +++ b/cmd/opm/index/export.go @@ -57,7 +57,6 @@ func newIndexExportCmd() *cobra.Command { } return indexCmd - } func runIndexExportCmdFunc(cmd *cobra.Command, _ []string) error { diff --git a/cmd/opm/index/prune.go b/cmd/opm/index/prune.go index ec57174bb..d457b2d7f 100644 --- a/cmd/opm/index/prune.go +++ b/cmd/opm/index/prune.go @@ -52,7 +52,6 @@ func newIndexPruneCmd() *cobra.Command { } return indexCmd - } func runIndexPruneCmdFunc(cmd *cobra.Command, _ []string) error { diff --git a/cmd/opm/index/prunestranded.go b/cmd/opm/index/prunestranded.go index 4ba306919..8b6f397dd 100644 --- a/cmd/opm/index/prunestranded.go +++ b/cmd/opm/index/prunestranded.go @@ -47,7 +47,6 @@ func newIndexPruneStrandedCmd() *cobra.Command { } return indexCmd - } func runIndexPruneStrandedCmdFunc(cmd *cobra.Command, _ []string) error { diff --git a/cmd/opm/internal/util/util.go b/cmd/opm/internal/util/util.go index 9e0e006be..e007caa48 100644 --- a/cmd/opm/internal/util/util.go +++ b/cmd/opm/internal/util/util.go @@ -46,7 +46,7 @@ func GetTLSOptions(cmd *cobra.Command) (bool, bool, error) { // This works in tandem with opm/index/cmd, which adds the relevant flags as persistent // as part of the root command (cmd/root/cmd) initialization func CreateCLIRegistry(cmd *cobra.Command) (*containerdregistry.Registry, error) { - skipTlsVerify, useHTTP, err := GetTLSOptions(cmd) + skipTLSVerify, useHTTP, err := GetTLSOptions(cmd) if err != nil { return nil, err } @@ -58,7 +58,7 @@ func CreateCLIRegistry(cmd *cobra.Command) (*containerdregistry.Registry, error) reg, err := containerdregistry.NewRegistry( containerdregistry.WithCacheDir(cacheDir), - containerdregistry.SkipTLSVerify(skipTlsVerify), + containerdregistry.SkipTLSVerify(skipTLSVerify), containerdregistry.WithPlainHTTP(useHTTP), containerdregistry.WithLog(log.Null()), ) diff --git a/cmd/opm/main.go b/cmd/opm/main.go index 2359df458..ce734a1a0 100644 --- a/cmd/opm/main.go +++ b/cmd/opm/main.go @@ -2,6 +2,7 @@ package main import ( "context" + "errors" "os" "os/signal" "syscall" @@ -20,15 +21,17 @@ func main() { defer cancel() if err := cmd.ExecuteContext(ctx); err != nil { - agg, ok := err.(utilerrors.Aggregate) - if !ok { + var agg utilerrors.Aggregate + if !errors.As(err, &agg) { os.Exit(1) } for _, e := range agg.Errors() { - if _, ok := e.(registrylib.BundleImageAlreadyAddedErr); ok { + var bundleAlreadyAddedErr registrylib.BundleImageAlreadyAddedErr + if errors.As(e, &bundleAlreadyAddedErr) { os.Exit(2) } - if _, ok := e.(registrylib.PackageVersionAlreadyAddedErr); ok { + var packageVersionAlreadyAddedErr registrylib.PackageVersionAlreadyAddedErr + if errors.As(e, &packageVersionAlreadyAddedErr) { os.Exit(3) } } diff --git a/cmd/opm/registry/serve.go b/cmd/opm/registry/serve.go index 320bd795a..a5bd65e12 100644 --- a/cmd/opm/registry/serve.go +++ b/cmd/opm/registry/serve.go @@ -4,6 +4,7 @@ import ( "context" "database/sql" "fmt" + "math" "net" "os" "strconv" @@ -132,10 +133,18 @@ func serveFunc(cmd *cobra.Command, _ []string) error { s := grpc.NewServer() logger.Printf("Keeping server open for %s seconds", timeout) if timeout != "infinite" { - timeoutSeconds, err := strconv.ParseUint(timeout, 10, 16) + timeoutInputSeconds, err := strconv.ParseUint(timeout, 10, 16) if err != nil { return err } + // duration is a signed int, so capping it to prevent overflow + if timeoutInputSeconds > math.MaxInt64 { + timeoutInputSeconds = math.MaxInt64 + logger.Infof("Timeout value too large. Capping to %v.", math.MaxInt64) + } + // having capped the value to safe ranges, quiet the linter + // nolint:gosec + timeoutSeconds := int64(timeoutInputSeconds) timeoutDuration := time.Duration(timeoutSeconds) * time.Second timer := time.AfterFunc(timeoutDuration, func() { diff --git a/cmd/opm/render/cmd.go b/cmd/opm/render/cmd.go index 683d11a1c..f1923406c 100644 --- a/cmd/opm/render/cmd.go +++ b/cmd/opm/render/cmd.go @@ -55,7 +55,9 @@ database files. if err != nil { log.Fatal(err) } - defer reg.Destroy() + defer func() { + _ = reg.Destroy() + }() render.Registry = reg diff --git a/cmd/opm/serve/serve.go b/cmd/opm/serve/serve.go index 011286c6f..9aba11c4b 100644 --- a/cmd/opm/serve/serve.go +++ b/cmd/opm/serve/serve.go @@ -11,6 +11,7 @@ import ( "os" "runtime/pprof" "sync" + "time" "github.com/grpc-ecosystem/go-grpc-middleware/v2/interceptors/logging" "github.com/sirupsen/logrus" @@ -44,7 +45,7 @@ type serve struct { } const ( - defaultCpuStartupPath string = "/debug/pprof/startup/cpu" + defaultCPUStartupPath string = "/debug/pprof/startup/cpu" ) func NewCmd() *cobra.Command { @@ -99,7 +100,7 @@ func (s *serve) run(ctx context.Context) error { return fmt.Errorf("could not start pprof endpoint: %v", err) } if s.captureProfiles { - if err := p.startCpuProfileCache(); err != nil { + if err := p.startCPUProfileCache(); err != nil { return fmt.Errorf("could not start CPU profile: %v", err) } } @@ -169,7 +170,7 @@ func (s *serve) run(ctx context.Context) error { health.RegisterHealthServer(grpcServer, server.NewHealthServer()) reflection.Register(grpcServer) mainLogger.Info("serving registry") - p.stopCpuProfileCache() + p.stopCPUProfileCache() go func() { <-ctx.Done() @@ -224,11 +225,13 @@ func (p *profilerInterface) startEndpoint() error { mux.HandleFunc("/debug/pprof/profile", endpoint.Profile) mux.HandleFunc("/debug/pprof/symbol", endpoint.Symbol) mux.HandleFunc("/debug/pprof/trace", endpoint.Trace) - mux.HandleFunc(defaultCpuStartupPath, p.httpHandler) + mux.HandleFunc(defaultCPUStartupPath, p.httpHandler) p.server = http.Server{ - Addr: p.addr, - Handler: mux, + Addr: p.addr, + Handler: mux, + ReadTimeout: 10 * time.Second, + WriteTimeout: 10 * time.Second, } lis, err := net.Listen("tcp", p.addr) @@ -249,13 +252,13 @@ func (p *profilerInterface) startEndpoint() error { return nil } -func (p *profilerInterface) startCpuProfileCache() error { +func (p *profilerInterface) startCPUProfileCache() error { // short-circuit if not enabled if !p.isEnabled() { return nil } - p.logger.Infof("start caching cpu profile data at %q", defaultCpuStartupPath) + p.logger.Infof("start caching cpu profile data at %q", defaultCPUStartupPath) if err := pprof.StartCPUProfile(&p.cache); err != nil { return err } @@ -263,7 +266,7 @@ func (p *profilerInterface) startCpuProfileCache() error { return nil } -func (p *profilerInterface) stopCpuProfileCache() { +func (p *profilerInterface) stopCPUProfileCache() { // short-circuit if not enabled if !p.isEnabled() { return @@ -277,7 +280,7 @@ func (p *profilerInterface) httpHandler(w http.ResponseWriter, r *http.Request) if !p.isCacheReady() { http.Error(w, "cpu profile cache is not yet ready", http.StatusServiceUnavailable) } - w.Write(p.cache.Bytes()) + _, _ = w.Write(p.cache.Bytes()) } func (p *profilerInterface) stopEndpoint(ctx context.Context) error { diff --git a/go.mod b/go.mod index 837ce1f9c..9e9f6888f 100644 --- a/go.mod +++ b/go.mod @@ -1,22 +1,20 @@ module github.com/operator-framework/operator-registry -go 1.23.0 - -toolchain go1.23.4 +go 1.23.7 require ( github.com/akrylysov/pogreb v0.10.2 github.com/blang/semver/v4 v4.0.0 - github.com/containerd/containerd v1.7.25 - github.com/containers/common v0.61.1 - github.com/containers/image/v5 v5.33.1 - github.com/distribution/distribution/v3 v3.0.0-rc.2 + github.com/containerd/containerd v1.7.27 + github.com/containerd/errdefs v1.0.0 + github.com/containers/common v0.62.3 + github.com/containers/image/v5 v5.34.3 + github.com/distribution/distribution/v3 v3.0.0 github.com/distribution/reference v0.6.0 - github.com/docker/cli v27.5.0+incompatible - github.com/golang-migrate/migrate/v4 v4.18.1 + github.com/docker/cli v28.0.4+incompatible + github.com/golang-migrate/migrate/v4 v4.18.2 github.com/golang/mock v1.6.0 - github.com/golang/protobuf v1.5.4 - github.com/google/go-cmp v0.6.0 + github.com/google/go-cmp v0.7.0 github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.2.0 github.com/grpc-ecosystem/grpc-health-probe v0.4.37 github.com/h2non/filetype v1.1.3 @@ -24,49 +22,49 @@ require ( github.com/joelanford/ignore v0.1.1 github.com/mattn/go-sqlite3 v1.14.24 github.com/maxbrunsfeld/counterfeiter/v6 v6.11.2 - github.com/onsi/ginkgo/v2 v2.22.2 - github.com/onsi/gomega v1.36.2 + github.com/onsi/ginkgo/v2 v2.23.3 + github.com/onsi/gomega v1.37.0 github.com/opencontainers/go-digest v1.0.0 - github.com/opencontainers/image-spec v1.1.0 - github.com/operator-framework/api v0.29.0 + github.com/opencontainers/image-spec v1.1.1 + github.com/operator-framework/api v0.30.0 github.com/otiai10/copy v1.14.1 github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2 github.com/pkg/errors v0.9.1 github.com/sirupsen/logrus v1.9.3 - github.com/spf13/cobra v1.8.1 - github.com/spf13/pflag v1.0.5 + github.com/spf13/cobra v1.9.1 + github.com/spf13/pflag v1.0.6 github.com/stretchr/testify v1.10.0 github.com/tidwall/btree v1.7.0 - go.etcd.io/bbolt v1.3.11 - golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c - golang.org/x/mod v0.22.0 - golang.org/x/net v0.34.0 - golang.org/x/sync v0.10.0 - golang.org/x/sys v0.29.0 - golang.org/x/text v0.21.0 - google.golang.org/grpc v1.69.4 + go.etcd.io/bbolt v1.4.0 + golang.org/x/exp v0.0.0-20250103183323-7d7fa50e5329 + golang.org/x/mod v0.24.0 + golang.org/x/net v0.37.0 + golang.org/x/sync v0.13.0 + golang.org/x/sys v0.32.0 + golang.org/x/text v0.24.0 + google.golang.org/grpc v1.71.0 google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.5.1 - google.golang.org/protobuf v1.36.3 + google.golang.org/protobuf v1.36.6 gopkg.in/yaml.v2 v2.4.0 - k8s.io/api v0.32.1 - k8s.io/apiextensions-apiserver v0.32.1 - k8s.io/apimachinery v0.32.1 - k8s.io/client-go v0.32.1 + k8s.io/api v0.32.3 + k8s.io/apiextensions-apiserver v0.32.3 + k8s.io/apimachinery v0.32.3 + k8s.io/client-go v0.32.3 k8s.io/kubectl v0.32.0 - sigs.k8s.io/controller-runtime v0.19.4 - sigs.k8s.io/kind v0.26.0 + sigs.k8s.io/controller-runtime v0.20.4 + sigs.k8s.io/kind v0.27.0 sigs.k8s.io/yaml v1.4.0 ) require ( - cel.dev/expr v0.18.0 // indirect + al.essio.dev/pkg/shellescape v1.5.1 // indirect + cel.dev/expr v0.19.1 // indirect github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 // indirect github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect github.com/BurntSushi/toml v1.4.0 // indirect github.com/MakeNowJust/heredoc v1.0.0 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect github.com/Microsoft/hcsshim v0.12.9 // indirect - github.com/alessio/shellescape v1.4.2 // indirect github.com/antlr4-go/antlr/v4 v4.13.0 // indirect github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect github.com/beorn7/perks v1.0.1 // indirect @@ -76,33 +74,32 @@ require ( github.com/containerd/cgroups/v3 v3.0.3 // indirect github.com/containerd/containerd/api v1.8.0 // indirect github.com/containerd/continuity v0.4.4 // indirect - github.com/containerd/errdefs v0.3.0 // indirect github.com/containerd/errdefs/pkg v0.3.0 // indirect github.com/containerd/log v0.1.0 // indirect github.com/containerd/platforms v0.2.1 // indirect - github.com/containerd/ttrpc v1.2.5 // indirect - github.com/containerd/typeurl/v2 v2.2.0 // indirect + github.com/containerd/ttrpc v1.2.7 // indirect + github.com/containerd/typeurl/v2 v2.2.3 // indirect github.com/containers/libtrust v0.0.0-20230121012942-c1716e8a8d01 // indirect - github.com/containers/ocicrypt v1.2.0 // indirect - github.com/containers/storage v1.56.1 // indirect + github.com/containers/ocicrypt v1.2.1 // indirect + github.com/containers/storage v1.57.2 // indirect github.com/coreos/go-systemd/v22 v22.5.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect github.com/docker/distribution v2.8.3+incompatible // indirect - github.com/docker/docker v27.3.1+incompatible // indirect + github.com/docker/docker v27.5.1+incompatible // indirect github.com/docker/docker-credential-helpers v0.8.2 // indirect github.com/docker/go-connections v0.5.0 // indirect github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c // indirect github.com/docker/go-metrics v0.0.1 // indirect github.com/docker/go-units v0.5.0 // indirect github.com/emicklei/go-restful/v3 v3.11.2 // indirect - github.com/evanphx/json-patch/v5 v5.9.0 // indirect + github.com/evanphx/json-patch/v5 v5.9.11 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect github.com/fxamacker/cbor/v2 v2.7.0 // indirect github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect github.com/go-git/go-billy/v5 v5.6.1 // indirect github.com/go-git/go-git/v5 v5.13.1 // indirect - github.com/go-jose/go-jose/v4 v4.0.4 // indirect + github.com/go-jose/go-jose/v4 v4.0.5 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-openapi/jsonpointer v0.21.0 // indirect @@ -111,6 +108,7 @@ require ( github.com/go-task/slim-sprig/v3 v3.0.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect + github.com/golang/protobuf v1.5.4 // indirect github.com/google/cel-go v0.22.1 // indirect github.com/google/gnostic-models v0.6.8 // indirect github.com/google/gofuzz v1.2.0 // indirect @@ -134,7 +132,7 @@ require ( github.com/mitchellh/go-wordwrap v1.0.1 // indirect github.com/moby/locker v1.0.1 // indirect github.com/moby/spdystream v0.5.0 // indirect - github.com/moby/sys/capability v0.3.0 // indirect + github.com/moby/sys/capability v0.4.0 // indirect github.com/moby/sys/mountinfo v0.7.2 // indirect github.com/moby/sys/sequential v0.5.0 // indirect github.com/moby/sys/user v0.3.0 // indirect @@ -154,17 +152,18 @@ require ( github.com/prometheus/procfs v0.15.1 // indirect github.com/redis/go-redis/extra/rediscmd/v9 v9.0.5 // indirect github.com/redis/go-redis/extra/redisotel/v9 v9.0.5 // indirect - github.com/redis/go-redis/v9 v9.1.0 // indirect + github.com/redis/go-redis/v9 v9.7.3 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/spiffe/go-spiffe/v2 v2.4.0 // indirect github.com/stoewer/go-strcase v1.3.0 // indirect github.com/x448/float16 v0.8.4 // indirect github.com/zeebo/errs v1.3.0 // indirect go.opencensus.io v0.24.0 // indirect + go.opentelemetry.io/auto/sdk v1.1.0 // indirect go.opentelemetry.io/contrib/bridges/prometheus v0.57.0 // indirect go.opentelemetry.io/contrib/exporters/autoexport v0.57.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.57.0 // indirect - go.opentelemetry.io/otel v1.32.0 // indirect + go.opentelemetry.io/otel v1.34.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.8.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.8.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.32.0 // indirect @@ -177,27 +176,27 @@ require ( go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.32.0 // indirect go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.32.0 // indirect go.opentelemetry.io/otel/log v0.8.0 // indirect - go.opentelemetry.io/otel/metric v1.32.0 // indirect - go.opentelemetry.io/otel/sdk v1.32.0 // indirect + go.opentelemetry.io/otel/metric v1.34.0 // indirect + go.opentelemetry.io/otel/sdk v1.34.0 // indirect go.opentelemetry.io/otel/sdk/log v0.8.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.32.0 // indirect - go.opentelemetry.io/otel/trace v1.32.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.34.0 // indirect + go.opentelemetry.io/otel/trace v1.34.0 // indirect go.opentelemetry.io/proto/otlp v1.3.1 // indirect - golang.org/x/crypto v0.32.0 // indirect - golang.org/x/oauth2 v0.23.0 // indirect - golang.org/x/term v0.28.0 // indirect + golang.org/x/crypto v0.36.0 // indirect + golang.org/x/oauth2 v0.28.0 // indirect + golang.org/x/term v0.30.0 // indirect golang.org/x/time v0.7.0 // indirect - golang.org/x/tools v0.29.0 // indirect + golang.org/x/tools v0.30.0 // indirect google.golang.org/genproto v0.0.0-20240903143218-8af14fe29dc1 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20241104194629-dd2ea8efbc28 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20250303144028-a0af3efb3deb // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20250227231956-55c901821b1e // indirect gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - k8s.io/apiserver v0.32.1 // indirect + k8s.io/apiserver v0.32.3 // indirect k8s.io/cli-runtime v0.32.0 // indirect - k8s.io/component-base v0.32.1 // indirect + k8s.io/component-base v0.32.3 // indirect k8s.io/klog/v2 v2.130.1 // indirect k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f // indirect k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 // indirect diff --git a/go.sum b/go.sum index 9518b8250..96b92c1ef 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,7 @@ -cel.dev/expr v0.18.0 h1:CJ6drgk+Hf96lkLikr4rFf19WrU0BOWEihyZnI2TAzo= -cel.dev/expr v0.18.0/go.mod h1:MrpN08Q+lEBs+bGYdLxxHkZoUSsCp0nSKTs0nTymJgw= +al.essio.dev/pkg/shellescape v1.5.1 h1:86HrALUujYS/h+GtqoB26SBEdkWfmMI6FubjXlsXyho= +al.essio.dev/pkg/shellescape v1.5.1/go.mod h1:6sIqp7X2P6mThCQ7twERpZTuigpr6KbZWtls1U8I890= +cel.dev/expr v0.19.1 h1:NciYrtDRIR0lNCnH1LFJegdjspNx9fI59O7TWcua/W4= +cel.dev/expr v0.19.1/go.mod h1:MrpN08Q+lEBs+bGYdLxxHkZoUSsCp0nSKTs0nTymJgw= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 h1:bvDV9vkmnHYOMsOr4WLk+Vo07yKIzd94sVoIqshQ4bU= github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24/go.mod h1:8o94RPi1/7XTJvwPpRSzSUedZrtlirdB3r9Z20bi2f8= @@ -18,8 +20,6 @@ github.com/akrylysov/pogreb v0.10.2 h1:e6PxmeyEhWyi2AKOBIJzAEi4HkiC+lKyCocRGlnDi github.com/akrylysov/pogreb v0.10.2/go.mod h1:pNs6QmpQ1UlTJKDezuRWmaqkgUE2TuU0YTWyqJZ7+lI= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alessio/shellescape v1.4.2 h1:MHPfaU+ddJ0/bYWpgIeUnQUqKrlJ1S7BfEYPM4uEoM0= -github.com/alessio/shellescape v1.4.2/go.mod h1:PZAiSCk0LJaZkiCSkPv8qIobYglO3FPpyFjDCtHLS30= github.com/antlr4-go/antlr/v4 v4.13.0 h1:lxCg3LAv+EUK6t1i0y1V6/SLeUi0eKEKdhQAlS8TVTI= github.com/antlr4-go/antlr/v4 v4.13.0/go.mod h1:pfChB/xh/Unjila75QW7+VU4TSnWnnk9UTnmpPaOR2g= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= @@ -35,10 +35,11 @@ github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2y github.com/bshuster-repo/logrus-logstash-hook v1.0.0 h1:e+C0SB5R1pu//O4MQ3f9cFuPGoOVeF2fE4Og9otCc70= github.com/bshuster-repo/logrus-logstash-hook v1.0.0/go.mod h1:zsTqEiSzDgAa/8GZR7E1qaXrhYNDKBYy5/dWPTIflbk= github.com/bsm/ginkgo/v2 v2.7.0/go.mod h1:AiKlXPm7ItEHNc/2+OkrNG4E0ITzojb9/xWzvQ9XZ9w= -github.com/bsm/ginkgo/v2 v2.9.5 h1:rtVBYPs3+TC5iLUVOis1B9tjLTup7Cj5IfzosKtvTJ0= -github.com/bsm/ginkgo/v2 v2.9.5/go.mod h1:SwYbGRRDovPVboqFv0tPTcG1sN61LM1Z4ARdbAV9g4c= -github.com/bsm/gomega v1.26.0 h1:LhQm+AFcgV2M0WyKroMASzAzCAJVpAxQXv4SaI9a69Y= +github.com/bsm/ginkgo/v2 v2.12.0 h1:Ny8MWAHyOepLGlLKYmXG4IEkioBysk6GpaRTLC8zwWs= +github.com/bsm/ginkgo/v2 v2.12.0/go.mod h1:SwYbGRRDovPVboqFv0tPTcG1sN61LM1Z4ARdbAV9g4c= github.com/bsm/gomega v1.26.0/go.mod h1:JyEr/xRbxbtgWNi8tIEVPUYZ5Dzef52k01W3YH0H+O0= +github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA= +github.com/bsm/gomega v1.27.10/go.mod h1:JyEr/xRbxbtgWNi8tIEVPUYZ5Dzef52k01W3YH0H+O0= github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= @@ -49,39 +50,39 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/containerd/cgroups/v3 v3.0.3 h1:S5ByHZ/h9PMe5IOQoN7E+nMc2UcLEM/V48DGDJ9kip0= github.com/containerd/cgroups/v3 v3.0.3/go.mod h1:8HBe7V3aWGLFPd/k03swSIsGjZhHI2WzJmticMgVuz0= -github.com/containerd/containerd v1.7.25 h1:khEQOAXOEJalRO228yzVsuASLH42vT7DIo9Ss+9SMFQ= -github.com/containerd/containerd v1.7.25/go.mod h1:tWfHzVI0azhw4CT2vaIjsb2CoV4LJ9PrMPaULAr21Ok= +github.com/containerd/containerd v1.7.27 h1:yFyEyojddO3MIGVER2xJLWoCIn+Up4GaHFquP7hsFII= +github.com/containerd/containerd v1.7.27/go.mod h1:xZmPnl75Vc+BLGt4MIfu6bp+fy03gdHAn9bz+FreFR0= github.com/containerd/containerd/api v1.8.0 h1:hVTNJKR8fMc/2Tiw60ZRijntNMd1U+JVMyTRdsD2bS0= github.com/containerd/containerd/api v1.8.0/go.mod h1:dFv4lt6S20wTu/hMcP4350RL87qPWLVa/OHOwmmdnYc= github.com/containerd/continuity v0.4.4 h1:/fNVfTJ7wIl/YPMHjf+5H32uFhl63JucB34PlCpMKII= github.com/containerd/continuity v0.4.4/go.mod h1:/lNJvtJKUQStBzpVQ1+rasXO1LAWtUQssk28EZvJ3nE= -github.com/containerd/errdefs v0.3.0 h1:FSZgGOeK4yuT/+DnF07/Olde/q4KBoMsaamhXxIMDp4= -github.com/containerd/errdefs v0.3.0/go.mod h1:+YBYIdtsnF4Iw6nWZhJcqGSg/dwvV7tyJ/kCkyJ2k+M= +github.com/containerd/errdefs v1.0.0 h1:tg5yIfIlQIrxYtu9ajqY42W3lpS19XqdxRQeEwYG8PI= +github.com/containerd/errdefs v1.0.0/go.mod h1:+YBYIdtsnF4Iw6nWZhJcqGSg/dwvV7tyJ/kCkyJ2k+M= github.com/containerd/errdefs/pkg v0.3.0 h1:9IKJ06FvyNlexW690DXuQNx2KA2cUJXx151Xdx3ZPPE= github.com/containerd/errdefs/pkg v0.3.0/go.mod h1:NJw6s9HwNuRhnjJhM7pylWwMyAkmCQvQ4GpJHEqRLVk= github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo= github.com/containerd/platforms v0.2.1 h1:zvwtM3rz2YHPQsF2CHYM8+KtB5dvhISiXh5ZpSBQv6A= github.com/containerd/platforms v0.2.1/go.mod h1:XHCb+2/hzowdiut9rkudds9bE5yJ7npe7dG/wG+uFPw= -github.com/containerd/ttrpc v1.2.5 h1:IFckT1EFQoFBMG4c3sMdT8EP3/aKfumK1msY+Ze4oLU= -github.com/containerd/ttrpc v1.2.5/go.mod h1:YCXHsb32f+Sq5/72xHubdiJRQY9inL4a4ZQrAbN1q9o= -github.com/containerd/typeurl/v2 v2.2.0 h1:6NBDbQzr7I5LHgp34xAXYF5DOTQDn05X58lsPEmzLso= -github.com/containerd/typeurl/v2 v2.2.0/go.mod h1:8XOOxnyatxSWuG8OfsZXVnAF4iZfedjS/8UHSPJnX4g= -github.com/containers/common v0.61.1 h1:jpk385ZFEx3MAX+sjwOoTZElvpgsGi0YJHuRmrhF/j8= -github.com/containers/common v0.61.1/go.mod h1:C+TfkhTV+ADp1Hu+BMIAYPvSFix21swYo9PZuCKoSUM= -github.com/containers/image/v5 v5.33.1 h1:nTWKwxAlY0aJrilvvhssqssJVnley6VqxkLiLzTEYIs= -github.com/containers/image/v5 v5.33.1/go.mod h1:/FJiLlvVbeBxWNMPVPPIWJxHTAzwBoFvyN0a51zo1CE= +github.com/containerd/ttrpc v1.2.7 h1:qIrroQvuOL9HQ1X6KHe2ohc7p+HP/0VE6XPU7elJRqQ= +github.com/containerd/ttrpc v1.2.7/go.mod h1:YCXHsb32f+Sq5/72xHubdiJRQY9inL4a4ZQrAbN1q9o= +github.com/containerd/typeurl/v2 v2.2.3 h1:yNA/94zxWdvYACdYO8zofhrTVuQY73fFU1y++dYSw40= +github.com/containerd/typeurl/v2 v2.2.3/go.mod h1:95ljDnPfD3bAbDJRugOiShd/DlAAsxGtUBhJxIn7SCk= +github.com/containers/common v0.62.3 h1:aOGryqXfW6aKBbHbqOveH7zB+ihavUN03X/2pUSvWFI= +github.com/containers/common v0.62.3/go.mod h1:3R8kDox2prC9uj/a2hmXj/YjZz5sBEUNrcDiw51S0Lo= +github.com/containers/image/v5 v5.34.3 h1:/cMgfyA4Y7ILH7nzWP/kqpkE5Df35Ek4bp5ZPvJOVmI= +github.com/containers/image/v5 v5.34.3/go.mod h1:MG++slvQSZVq5ejAcLdu4APGsKGMb0YHHnAo7X28fdE= github.com/containers/libtrust v0.0.0-20230121012942-c1716e8a8d01 h1:Qzk5C6cYglewc+UyGf6lc8Mj2UaPTHy/iF2De0/77CA= github.com/containers/libtrust v0.0.0-20230121012942-c1716e8a8d01/go.mod h1:9rfv8iPl1ZP7aqh9YA68wnZv2NUDbXdcdPHVz0pFbPY= -github.com/containers/ocicrypt v1.2.0 h1:X14EgRK3xNFvJEfI5O4Qn4T3E25ANudSOZz/sirVuPM= -github.com/containers/ocicrypt v1.2.0/go.mod h1:ZNviigQajtdlxIZGibvblVuIFBKIuUI2M0QM12SD31U= -github.com/containers/storage v1.56.1 h1:gDZj/S6Zxus4Xx42X6iNB3ODXuh0qoOdH/BABfrvcKo= -github.com/containers/storage v1.56.1/go.mod h1:c6WKowcAlED/DkWGNuL9bvGYqIWCVy7isRMdCSKWNjk= +github.com/containers/ocicrypt v1.2.1 h1:0qIOTT9DoYwcKmxSt8QJt+VzMY18onl9jUXsxpVhSmM= +github.com/containers/ocicrypt v1.2.1/go.mod h1:aD0AAqfMp0MtwqWgHM1bUwe1anx0VazI108CRrSKINQ= +github.com/containers/storage v1.57.2 h1:2roCtTyE9pzIaBDHibK72DTnYkPmwWaq5uXxZdaWK4U= +github.com/containers/storage v1.57.2/go.mod h1:i/Hb4lu7YgFr9G0K6BMjqW0BLJO1sFsnWQwj2UoWCUM= github.com/coreos/go-semver v0.3.1 h1:yi21YpKnrx1gt5R+la8n5WgS0kCrsPp33dmEyHReZr4= github.com/coreos/go-semver v0.3.1/go.mod h1:irMmmIw/7yzSRPWryHsK7EYSg09caPQL03VsM8rvUec= github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -90,16 +91,16 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= -github.com/distribution/distribution/v3 v3.0.0-rc.2 h1:tTrzntanYMbd20SyvdeR83Ya1l/aBwDcA3NCIpmwemc= -github.com/distribution/distribution/v3 v3.0.0-rc.2/go.mod h1:H2zIRRXS20ylnv2HTuKILAWuANjuA60GB7MLOsQag7Y= +github.com/distribution/distribution/v3 v3.0.0 h1:q4R8wemdRQDClzoNNStftB2ZAfqOiN6UX90KJc4HjyM= +github.com/distribution/distribution/v3 v3.0.0/go.mod h1:tRNuFoZsUdyRVegq8xGNeds4KLjwLCRin/tTo6i1DhU= github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk= github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= -github.com/docker/cli v27.5.0+incompatible h1:aMphQkcGtpHixwwhAXJT1rrK/detk2JIvDaFkLctbGM= -github.com/docker/cli v27.5.0+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= +github.com/docker/cli v28.0.4+incompatible h1:pBJSJeNd9QeIWPjRcV91RVJihd/TXB77q1ef64XEu4A= +github.com/docker/cli v28.0.4+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk= github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v27.3.1+incompatible h1:KttF0XoteNTicmUtBO0L2tP+J7FGRFTjaEF4k6WdhfI= -github.com/docker/docker v27.3.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v27.5.1+incompatible h1:4PYU5dnBYqRQi0294d1FBECqT9ECWeQAIfE8q4YnPY8= +github.com/docker/docker v27.5.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker-credential-helpers v0.8.2 h1:bX3YxiGzFP5sOXWc3bTPEXdEaZSeVMrFgOr3T+zrFAo= github.com/docker/docker-credential-helpers v0.8.2/go.mod h1:P3ci7E3lwkZg6XiHdRKft1KckHiO9a2rNtyFbZ/ry9M= github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c= @@ -116,8 +117,8 @@ github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymF 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= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/evanphx/json-patch/v5 v5.9.0 h1:kcBlZQbplgElYIlo/n1hJbls2z/1awpXxpRi0/FOJfg= -github.com/evanphx/json-patch/v5 v5.9.0/go.mod h1:VNkHZ/282BpEyt/tObQO8s5CMPmYYq14uClGH4abBuQ= +github.com/evanphx/json-patch/v5 v5.9.11 h1:/8HVnzMq13/3x9TPvjG08wUGqBTmZBsCWzjTM0wiaDU= +github.com/evanphx/json-patch/v5 v5.9.11/go.mod h1:3j+LviiESTElxA4p3EMKAB9HXj3/XEtnUf6OZxqIQTM= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E= @@ -128,8 +129,8 @@ github.com/go-git/go-billy/v5 v5.6.1 h1:u+dcrgaguSSkbjzHwelEjc0Yj300NUevrrPphk/S github.com/go-git/go-billy/v5 v5.6.1/go.mod h1:0AsLr1z2+Uksi4NlElmMblP5rPcDZNRCD8ujZCRR2BE= github.com/go-git/go-git/v5 v5.13.1 h1:DAQ9APonnlvSWpvolXWIuV6Q6zXy2wHbN4cVlNR5Q+M= github.com/go-git/go-git/v5 v5.13.1/go.mod h1:qryJB4cSBoq3FRoBRf5A77joojuBcmPJ0qu3XXXVixc= -github.com/go-jose/go-jose/v4 v4.0.4 h1:VsjPI33J0SB9vQM6PLmNjoHqMQNGPiZ0rHL7Ni7Q6/E= -github.com/go-jose/go-jose/v4 v4.0.4/go.mod h1:NKb5HO1EZccyMpiZNbdUw/14tiXNyUJh188dfnMCAfc= +github.com/go-jose/go-jose/v4 v4.0.5 h1:M6T8+mKZl/+fNNuFHvGIzDz7BTLQPIounk/b9dw3AaE= +github.com/go-jose/go-jose/v4 v4.0.5/go.mod h1:s3P1lRrkT8igV8D9OjyL4WRyHvjB6a4JSllnOrmmBOA= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= @@ -153,8 +154,8 @@ github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5x github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang-migrate/migrate/v4 v4.18.1 h1:JML/k+t4tpHCpQTCAD62Nu43NUFzHY4CV3uAuvHGC+Y= -github.com/golang-migrate/migrate/v4 v4.18.1/go.mod h1:HAX6m3sQgcdO81tdjn5exv20+3Kb13cmGli1hrD6hks= +github.com/golang-migrate/migrate/v4 v4.18.2 h1:2VSCMz7x7mjyTXx3m2zPokOY82LTRgxK1yQYKo6wWQ8= +github.com/golang-migrate/migrate/v4 v4.18.2/go.mod h1:2CM6tJvn2kqPXwnXO/d3rAQYiyoIm180VsO8PRX6Rpk= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= @@ -174,8 +175,8 @@ github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QD github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= -github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4= -github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= +github.com/google/btree v1.1.3 h1:CVpQJjYgC4VbzxeGVHfvZrv1ctoYCAI8vbl07Fcxlyg= +github.com/google/btree v1.1.3/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= github.com/google/cel-go v0.22.1 h1:AfVXx3chM2qwoSbM7Da8g8hX8OVSkBFwX+rz2+PcK40= github.com/google/cel-go v0.22.1/go.mod h1:BuznPXXfQDpXKWQ9sPW3TzlAJN5zzFe+i9tIs0yC4s8= github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= @@ -187,8 +188,8 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= -github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -196,6 +197,8 @@ github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad h1:a6HEuzUHeKH6hwfN/Z github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144= github.com/google/safetext v0.0.0-20220905092116-b49f7bc46da2 h1:SJ+NtwL6QaZ21U+IrK7d0gGgpjGGvd2kz+FzTHVzdqI= github.com/google/safetext v0.0.0-20220905092116-b49f7bc46da2/go.mod h1:Tv1PlzqC9t8wNnpPdctvtSUOPUUg4SHeE6vR1Ir2hmg= +github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= +github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -271,8 +274,8 @@ github.com/moby/locker v1.0.1 h1:fOXqR41zeveg4fFODix+1Ch4mj/gT0NE1XJbp/epuBg= github.com/moby/locker v1.0.1/go.mod h1:S7SDdo5zpBK84bzzVlKr2V0hz+7x9hWbYC/kq7oQppc= github.com/moby/spdystream v0.5.0 h1:7r0J1Si3QO/kjRitvSLVVFUjxMEb/YLj6S9FF62JBCU= github.com/moby/spdystream v0.5.0/go.mod h1:xBAYlnt/ay+11ShkdFKNAG7LsyK/tmNBVvVOwrfMgdI= -github.com/moby/sys/capability v0.3.0 h1:kEP+y6te0gEXIaeQhIi0s7vKs/w0RPoH1qPa6jROcVg= -github.com/moby/sys/capability v0.3.0/go.mod h1:4g9IK291rVkms3LKCDOoYlnV8xKwoDTpIrNEE35Wq0I= +github.com/moby/sys/capability v0.4.0 h1:4D4mI6KlNtWMCM1Z/K0i7RV1FkX+DBDHKVJpCndZoHk= +github.com/moby/sys/capability v0.4.0/go.mod h1:4g9IK291rVkms3LKCDOoYlnV8xKwoDTpIrNEE35Wq0I= github.com/moby/sys/mountinfo v0.7.2 h1:1shs6aH5s4o5H2zQLn796ADW1wMrIwHsyJ2v9KouLrg= github.com/moby/sys/mountinfo v0.7.2/go.mod h1:1YOa8w8Ih7uW0wALDUgT1dTTSBrZ+HiBLGws92L2RU4= github.com/moby/sys/sequential v0.5.0 h1:OPvI35Lzn9K04PBbCLW0g4LcFAJgHsvXsRyewg5lXtc= @@ -295,18 +298,18 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8m github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J1GEMiLbxo1LJaP8RfCpH6pymGZus= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= -github.com/onsi/ginkgo/v2 v2.22.2 h1:/3X8Panh8/WwhU/3Ssa6rCKqPLuAkVY2I0RoyDLySlU= -github.com/onsi/ginkgo/v2 v2.22.2/go.mod h1:oeMosUL+8LtarXBHu/c0bx2D/K9zyQ6uX3cTyztHwsk= -github.com/onsi/gomega v1.36.2 h1:koNYke6TVk6ZmnyHrCXba/T/MoLBXFjeC1PtvYgw0A8= -github.com/onsi/gomega v1.36.2/go.mod h1:DdwyADRjrc825LhMEkD76cHR5+pUnjhUN8GlHlRPHzY= +github.com/onsi/ginkgo/v2 v2.23.3 h1:edHxnszytJ4lD9D5Jjc4tiDkPBZ3siDeJJkUZJJVkp0= +github.com/onsi/ginkgo/v2 v2.23.3/go.mod h1:zXTP6xIp3U8aVuXN8ENK9IXRaTjFnpVB9mGmaSRvxnM= +github.com/onsi/gomega v1.37.0 h1:CdEG8g0S133B4OswTDC/5XPSzE1OeP29QOioj2PID2Y= +github.com/onsi/gomega v1.37.0/go.mod h1:8D9+Txp43QWKhM24yyOBEdpkzN8FvJyAwecBgsU4KU0= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= -github.com/opencontainers/image-spec v1.1.0 h1:8SG7/vwALn54lVB/0yZ/MMwhFrPYtpEHQb2IpWsCzug= -github.com/opencontainers/image-spec v1.1.0/go.mod h1:W4s4sFTMaBeK1BQLXbG4AdM2szdn85PY75RI83NrTrM= +github.com/opencontainers/image-spec v1.1.1 h1:y0fUlFfIZhPF1W537XOLg0/fcx6zcHCJwooC2xJA040= +github.com/opencontainers/image-spec v1.1.1/go.mod h1:qpqAh3Dmcf36wStyyWU+kCeDgrGnAve2nCC8+7h8Q0M= github.com/opencontainers/runtime-spec v1.2.0 h1:z97+pHb3uELt/yiAWD691HNHQIF07bE7dzrbT927iTk= github.com/opencontainers/runtime-spec v1.2.0/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= -github.com/operator-framework/api v0.29.0 h1:TxAR8RCO+I4FjRrY4PSMgnlmbxNWeD8pzHXp7xwHNmw= -github.com/operator-framework/api v0.29.0/go.mod h1:0whQE4mpMDd2zyHkQe+bFa3DLoRs6oGWCbu8dY/3pyc= +github.com/operator-framework/api v0.30.0 h1:44hCmGnEnZk/Miol5o44dhSldNH0EToQUG7vZTl29kk= +github.com/operator-framework/api v0.30.0/go.mod h1:FYxAPhjtlXSAty/fbn5YJnFagt6SpJZJgFNNbvDe5W0= github.com/otiai10/copy v1.14.1 h1:5/7E6qsUMBaH5AnQ0sSLzzTg1oTECmcCmT6lvF45Na8= github.com/otiai10/copy v1.14.1/go.mod h1:oQwrEDDOci3IM8dJF0d8+jnbfPDllW6vUjNc3DoZm9I= github.com/otiai10/mint v1.6.3 h1:87qsV/aw1F5as1eH1zS/yqHY85ANKVMgkDrf9rcxbQs= @@ -345,8 +348,8 @@ github.com/redis/go-redis/extra/rediscmd/v9 v9.0.5/go.mod h1:fyalQWdtzDBECAQFBJu github.com/redis/go-redis/extra/redisotel/v9 v9.0.5 h1:EfpWLLCyXw8PSM2/XNJLjI3Pb27yVE+gIAfeqp8LUCc= github.com/redis/go-redis/extra/redisotel/v9 v9.0.5/go.mod h1:WZjPDy7VNzn77AAfnAfVjZNvfJTYfPetfZk5yoSTLaQ= github.com/redis/go-redis/v9 v9.0.5/go.mod h1:WqMKv5vnQbRuZstUwxQI195wHy+t4PuXDOjzMvcuQHk= -github.com/redis/go-redis/v9 v9.1.0 h1:137FnGdk+EQdCbye1FW+qOEcY5S+SpY9T0NiuqvtfMY= -github.com/redis/go-redis/v9 v9.1.0/go.mod h1:urWj3He21Dj5k4TK1y59xH8Uj6ATueP8AH1cY3lZl4c= +github.com/redis/go-redis/v9 v9.7.3 h1:YpPyAayJV+XErNsatSElgRZZVCwXX9QzkKYNvO7x0wM= +github.com/redis/go-redis/v9 v9.7.3/go.mod h1:bGUrSggJ9X9GUmZpZNEOQKaANxSGgOEBRltRTZHSvrA= github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= @@ -356,10 +359,10 @@ github.com/sclevine/spec v1.4.0/go.mod h1:LvpgJaFyvQzRvc1kaDs0bulYwzC70PbiYjC4Qn github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= -github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= -github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= -github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/cobra v1.9.1 h1:CXSaggrXdbHK9CF+8ywj8Amf7PBRmPCOJugH954Nnlo= +github.com/spf13/cobra v1.9.1/go.mod h1:nDyEzZ8ogv936Cinf6g1RU9MRY64Ir93oCnqb9wxYW0= +github.com/spf13/pflag v1.0.6 h1:jFzHGLGAlb3ruxLB8MhbI6A8+AQX/2eW4qeyNZXNp2o= +github.com/spf13/pflag v1.0.6/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spiffe/go-spiffe/v2 v2.4.0 h1:j/FynG7hi2azrBG5cvjRcnQ4sux/VNj8FAVc99Fl66c= github.com/spiffe/go-spiffe/v2 v2.4.0/go.mod h1:m5qJ1hGzjxjtrkGHZupoXHo/FDWwCB1MdSyBzfHugx0= github.com/stoewer/go-strcase v1.3.0 h1:g0eASXYtp+yvN9fK8sH94oCIk0fau9uV1/ZdJ0AVEzs= @@ -380,8 +383,8 @@ github.com/tidwall/btree v1.7.0 h1:L1fkJH/AuEh5zBnnBbmTwQ5Lt+bRJ5A8EWecslvo9iI= github.com/tidwall/btree v1.7.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY= github.com/ulikunitz/xz v0.5.12 h1:37Nm15o69RwBkXM0J6A5OlE67RZTfzUxTj8fB3dfcsc= github.com/ulikunitz/xz v0.5.12/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= -github.com/vbatts/tar-split v0.11.6 h1:4SjTW5+PU11n6fZenf2IPoV8/tz3AaYHMWjf23envGs= -github.com/vbatts/tar-split v0.11.6/go.mod h1:dqKNtesIOr2j2Qv3W/cHjnvk9I8+G7oAkFDFN6TCBEI= +github.com/vbatts/tar-split v0.11.7 h1:ixZ93pO/GmvaZw4Vq9OwmfZK/kc2zKdPfu0B+gYqs3U= +github.com/vbatts/tar-split v0.11.7/go.mod h1:eF6B6i6ftWQcDqEn3/iGFRFRo8cBIMSJVOpnNdfTMFA= github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -389,8 +392,8 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/zeebo/errs v1.3.0 h1:hmiaKqgYZzcVgRL1Vkc1Mn2914BbzB0IBxs+ebeutGs= github.com/zeebo/errs v1.3.0/go.mod h1:sgbWHsvVuTPHcqJJGQ1WhI5KbWlHYz+2+2C/LSEtCw4= -go.etcd.io/bbolt v1.3.11 h1:yGEzV1wPz2yVCLsD8ZAiGHhHVlczyC9d1rP43/VCRJ0= -go.etcd.io/bbolt v1.3.11/go.mod h1:dksAq7YMXoljX0xu6VF5DMZGbhYYoLUalEiSySYAS4I= +go.etcd.io/bbolt v1.4.0 h1:TU77id3TnN/zKr7CO/uk+fBCwF2jGcMuw2B/FMAzYIk= +go.etcd.io/bbolt v1.4.0/go.mod h1:AsD+OCi/qPN1giOX1aiLAha3o1U8rAz65bvN4j0sRuk= go.etcd.io/etcd/api/v3 v3.5.16 h1:WvmyJVbjWqK4R1E+B12RRHz3bRGy9XVfh++MgbN+6n0= go.etcd.io/etcd/api/v3 v3.5.16/go.mod h1:1P4SlIP/VwkDmGo3OlOD7faPeP8KDIFhqvciH5EfN28= go.etcd.io/etcd/client/pkg/v3 v3.5.16 h1:ZgY48uH6UvB+/7R9Yf4x574uCO3jIx0TRDyetSfId3Q= @@ -399,6 +402,8 @@ go.etcd.io/etcd/client/v3 v3.5.16 h1:sSmVYOAHeC9doqi0gv7v86oY/BTld0SEFGaxsU9eRhE go.etcd.io/etcd/client/v3 v3.5.16/go.mod h1:X+rExSGkyqxvu276cr2OwPLBaeqFu1cIl4vmRjAD/50= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= +go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA= +go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A= go.opentelemetry.io/contrib/bridges/prometheus v0.57.0 h1:UW0+QyeyBVhn+COBec3nGhfnFe5lwB0ic1JBVjzhk0w= go.opentelemetry.io/contrib/bridges/prometheus v0.57.0/go.mod h1:ppciCHRLsyCio54qbzQv0E4Jyth/fLWDTJYfvWpcSVk= go.opentelemetry.io/contrib/exporters/autoexport v0.57.0 h1:jmTVJ86dP60C01K3slFQa2NQ/Aoi7zA+wy7vMOKD9H4= @@ -407,8 +412,8 @@ go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.5 go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0/go.mod h1:B9yO6b04uB80CzjedvewuqDhxJxi11s7/GtiGa8bAjI= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.57.0 h1:DheMAlT6POBP+gh8RUH19EOTnQIor5QE0uSRPtzCpSw= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.57.0/go.mod h1:wZcGmeVO9nzP67aYSLDqXNWK87EZWhi7JWj1v7ZXf94= -go.opentelemetry.io/otel v1.32.0 h1:WnBN+Xjcteh0zdk01SVqV55d/m62NJLJdIyb4y/WO5U= -go.opentelemetry.io/otel v1.32.0/go.mod h1:00DCVSB0RQcnzlwyTfqtxSm+DRr9hpYrHjNGiBHVQIg= +go.opentelemetry.io/otel v1.34.0 h1:zRLXxLCgL1WyKsPVrgbSdMN4c0FMkDAskSTQP+0hdUY= +go.opentelemetry.io/otel v1.34.0/go.mod h1:OWFPOQ+h4G8xpyjgqo4SxJYdDQ/qmRH+wivy7zzx9oI= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.8.0 h1:WzNab7hOOLzdDF/EoWCt4glhrbMPVMOO5JYTmpz36Ls= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.8.0/go.mod h1:hKvJwTzJdp90Vh7p6q/9PAOd55dI6WA6sWj62a/JvSs= go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.8.0 h1:S+LdBGiQXtJdowoJoQPEtI52syEP/JYBUpjO49EQhV8= @@ -433,16 +438,16 @@ go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.32.0 h1:cC2yDI3IQd0Udsu go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.32.0/go.mod h1:2PD5Ex6z8CFzDbTdOlwyNIUywRr1DN0ospafJM1wJ+s= go.opentelemetry.io/otel/log v0.8.0 h1:egZ8vV5atrUWUbnSsHn6vB8R21G2wrKqNiDt3iWertk= go.opentelemetry.io/otel/log v0.8.0/go.mod h1:M9qvDdUTRCopJcGRKg57+JSQ9LgLBrwwfC32epk5NX8= -go.opentelemetry.io/otel/metric v1.32.0 h1:xV2umtmNcThh2/a/aCP+h64Xx5wsj8qqnkYZktzNa0M= -go.opentelemetry.io/otel/metric v1.32.0/go.mod h1:jH7CIbbK6SH2V2wE16W05BHCtIDzauciCRLoc/SyMv8= -go.opentelemetry.io/otel/sdk v1.32.0 h1:RNxepc9vK59A8XsgZQouW8ue8Gkb4jpWtJm9ge5lEG4= -go.opentelemetry.io/otel/sdk v1.32.0/go.mod h1:LqgegDBjKMmb2GC6/PrTnteJG39I8/vJCAP9LlJXEjU= +go.opentelemetry.io/otel/metric v1.34.0 h1:+eTR3U0MyfWjRDhmFMxe2SsW64QrZ84AOhvqS7Y+PoQ= +go.opentelemetry.io/otel/metric v1.34.0/go.mod h1:CEDrp0fy2D0MvkXE+dPV7cMi8tWZwX3dmaIhwPOaqHE= +go.opentelemetry.io/otel/sdk v1.34.0 h1:95zS4k/2GOy069d321O8jWgYsW3MzVV+KuSPKp7Wr1A= +go.opentelemetry.io/otel/sdk v1.34.0/go.mod h1:0e/pNiaMAqaykJGKbi+tSjWfNNHMTxoC9qANsCzbyxU= go.opentelemetry.io/otel/sdk/log v0.8.0 h1:zg7GUYXqxk1jnGF/dTdLPrK06xJdrXgqgFLnI4Crxvs= go.opentelemetry.io/otel/sdk/log v0.8.0/go.mod h1:50iXr0UVwQrYS45KbruFrEt4LvAdCaWWgIrsN3ZQggo= -go.opentelemetry.io/otel/sdk/metric v1.32.0 h1:rZvFnvmvawYb0alrYkjraqJq0Z4ZUJAiyYCU9snn1CU= -go.opentelemetry.io/otel/sdk/metric v1.32.0/go.mod h1:PWeZlq0zt9YkYAp3gjKZ0eicRYvOh1Gd+X99x6GHpCQ= -go.opentelemetry.io/otel/trace v1.32.0 h1:WIC9mYrXf8TmY/EXuULKc8hR17vE+Hjv2cssQDe03fM= -go.opentelemetry.io/otel/trace v1.32.0/go.mod h1:+i4rkvCraA+tG6AzwloGaCtkx53Fa+L+V8e9a7YvhT8= +go.opentelemetry.io/otel/sdk/metric v1.34.0 h1:5CeK9ujjbFVL5c1PhLuStg1wxA7vQv7ce1EK0Gyvahk= +go.opentelemetry.io/otel/sdk/metric v1.34.0/go.mod h1:jQ/r8Ze28zRKoNRdkjCZxfs6YvBTG1+YIqyFVFYec5w= +go.opentelemetry.io/otel/trace v1.34.0 h1:+ouXS2V8Rd4hp4580a8q23bg0azF2nI8cqLYnC8mh/k= +go.opentelemetry.io/otel/trace v1.34.0/go.mod h1:Svm7lSjQD7kG7KJ/MUHPVXSDGz2OX4h0M2jHBhmSfRE= go.opentelemetry.io/proto/otlp v1.3.1 h1:TrMUixzpM0yuc/znrFTP9MMRh8trP93mkCiDVeXrui0= go.opentelemetry.io/proto/otlp v1.3.1/go.mod h1:0X1WI4de4ZsLrrJNLAQbFeLCm3T7yBkR0XqQ7niQU+8= go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= @@ -457,19 +462,19 @@ golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc= -golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc= +golang.org/x/crypto v0.36.0 h1:AnAEvhDddvBdpY+uR+MyHmuZzzNqXSe/GvuDeob5L34= +golang.org/x/crypto v0.36.0/go.mod h1:Y4J0ReaxCR1IMaabaSMugxJES1EpwhBHhv2bDHklZvc= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c h1:7dEasQXItcW1xKJ2+gg5VOiBnqWrJc+rq0DPKyvvdbY= -golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c/go.mod h1:NQtJDoLvd6faHhE7m4T/1IY708gDefGGjR/iUW8yQQ8= +golang.org/x/exp v0.0.0-20250103183323-7d7fa50e5329 h1:9kj3STMvgqy3YA4VQXBrN7925ICMxD5wzMRcgA30588= +golang.org/x/exp v0.0.0-20250103183323-7d7fa50e5329/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4= -golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= +golang.org/x/mod v0.24.0 h1:ZfthKaKaT4NrhGVZHO1/WDTwGES4De8KtWO0SIbNJMU= +golang.org/x/mod v0.24.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -482,11 +487,11 @@ golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= -golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= +golang.org/x/net v0.37.0 h1:1zLorHbz+LYj7MQlSf1+2tPIIgibq2eL5xkrGk6f+2c= +golang.org/x/net v0.37.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.23.0 h1:PbgcYx2W7i4LvjJWEbf0ngHV6qJYr86PkAV3bXdLEbs= -golang.org/x/oauth2 v0.23.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= +golang.org/x/oauth2 v0.28.0 h1:CrgCKl8PPAVtLnU3c+EDw6x11699EWlsDeWNWKdIOkc= +golang.org/x/oauth2 v0.28.0/go.mod h1:onh5ek6nERTohokkhCD/y2cV4Do3fxFHFuAejCkRWT8= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -494,8 +499,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= -golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.13.0 h1:AauUjRAJ9OSnvULf/ARrrVywoJDy0YS2AwQ98I37610= +golang.org/x/sync v0.13.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -509,15 +514,15 @@ golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= -golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.32.0 h1:s77OFDvIQeibCmezSnk/q6iAfkdiQaJi4VzroCFrN20= +golang.org/x/sys v0.32.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.28.0 h1:/Ts8HFuMR2E6IP/jlo7QVLZHggjKQbhu/7H0LJFr3Gg= -golang.org/x/term v0.28.0/go.mod h1:Sw/lC2IAUZ92udQNf3WodGtn4k/XoLyZoh8v/8uiwek= +golang.org/x/term v0.30.0 h1:PQ39fJZ+mfadBm0y5WlL4vlM7Sx1Hgf13sMIY2+QS9Y= +golang.org/x/term v0.30.0/go.mod h1:NYYFdzHoI5wRh/h5tDMdMqCqPJZEuNqVR5xJLd/n67g= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= -golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= +golang.org/x/text v0.24.0 h1:dd5Bzh4yt5KYA8f9CJHCP4FB4D51c2c6JvN37xJJkJ0= +golang.org/x/text v0.24.0/go.mod h1:L8rBsPeo2pSS+xqN0d5u2ikmjtmoJbDBT1b7nHvFCdU= golang.org/x/time v0.7.0 h1:ntUhktv3OPE6TgYxXWv9vKvUSJyIFJlyohwbkEwPrKQ= golang.org/x/time v0.7.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -529,8 +534,8 @@ golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.29.0 h1:Xx0h3TtM9rzQpQuR4dKLrdglAmCEN5Oi+P74JdhdzXE= -golang.org/x/tools v0.29.0/go.mod h1:KMQVMRsVxU6nHCFXrBPhDB8XncLNLM0lIy/F14RP588= +golang.org/x/tools v0.30.0 h1:BgcpHewrV5AUp2G9MebG4XPFI1E2W41zU1SaqVA9vJY= +golang.org/x/tools v0.30.0/go.mod h1:c347cR/OJfw5TI+GfX7RUPNMdDRRbjvYTS0jPyvsVtY= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -542,17 +547,17 @@ google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98 google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20240903143218-8af14fe29dc1 h1:BulPr26Jqjnd4eYDVe+YvyR7Yc2vJGkO5/0UxD0/jZU= google.golang.org/genproto v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:hL97c3SYopEHblzpxRL4lSs523++l8DYxGM1FQiYmb4= -google.golang.org/genproto/googleapis/api v0.0.0-20241104194629-dd2ea8efbc28 h1:M0KvPgPmDZHPlbRbaNU1APr28TvwvvdUPlSv7PUvy8g= -google.golang.org/genproto/googleapis/api v0.0.0-20241104194629-dd2ea8efbc28/go.mod h1:dguCy7UOdZhTvLzDyt15+rOrawrpM4q7DD9dQ1P11P4= -google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 h1:XVhgTWWV3kGQlwJHR3upFWZeTsei6Oks1apkZSeonIE= -google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28/go.mod h1:GX3210XPVPUjJbTUbvwI8f2IpZDMZuPJWDzDuebbviI= +google.golang.org/genproto/googleapis/api v0.0.0-20250303144028-a0af3efb3deb h1:p31xT4yrYrSM/G4Sn2+TNUkVhFCbG9y8itM2S6Th950= +google.golang.org/genproto/googleapis/api v0.0.0-20250303144028-a0af3efb3deb/go.mod h1:jbe3Bkdp+Dh2IrslsFCklNhweNTBgSYanP1UXhJDhKg= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250227231956-55c901821b1e h1:YA5lmSs3zc/5w+xsRcHqpETkaYyK63ivEPzNTcUUlSA= +google.golang.org/genproto/googleapis/rpc v0.0.0-20250227231956-55c901821b1e/go.mod h1:LuRYeWDFV6WOn90g357N17oMCaxpgCnbi/44qJvDn2I= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.69.4 h1:MF5TftSMkd8GLw/m0KM6V8CMOCY6NZ1NQDPGFgbTt4A= -google.golang.org/grpc v1.69.4/go.mod h1:vyjdE6jLBI76dgpDojsFGNaHlxdjXN9ghpnd2o7JGZ4= +google.golang.org/grpc v1.71.0 h1:kF77BGdPTQ4/JZWMlb9VpJ5pa25aqvVqogsxNHHdeBg= +google.golang.org/grpc v1.71.0/go.mod h1:H0GRtasmQOh9LkFoCPDu3ZrwUtD1YGE+b2vYBYd/8Ec= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.5.1 h1:F29+wU6Ee6qgu9TddPgooOdaqsxTMunOoj8KA5yuS5A= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.5.1/go.mod h1:5KF+wpkbTSbGcR9zteSqZV6fqFOWBl4Yde8En8MryZA= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= @@ -564,8 +569,8 @@ google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2 google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= -google.golang.org/protobuf v1.36.3 h1:82DV7MYdb8anAVi3qge1wSnMDrnKK7ebr+I0hHRN1BU= -google.golang.org/protobuf v1.36.3/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= +google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY= +google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= @@ -587,20 +592,20 @@ gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU= gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -k8s.io/api v0.32.1 h1:f562zw9cy+GvXzXf0CKlVQ7yHJVYzLfL6JAS4kOAaOc= -k8s.io/api v0.32.1/go.mod h1:/Yi/BqkuueW1BgpoePYBRdDYfjPF5sgTr5+YqDZra5k= -k8s.io/apiextensions-apiserver v0.32.1 h1:hjkALhRUeCariC8DiVmb5jj0VjIc1N0DREP32+6UXZw= -k8s.io/apiextensions-apiserver v0.32.1/go.mod h1:sxWIGuGiYov7Io1fAS2X06NjMIk5CbRHc2StSmbaQto= -k8s.io/apimachinery v0.32.1 h1:683ENpaCBjma4CYqsmZyhEzrGz6cjn1MY/X2jB2hkZs= -k8s.io/apimachinery v0.32.1/go.mod h1:GpHVgxoKlTxClKcteaeuF1Ul/lDVb74KpZcxcmLDElE= -k8s.io/apiserver v0.32.1 h1:oo0OozRos66WFq87Zc5tclUX2r0mymoVHRq8JmR7Aak= -k8s.io/apiserver v0.32.1/go.mod h1:UcB9tWjBY7aryeI5zAgzVJB/6k7E97bkr1RgqDz0jPw= +k8s.io/api v0.32.3 h1:Hw7KqxRusq+6QSplE3NYG4MBxZw1BZnq4aP4cJVINls= +k8s.io/api v0.32.3/go.mod h1:2wEDTXADtm/HA7CCMD8D8bK4yuBUptzaRhYcYEEYA3k= +k8s.io/apiextensions-apiserver v0.32.3 h1:4D8vy+9GWerlErCwVIbcQjsWunF9SUGNu7O7hiQTyPY= +k8s.io/apiextensions-apiserver v0.32.3/go.mod h1:8YwcvVRMVzw0r1Stc7XfGAzB/SIVLunqApySV5V7Dss= +k8s.io/apimachinery v0.32.3 h1:JmDuDarhDmA/Li7j3aPrwhpNBA94Nvk5zLeOge9HH1U= +k8s.io/apimachinery v0.32.3/go.mod h1:GpHVgxoKlTxClKcteaeuF1Ul/lDVb74KpZcxcmLDElE= +k8s.io/apiserver v0.32.3 h1:kOw2KBuHOA+wetX1MkmrxgBr648ksz653j26ESuWNY8= +k8s.io/apiserver v0.32.3/go.mod h1:q1x9B8E/WzShF49wh3ADOh6muSfpmFL0I2t+TG0Zdgc= k8s.io/cli-runtime v0.32.0 h1:dP+OZqs7zHPpGQMCGAhectbHU2SNCuZtIimRKTv2T1c= k8s.io/cli-runtime v0.32.0/go.mod h1:Mai8ht2+esoDRK5hr861KRy6z0zHsSTYttNVJXgP3YQ= -k8s.io/client-go v0.32.1 h1:otM0AxdhdBIaQh7l1Q0jQpmo7WOFIk5FFa4bg6YMdUU= -k8s.io/client-go v0.32.1/go.mod h1:aTTKZY7MdxUaJ/KiUs8D+GssR9zJZi77ZqtzcGXIiDg= -k8s.io/component-base v0.32.1 h1:/5IfJ0dHIKBWysGV0yKTFfacZ5yNV1sulPh3ilJjRZk= -k8s.io/component-base v0.32.1/go.mod h1:j1iMMHi/sqAHeG5z+O9BFNCF698a1u0186zkjMZQ28w= +k8s.io/client-go v0.32.3 h1:RKPVltzopkSgHS7aS98QdscAgtgah/+zmpAogooIqVU= +k8s.io/client-go v0.32.3/go.mod h1:3v0+3k4IcT9bXTc4V2rt+d2ZPPG700Xy6Oi0Gdl2PaY= +k8s.io/component-base v0.32.3 h1:98WJvvMs3QZ2LYHBzvltFSeJjEx7t5+8s71P7M74u8k= +k8s.io/component-base v0.32.3/go.mod h1:LWi9cR+yPAv7cu2X9rZanTiFKB2kHA+JjmhkKjCZRpI= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f h1:GA7//TjRY9yWGy1poLzYYJJ4JRdzg3+O6e8I+e+8T5Y= @@ -611,12 +616,12 @@ k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 h1:M3sRQVHv7vB20Xc2ybTt7ODCeFj6J k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.0 h1:CPT0ExVicCzcpeN4baWEV2ko2Z/AsiZgEdwgcfwLgMo= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.0/go.mod h1:Ve9uj1L+deCXFrPOk1LpFXqTg7LCFzFso6PA48q/XZw= -sigs.k8s.io/controller-runtime v0.19.4 h1:SUmheabttt0nx8uJtoII4oIP27BVVvAKFvdvGFwV/Qo= -sigs.k8s.io/controller-runtime v0.19.4/go.mod h1:iRmWllt8IlaLjvTTDLhRBXIEtkCK6hwVBJJsYS9Ajf4= +sigs.k8s.io/controller-runtime v0.20.4 h1:X3c+Odnxz+iPTRobG4tp092+CvBU9UK0t/bRf+n0DGU= +sigs.k8s.io/controller-runtime v0.20.4/go.mod h1:xg2XB0K5ShQzAgsoujxuKN4LNXR2LfwwHsPj7Iaw+XY= sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 h1:/Rv+M11QRah1itp8VhT6HoVx1Ray9eB4DBr+K+/sCJ8= sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3/go.mod h1:18nIHnGi6636UCz6m8i4DhaJ65T6EruyzmoQqI2BVDo= -sigs.k8s.io/kind v0.26.0 h1:8fS6I0Q5WGlmLprSpH0DarlOSdcsv0txnwc93J2BP7M= -sigs.k8s.io/kind v0.26.0/go.mod h1:t7ueEpzPYJvHA8aeLtI52rtFftNgUYUaCwvxjk7phfw= +sigs.k8s.io/kind v0.27.0 h1:PQ3f0iAWNIj66LYkZ1ivhEg/+Zb6UPMbO+qVei/INZA= +sigs.k8s.io/kind v0.27.0/go.mod h1:RZVFmy6qcwlSWwp6xeIUv7kXCPF3i8MXsEXxW/J+gJY= sigs.k8s.io/structured-merge-diff/v4 v4.4.2 h1:MdmvkGuXi/8io6ixD5wud3vOLwc1rj0aNqRlpuvjmwA= sigs.k8s.io/structured-merge-diff/v4 v4.4.2/go.mod h1:N8f93tFZh9U6vpxwRArLiikrE5/2tiu1w1AGfACIGE4= sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= diff --git a/pkg/api/api_to_model.go b/pkg/api/api_to_model.go index 5c0cb603a..50088ab4f 100644 --- a/pkg/api/api_to_model.go +++ b/pkg/api/api_to_model.go @@ -42,6 +42,7 @@ func ConvertAPIBundleToModelBundle(b *Bundle) (*model.Bundle, error) { } func convertAPIBundleToModelProperties(b *Bundle) ([]property.Property, error) { + // nolint:prealloc var out []property.Property providedGVKs := map[property.GVK]struct{}{} diff --git a/pkg/api/conversion_test.go b/pkg/api/conversion_test.go index 011c58298..3dee1c0a5 100644 --- a/pkg/api/conversion_test.go +++ b/pkg/api/conversion_test.go @@ -39,7 +39,7 @@ func TestConvertModelBundleToAPIBundle(t *testing.T) { } const ( - csvJson = "{\"apiVersion\":\"operators.coreos.com/v1alpha1\",\"kind\":\"ClusterServiceVersion\",\"metadata\":{\"annotations\":{\"alm-examples\":\"[\\n {\\n \\\"apiVersion\\\": \\\"etcd.database.coreos.com/v1beta2\\\",\\n \\\"kind\\\": \\\"EtcdCluster\\\",\\n \\\"metadata\\\": {\\n \\\"name\\\": \\\"example\\\"\\n },\\n \\\"spec\\\": {\\n \\\"size\\\": 3,\\n \\\"version\\\": \\\"3.2.13\\\"\\n }\\n },\\n {\\n \\\"apiVersion\\\": \\\"etcd.database.coreos.com/v1beta2\\\",\\n \\\"kind\\\": \\\"EtcdRestore\\\",\\n \\\"metadata\\\": {\\n \\\"name\\\": \\\"example-etcd-cluster-restore\\\"\\n },\\n \\\"spec\\\": {\\n \\\"etcdCluster\\\": {\\n \\\"name\\\": \\\"example-etcd-cluster\\\"\\n },\\n \\\"backupStorageType\\\": \\\"S3\\\",\\n \\\"s3\\\": {\\n \\\"path\\\": \\\"\\u003cfull-s3-path\\u003e\\\",\\n \\\"awsSecret\\\": \\\"\\u003caws-secret\\u003e\\\"\\n }\\n }\\n },\\n {\\n \\\"apiVersion\\\": \\\"etcd.database.coreos.com/v1beta2\\\",\\n \\\"kind\\\": \\\"EtcdBackup\\\",\\n \\\"metadata\\\": {\\n \\\"name\\\": \\\"example-etcd-cluster-backup\\\"\\n },\\n \\\"spec\\\": {\\n \\\"etcdEndpoints\\\": [\\\"\\u003cetcd-cluster-endpoints\\u003e\\\"],\\n \\\"storageType\\\":\\\"S3\\\",\\n \\\"s3\\\": {\\n \\\"path\\\": \\\"\\u003cfull-s3-path\\u003e\\\",\\n \\\"awsSecret\\\": \\\"\\u003caws-secret\\u003e\\\"\\n }\\n }\\n }\\n]\\n\",\"capabilities\":\"Full Lifecycle\",\"categories\":\"Database\",\"containerImage\":\"quay.io/coreos/etcd-operator@sha256:66a37fd61a06a43969854ee6d3e21087a98b93838e284a6086b13917f96b0d9b\",\"createdAt\":\"2019-02-28 01:03:00\",\"description\":\"Create and maintain highly-available etcd clusters on Kubernetes\",\"repository\":\"https://github.com/coreos/etcd-operator\",\"tectonic-visibility\":\"ocs\"},\"name\":\"etcdoperator.v0.9.4\",\"namespace\":\"placeholder\"},\"spec\":{\"relatedImages\":[{\"name\":\"etcdv0.9.4\",\"image\":\"quay.io/coreos/etcd-operator@sha256:66a37fd61a06a43969854ee6d3e21087a98b93838e284a6086b13917f96b0d9b\"}],\"customresourcedefinitions\":{\"owned\":[{\"description\":\"Represents a cluster of etcd nodes.\",\"displayName\":\"etcd Cluster\",\"kind\":\"EtcdCluster\",\"name\":\"etcdclusters.etcd.database.coreos.com\",\"resources\":[{\"kind\":\"Service\",\"version\":\"v1\"},{\"kind\":\"Pod\",\"version\":\"v1\"}],\"specDescriptors\":[{\"description\":\"The desired number of member Pods for the etcd cluster.\",\"displayName\":\"Size\",\"path\":\"size\",\"x-descriptors\":[\"urn:alm:descriptor:com.tectonic.ui:podCount\"]},{\"description\":\"Limits describes the minimum/maximum amount of compute resources required/allowed\",\"displayName\":\"Resource Requirements\",\"path\":\"pod.resources\",\"x-descriptors\":[\"urn:alm:descriptor:com.tectonic.ui:resourceRequirements\"]}],\"statusDescriptors\":[{\"description\":\"The status of each of the member Pods for the etcd cluster.\",\"displayName\":\"Member Status\",\"path\":\"members\",\"x-descriptors\":[\"urn:alm:descriptor:com.tectonic.ui:podStatuses\"]},{\"description\":\"The service at which the running etcd cluster can be accessed.\",\"displayName\":\"Service\",\"path\":\"serviceName\",\"x-descriptors\":[\"urn:alm:descriptor:io.kubernetes:Service\"]},{\"description\":\"The current size of the etcd cluster.\",\"displayName\":\"Cluster Size\",\"path\":\"size\"},{\"description\":\"The current version of the etcd cluster.\",\"displayName\":\"Current Version\",\"path\":\"currentVersion\"},{\"description\":\"The target version of the etcd cluster, after upgrading.\",\"displayName\":\"Target Version\",\"path\":\"targetVersion\"},{\"description\":\"The current status of the etcd cluster.\",\"displayName\":\"Status\",\"path\":\"phase\",\"x-descriptors\":[\"urn:alm:descriptor:io.kubernetes.phase\"]},{\"description\":\"Explanation for the current status of the cluster.\",\"displayName\":\"Status Details\",\"path\":\"reason\",\"x-descriptors\":[\"urn:alm:descriptor:io.kubernetes.phase:reason\"]}],\"version\":\"v1beta2\"},{\"description\":\"Represents the intent to backup an etcd cluster.\",\"displayName\":\"etcd Backup\",\"kind\":\"EtcdBackup\",\"name\":\"etcdbackups.etcd.database.coreos.com\",\"specDescriptors\":[{\"description\":\"Specifies the endpoints of an etcd cluster.\",\"displayName\":\"etcd Endpoint(s)\",\"path\":\"etcdEndpoints\",\"x-descriptors\":[\"urn:alm:descriptor:etcd:endpoint\"]},{\"description\":\"The full AWS S3 path where the backup is saved.\",\"displayName\":\"S3 Path\",\"path\":\"s3.path\",\"x-descriptors\":[\"urn:alm:descriptor:aws:s3:path\"]},{\"description\":\"The name of the secret object that stores the AWS credential and config files.\",\"displayName\":\"AWS Secret\",\"path\":\"s3.awsSecret\",\"x-descriptors\":[\"urn:alm:descriptor:io.kubernetes:Secret\"]}],\"statusDescriptors\":[{\"description\":\"Indicates if the backup was successful.\",\"displayName\":\"Succeeded\",\"path\":\"succeeded\",\"x-descriptors\":[\"urn:alm:descriptor:text\"]},{\"description\":\"Indicates the reason for any backup related failures.\",\"displayName\":\"Reason\",\"path\":\"reason\",\"x-descriptors\":[\"urn:alm:descriptor:io.kubernetes.phase:reason\"]}],\"version\":\"v1beta2\"},{\"description\":\"Represents the intent to restore an etcd cluster from a backup.\",\"displayName\":\"etcd Restore\",\"kind\":\"EtcdRestore\",\"name\":\"etcdrestores.etcd.database.coreos.com\",\"specDescriptors\":[{\"description\":\"References the EtcdCluster which should be restored,\",\"displayName\":\"etcd Cluster\",\"path\":\"etcdCluster.name\",\"x-descriptors\":[\"urn:alm:descriptor:io.kubernetes:EtcdCluster\",\"urn:alm:descriptor:text\"]},{\"description\":\"The full AWS S3 path where the backup is saved.\",\"displayName\":\"S3 Path\",\"path\":\"s3.path\",\"x-descriptors\":[\"urn:alm:descriptor:aws:s3:path\"]},{\"description\":\"The name of the secret object that stores the AWS credential and config files.\",\"displayName\":\"AWS Secret\",\"path\":\"s3.awsSecret\",\"x-descriptors\":[\"urn:alm:descriptor:io.kubernetes:Secret\"]}],\"statusDescriptors\":[{\"description\":\"Indicates if the restore was successful.\",\"displayName\":\"Succeeded\",\"path\":\"succeeded\",\"x-descriptors\":[\"urn:alm:descriptor:text\"]},{\"description\":\"Indicates the reason for any restore related failures.\",\"displayName\":\"Reason\",\"path\":\"reason\",\"x-descriptors\":[\"urn:alm:descriptor:io.kubernetes.phase:reason\"]}],\"version\":\"v1beta2\"}]},\"description\":\"The etcd Operater creates and maintains highly-available etcd clusters on Kubernetes, allowing engineers to easily deploy and manage etcd clusters for their applications.\\n\\netcd is a distributed key value store that provides a reliable way to store data across a cluster of machines. It’s open-source and available on GitHub. etcd gracefully handles leader elections during network partitions and will tolerate machine failure, including the leader.\\n\\n\\n### Reading and writing to etcd\\n\\nCommunicate with etcd though its command line utility `etcdctl` via port forwarding:\\n\\n $ kubectl --namespace default port-forward service/example-client 2379:2379\\n $ etcdctl --endpoints http://127.0.0.1:2379 get /\\n\\nOr directly to the API using the Kubernetes Service:\\n\\n $ etcdctl --endpoints http://example-client.default.svc:2379 get /\\n\\nBe sure to secure your etcd cluster (see Common Configurations) before exposing it outside of the namespace or cluster.\\n\\n\\n### Supported Features\\n\\n* **High availability** - Multiple instances of etcd are networked together and secured. Individual failures or networking issues are transparently handled to keep your cluster up and running.\\n\\n* **Automated updates** - Rolling out a new etcd version works like all Kubernetes rolling updates. Simply declare the desired version, and the etcd service starts a safe rolling update to the new version automatically.\\n\\n* **Backups included** - Create etcd backups and restore them through the etcd Operator.\\n\\n### Common Configurations\\n\\n* **Configure TLS** - Specify [static TLS certs](https://github.com/coreos/etcd-operator/blob/master/doc/user/cluster_tls.md) as Kubernetes secrets.\\n\\n* **Set Node Selector and Affinity** - [Spread your etcd Pods](https://github.com/coreos/etcd-operator/blob/master/doc/user/spec_examples.md#three-member-cluster-with-node-selector-and-anti-affinity-across-nodes) across Nodes and availability zones.\\n\\n* **Set Resource Limits** - [Set the Kubernetes limit and request](https://github.com/coreos/etcd-operator/blob/master/doc/user/spec_examples.md#three-member-cluster-with-resource-requirement) values for your etcd Pods.\\n\\n* **Customize Storage** - [Set a custom StorageClass](https://github.com/coreos/etcd-operator/blob/master/doc/user/spec_examples.md#custom-persistentvolumeclaim-definition) that you would like to use.\\n\",\"displayName\":\"etcd\",\"icon\":[{\"base64data\":\"iVBORw0KGgoAAAANSUhEUgAAAOEAAADZCAYAAADWmle6AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAEKlJREFUeNrsndt1GzkShmEev4sTgeiHfRYdgVqbgOgITEVgOgLTEQydwIiKwFQCayoCU6+7DyYjsBiBFyVVz7RkXvqCSxXw/+f04XjGQ6IL+FBVuL769euXgZ7r39f/G9iP0X+u/jWDNZzZdGI/Ftama1jjuV4BwmcNpbAf1Fgu+V/9YRvNAyzT2a59+/GT/3hnn5m16wKWedJrmOCxkYztx9Q+py/+E0GJxtJdReWfz+mxNt+QzS2Mc0AI+HbBBwj9QViKbH5t64DsP2fvmGXUkWU4WgO+Uve2YQzBUGd7r+zH2ZG/tiUQc4QxKwgbwFfVGwwmdLL5wH78aPC/ZBem9jJpCAX3xtcNASSNgJLzUPSQyjB1zQNl8IQJ9MIU4lx2+Jo72ysXYKl1HSzN02BMa/vbZ5xyNJIshJzwf3L0dQhJw4Sih/SFw9Tk8sVeghVPoefaIYCkMZCKbrcP9lnZuk0uPUjGE/KE8JQry7W2tgfuC3vXgvNV+qSQbyFtAtyWk7zWiYevvuUQ9QEQCvJ+5mmu6dTjz1zFHLFj8Eb87MtxaZh/IQFIHom+9vgTWwZxAQjT9X4vtbEVPojwjiV471s00mhAckpwGuCn1HtFtRDaSh6y9zsL+LNBvCG/24ThcxHObdlWc1v+VQJe8LcO0jwtuF8BwnAAUgP9M8JPU2Me+Oh12auPGT6fHuTePE3bLDy+x9pTLnhMn+07TQGh//Bz1iI0c6kvtqInjvPZcYR3KsPVmUsPYt9nFig9SCY8VQNhpPBzn952bbgcsk2EvM89wzh3UEffBbyPqvBUBYQ8ODGPFOLsa7RF096WJ69L+E4EmnpjWu5o4ChlKaRTKT39RMMaVPEQRsz/nIWlDN80chjdJlSd1l0pJCAMVZsniobQVuxceMM9OFoaMd9zqZtjMEYYDW38Drb8Y0DYPLShxn0pvIFuOSxd7YCPet9zk452wsh54FJoeN05hcgSQoG5RR0Qh9Q4E4VvL4wcZq8UACgaRFEQKgSwWrkr5WFnGxiHSutqJGlXjBgIOayhwYBTA0ER0oisIVSUV0AAMT0IASCUO4hRIQSAEECMCCEPwqyQA0JCQBzEGjWNAqHiUVAoXUWbvggOIQCEAOJzxTjoaQ4AIaE64/aZridUsBYUgkhB15oGg1DBIl8IqirYwV6hPSGBSFteMCUBSVXwfYixBmamRubeMyjzMJQBDDowE3OesDD+zwqFoDqiEwXoXJpljB+PvWJGy75BKF1FPxhKygJuqUdYQGlLxNEXkrYyjQ0GbaAwEnUIlLRNvVjQDYUAsJB0HKLE4y0AIpQNgCIhBIhQTgCKhZBBpAN/v6LtQI50JfUgYOnnjmLUFHKhjxbAmdTCaTiBm3ovLPqG2urWAij6im0Nd9aTN9ygLUEt9LgSRnohxUPIKxlGaE+/6Y7znFf0yX+GnkvFFWmarkab2o9PmTeq8sbd2a7DaysXz7i64VeznN4jCQhN9gdDbRiuWrfrsq0mHIrlaq+hlotCtd3Um9u0BYWY8y5D67wccJoZjFca7iUs9VqZcfsZwTd1sbWGG+OcYaTnPAP7rTQVVlM4Sg3oGvB1tmNh0t/HKXZ1jFoIMwCQjtqbhNxUmkGYqgZEDZP11HN/S3gAYRozf0l8C5kKEKUvW0t1IfeWG/5MwgheZTT1E0AEhDkAePQO+Ig2H3DncAkQM4cwUQCD530dU4B5Yvmi2LlDqXfWrxMCcMth51RToRMNUXFnfc2KJ0+Ryl0VNOUwlhh6NoxK5gnViTgQpUG4SqSyt5z3zRJpuKmt3Q1614QaCBPaN6je+2XiFcWAKOXcUfIYKRyL/1lb7pe5VxSxxjQ6hImshqGRt5GWZVKO6q2wHwujfwDtIvaIdexj8Cm8+a68EqMfox6x/voMouZF4dHnEGNeCDMwT6vdNfekH1MafMk4PI06YtqLVGl95aEM9Z5vAeCTOA++YLtoVJRrsqNCaJ6WRmkdYaNec5BT/lcTRMqrhmwfjbpkj55+OKp8IEbU/JLgPJE6Wa3TTe9sHS+ShVD5QIyqIxMEwKh12olC6mHIed5ewEop80CNlfIOADYOT2nd6ZXCop+Ebqchc0JqxKcKASxChycJgUh1rnHA5ow9eTrhqNI7JWiAYYwBGGdpyNLoGw0Pkh96h1BpHihyywtATDM/7Hk2fN9EnH8BgKJCU4ooBkbXFMZJiPbrOyecGl3zgQDQL4hk10IZiOe+5w99Q/gBAEIJgPhJM4QAEEoFREAIAAEiIASAkD8Qt4AQAEIAERAGFlX4CACKAXGVM4ivMwWwCLFAlyeoaa70QePKm5Dlp+/n+ye/5dYgva6YsUaVeMa+tzNFeJtWwc+udbJ0Fg399kLielQJ5Ze61c2+7ytA6EZetiPxZC6tj22yJCv6jUwOyj/zcbqAxOMyAKEbfeHtNa7DtYXptjsk2kJxR+eIeim/tHNofUKYy8DMrQcAKWz6brpvzyIAlpwPhQ49l6b7skJf5Z+YTOYQc4FwLDxvoTDwaygQK+U/kVr+ytSFBG01Q3gnJJR4cNiAhx4HDub8/b5DULXlj6SVZghFiE+LdvE9vo/o8Lp1RmH5hzm0T6wdbZ6n+D6i44zDRc3ln6CpAEJfXiRU45oqLz8gFAThWsh7ughrRibc0QynHgZpNJa/ENJ+loCwu/qOGnFIjYR/n7TfgycULhcQhu6VC+HfF+L3BoAQ4WiZTw1M+FPCnA2gKC6/FAhXgDC+ojQGh3NuWsvfF1L/D5ohlCKtl1j2ldu9a/nPAKFwN56Bst10zCG0CPleXN/zXPgHQZXaZaBgrbzyY5V/mUA+6F0hwtGN9rwu5DVZPuwWqfxdFz1LWbJ2lwKEa+0Qsm4Dl3fp+Pu0lV97PgwIPfSsS+UQhj5Oo+vvFULazRIQyvGEcxPuNLCth2MvFsrKn8UOilAQShkh7TTczYNMoS6OdP47msrPi82lXKGWhCdMZYS0bFy+vcnGAjP1CIfvgbKNA9glecEH9RD6Ol4wRuWyN/G9MHnksS6o/GPf5XcwNSUlHzQhDuAKtWJmkwKElU7lylP5rgIcsquh/FI8YZCDpkJBuE4FQm7Icw8N+SrUGaQKyi8FwiDt1ve5o+Vu7qYHy/psgK8cvh+FTYuO77bhEC7GuaPiys/L1X4IgXDL+e3M5+ovLxBy5VLuIebw1oqcHoPfoaMJUsHays878r8KbDc3xtPx/84gZPBG/JwaufrsY/SRG/OY3//8QMNdsvdZCFtbW6f8pFuf5bflILAlX7O+4fdfugKyFYS8T2zAsXthdG0VurPGKwI06oF5vkBgHWkNp6ry29+lsPZMU3vijnXFNmoclr+6+Ou/FIb8yb30sS8YGjmTqCLyQsi5N/6ZwKs0Yenj68pfPjF6N782Dp2FzV9CTyoSeY8mLK16qGxIkLI8oa1n8tz9juP40DlK0epxYEbojbq+9QfurBeVIlCO9D2396bxiV4lkYQ3hOAFw2pbhqMGISkkQOMcQ9EqhDmGZZdo92JC0YHRNTfoSg+5e0IT+opqCKHoIU+4ztQIgBD1EFNrQAgIpYSil9lDmPHqkROPt+JC6AgPquSuumJmg0YARVCuneDfvPVeJokZ6pIXDkNxQtGzTF9/BQjRG0tQznfb74RwCQghpALBtIQnfK4zhxdyQvVCUeknMIT3hLyY+T5jo0yABqKPQNpUNw/09tGZod5jgCaYFxyYvJcNPkv9eof+I3pnCFEHIETjSM8L9tHZHYCQT9PaZGycU6yg8S4akDnJ+P03L0+t23XGzCLzRgII/Wqa+fv/xlfvmKvMUOcOrlCDdoei1MGdZm6G5VEIfRzzjd4aQs69n699Rx7ewhvCGzr2gmTPs8zNsJOrXt24FbkhhOjCfT4ICA/rPbyhUy94Dks0gJCX1NzCZui9YUd3oei+c257TalFbgg19ILHrlrL2gvWgXAL26EX76gZTNASQnad8Ibwhl284NhgXpB0c+jKhWO3Ms1hP9ihJYB9eMF6qd1BCPk0qA1s+LimFIu7m4nsdQIzPK4VbQ8hYvrnuSH2G9b2ggP78QmWqBdF9Vx8SSY6QYdUW7BTA1schZATyhvY8lHvcRbNUS9YGFy2U+qmzh2YPVc0I7yAOFyHfRpyUwtCSzOdPXMHmz7qDIM0e0V2wZTEk+6Ym6N63eBLp/b5Bts+2cKCSJ/LuoZO3ANSiE5hKAZjnvNSS4931jcw9jpwT0feV/qSJ1pVtCyfHKDkvK8Ejx7pUxGh2xFNSwx8QTi2H9ceC0/nni64MS/5N5dG39pDqvRV+WgGk71c9VFXF9b+xYvOw/d61iv7m3MvEHryhvecwC52jSSx4VIIgwnMNT/UsTxIgpPt3K/ARj15CptwL3Zd/ceDSATj2DGQjbxgWwhdeMMte7zpy5On9vymRm/YxBYljGVjKWF9VJf7I1+sex3wY8w/V1QPTborW/72gkdsRDaZMJBdbdHIC7aCkAu9atlLbtnrzerMnyToDaGwelOnk3/hHSem/ZK7e/t7jeeR20LYBgqa8J80gS8jbwi5F02Uj1u2NYJxap8PLkJfLxA2hIJyvnHX/AfeEPLpBfe0uSFHbnXaea3Qd5d6HcpYZ8L6M7lnFwMQ3MNg+RxUR1+6AshtbsVgfXTEg1sIGax9UND2p7f270wdG3eK9gXVGHdw2k5sOyZv+Nbs39Z308XR9DqWb2J+PwKDhuKHPobfuXf7gnYGHdCs7bhDDadD4entDug7LWNsnRNW4mYqwJ9dk+GGSTPBiA2j0G8RWNM5upZtcG4/3vMfP7KnbK2egx6CCnDPhRn7NgD3cghLIad5WcM2SO38iqHvvMOosyeMpQ5zlVCaaj06GVs9xUbHdiKoqrHWgquFEFMWUEWfXUxJAML23hAHFOctmjZQffKD2pywkhtSGHKNtpitLroscAeE7kCkSsC60vxEl6yMtL9EL5HKGCMszU5bk8gdkklAyEn5FO0yK419rIxBOIqwFMooDE0tHEVYijAUECIshRCGIhxFWIowFJ5QkEYIS5PTJrUwNGlPyN6QQPyKtpuM1E/K5+YJDV/MiA3AaehzqgAm7QnZG9IGYKo8bHnSK7VblLL3hOwNHziPuEGOqE5brrdR6i+atCfckyeWD47HkAkepRGLY/e8A8J0gCwYSNypF08bBm+e6zVz2UL4AshhBUjML/rXLefqC82bcQFhGC9JDwZ1uuu+At0S5gCETYHsV4DUeD9fDN2Zfy5OXaW2zAwQygCzBLJ8cvaW5OXKC1FxfTggFAHmoAJnSiOw2wps9KwRWgJCLaEswaj5NqkLwAYIU4BxqTSXbHXpJdRMPZgAOiAMqABCNGYIEEJutEK5IUAIwYMDQgiCACEEAcJs1Vda7gGqDhCmoiEghAAhBAHCrKXVo2C1DCBMRlp37uMIEECoX7xrX3P5C9QiINSuIcoPAUI0YkAICLNWgfJDh4T9hH7zqYH9+JHAq7zBqWjwhPAicTVCVQJCNF50JghHocahKK0X/ZnQKyEkhSdUpzG8OgQI42qC94EQjsYLRSmH+pbgq73L6bYkeEJ4DYTYmeg1TOBFc/usTTp3V9DdEuXJ2xDCUbXhaXk0/kAYmBvuMB4qkC35E5e5AMKkwSQgyxufyuPy6fMMgAFCSI73LFXU/N8AmEL9X4ABACNSKMHAgb34AAAAAElFTkSuQmCC\",\"mediatype\":\"image/png\"}],\"install\":{\"spec\":{\"deployments\":[{\"name\":\"etcd-operator\",\"spec\":{\"replicas\":1,\"selector\":{\"matchLabels\":{\"name\":\"etcd-operator-alm-owned\"}},\"template\":{\"metadata\":{\"labels\":{\"name\":\"etcd-operator-alm-owned\"},\"name\":\"etcd-operator-alm-owned\"},\"spec\":{\"containers\":[{\"command\":[\"etcd-operator\",\"--create-crd=false\"],\"env\":[{\"name\":\"MY_POD_NAMESPACE\",\"valueFrom\":{\"fieldRef\":{\"fieldPath\":\"metadata.namespace\"}}},{\"name\":\"MY_POD_NAME\",\"valueFrom\":{\"fieldRef\":{\"fieldPath\":\"metadata.name\"}}}],\"image\":\"quay.io/coreos/etcd-operator@sha256:66a37fd61a06a43969854ee6d3e21087a98b93838e284a6086b13917f96b0d9b\",\"name\":\"etcd-operator\"},{\"command\":[\"etcd-backup-operator\",\"--create-crd=false\"],\"env\":[{\"name\":\"MY_POD_NAMESPACE\",\"valueFrom\":{\"fieldRef\":{\"fieldPath\":\"metadata.namespace\"}}},{\"name\":\"MY_POD_NAME\",\"valueFrom\":{\"fieldRef\":{\"fieldPath\":\"metadata.name\"}}}],\"image\":\"quay.io/coreos/etcd-operator@sha256:66a37fd61a06a43969854ee6d3e21087a98b93838e284a6086b13917f96b0d9b\",\"name\":\"etcd-backup-operator\"},{\"command\":[\"etcd-restore-operator\",\"--create-crd=false\"],\"env\":[{\"name\":\"MY_POD_NAMESPACE\",\"valueFrom\":{\"fieldRef\":{\"fieldPath\":\"metadata.namespace\"}}},{\"name\":\"MY_POD_NAME\",\"valueFrom\":{\"fieldRef\":{\"fieldPath\":\"metadata.name\"}}}],\"image\":\"quay.io/coreos/etcd-operator@sha256:66a37fd61a06a43969854ee6d3e21087a98b93838e284a6086b13917f96b0d9b\",\"name\":\"etcd-restore-operator\"}],\"serviceAccountName\":\"etcd-operator\"}}}}],\"permissions\":[{\"rules\":[{\"apiGroups\":[\"etcd.database.coreos.com\"],\"resources\":[\"etcdclusters\",\"etcdbackups\",\"etcdrestores\"],\"verbs\":[\"*\"]},{\"apiGroups\":[\"\"],\"resources\":[\"pods\",\"services\",\"endpoints\",\"persistentvolumeclaims\",\"events\"],\"verbs\":[\"*\"]},{\"apiGroups\":[\"apps\"],\"resources\":[\"deployments\"],\"verbs\":[\"*\"]},{\"apiGroups\":[\"\"],\"resources\":[\"secrets\"],\"verbs\":[\"get\"]}],\"serviceAccountName\":\"etcd-operator\"}]},\"strategy\":\"deployment\"},\"installModes\":[{\"supported\":true,\"type\":\"OwnNamespace\"},{\"supported\":true,\"type\":\"SingleNamespace\"},{\"supported\":false,\"type\":\"MultiNamespace\"},{\"supported\":false,\"type\":\"AllNamespaces\"}],\"keywords\":[\"etcd\",\"key value\",\"database\",\"coreos\",\"open source\"],\"labels\":{\"alm-owner-etcd\":\"etcdoperator\",\"operated-by\":\"etcdoperator\"},\"links\":[{\"name\":\"Blog\",\"url\":\"https://coreos.com/etcd\"},{\"name\":\"Documentation\",\"url\":\"https://coreos.com/operators/etcd/docs/latest/\"},{\"name\":\"etcd Operator Source Code\",\"url\":\"https://github.com/coreos/etcd-operator\"}],\"maintainers\":[{\"email\":\"etcd-dev@googlegroups.com\",\"name\":\"etcd Community\"}],\"maturity\":\"alpha\",\"provider\":{\"name\":\"CNCF\"},\"replaces\":\"etcdoperator.v0.9.2\",\"selector\":{\"matchLabels\":{\"alm-owner-etcd\":\"etcdoperator\",\"operated-by\":\"etcdoperator\"}},\"version\":\"0.9.4\"}}" + csvJSON = "{\"apiVersion\":\"operators.coreos.com/v1alpha1\",\"kind\":\"ClusterServiceVersion\",\"metadata\":{\"annotations\":{\"alm-examples\":\"[\\n {\\n \\\"apiVersion\\\": \\\"etcd.database.coreos.com/v1beta2\\\",\\n \\\"kind\\\": \\\"EtcdCluster\\\",\\n \\\"metadata\\\": {\\n \\\"name\\\": \\\"example\\\"\\n },\\n \\\"spec\\\": {\\n \\\"size\\\": 3,\\n \\\"version\\\": \\\"3.2.13\\\"\\n }\\n },\\n {\\n \\\"apiVersion\\\": \\\"etcd.database.coreos.com/v1beta2\\\",\\n \\\"kind\\\": \\\"EtcdRestore\\\",\\n \\\"metadata\\\": {\\n \\\"name\\\": \\\"example-etcd-cluster-restore\\\"\\n },\\n \\\"spec\\\": {\\n \\\"etcdCluster\\\": {\\n \\\"name\\\": \\\"example-etcd-cluster\\\"\\n },\\n \\\"backupStorageType\\\": \\\"S3\\\",\\n \\\"s3\\\": {\\n \\\"path\\\": \\\"\\u003cfull-s3-path\\u003e\\\",\\n \\\"awsSecret\\\": \\\"\\u003caws-secret\\u003e\\\"\\n }\\n }\\n },\\n {\\n \\\"apiVersion\\\": \\\"etcd.database.coreos.com/v1beta2\\\",\\n \\\"kind\\\": \\\"EtcdBackup\\\",\\n \\\"metadata\\\": {\\n \\\"name\\\": \\\"example-etcd-cluster-backup\\\"\\n },\\n \\\"spec\\\": {\\n \\\"etcdEndpoints\\\": [\\\"\\u003cetcd-cluster-endpoints\\u003e\\\"],\\n \\\"storageType\\\":\\\"S3\\\",\\n \\\"s3\\\": {\\n \\\"path\\\": \\\"\\u003cfull-s3-path\\u003e\\\",\\n \\\"awsSecret\\\": \\\"\\u003caws-secret\\u003e\\\"\\n }\\n }\\n }\\n]\\n\",\"capabilities\":\"Full Lifecycle\",\"categories\":\"Database\",\"containerImage\":\"quay.io/coreos/etcd-operator@sha256:66a37fd61a06a43969854ee6d3e21087a98b93838e284a6086b13917f96b0d9b\",\"createdAt\":\"2019-02-28 01:03:00\",\"description\":\"Create and maintain highly-available etcd clusters on Kubernetes\",\"repository\":\"https://github.com/coreos/etcd-operator\",\"tectonic-visibility\":\"ocs\"},\"name\":\"etcdoperator.v0.9.4\",\"namespace\":\"placeholder\"},\"spec\":{\"relatedImages\":[{\"name\":\"etcdv0.9.4\",\"image\":\"quay.io/coreos/etcd-operator@sha256:66a37fd61a06a43969854ee6d3e21087a98b93838e284a6086b13917f96b0d9b\"}],\"customresourcedefinitions\":{\"owned\":[{\"description\":\"Represents a cluster of etcd nodes.\",\"displayName\":\"etcd Cluster\",\"kind\":\"EtcdCluster\",\"name\":\"etcdclusters.etcd.database.coreos.com\",\"resources\":[{\"kind\":\"Service\",\"version\":\"v1\"},{\"kind\":\"Pod\",\"version\":\"v1\"}],\"specDescriptors\":[{\"description\":\"The desired number of member Pods for the etcd cluster.\",\"displayName\":\"Size\",\"path\":\"size\",\"x-descriptors\":[\"urn:alm:descriptor:com.tectonic.ui:podCount\"]},{\"description\":\"Limits describes the minimum/maximum amount of compute resources required/allowed\",\"displayName\":\"Resource Requirements\",\"path\":\"pod.resources\",\"x-descriptors\":[\"urn:alm:descriptor:com.tectonic.ui:resourceRequirements\"]}],\"statusDescriptors\":[{\"description\":\"The status of each of the member Pods for the etcd cluster.\",\"displayName\":\"Member Status\",\"path\":\"members\",\"x-descriptors\":[\"urn:alm:descriptor:com.tectonic.ui:podStatuses\"]},{\"description\":\"The service at which the running etcd cluster can be accessed.\",\"displayName\":\"Service\",\"path\":\"serviceName\",\"x-descriptors\":[\"urn:alm:descriptor:io.kubernetes:Service\"]},{\"description\":\"The current size of the etcd cluster.\",\"displayName\":\"Cluster Size\",\"path\":\"size\"},{\"description\":\"The current version of the etcd cluster.\",\"displayName\":\"Current Version\",\"path\":\"currentVersion\"},{\"description\":\"The target version of the etcd cluster, after upgrading.\",\"displayName\":\"Target Version\",\"path\":\"targetVersion\"},{\"description\":\"The current status of the etcd cluster.\",\"displayName\":\"Status\",\"path\":\"phase\",\"x-descriptors\":[\"urn:alm:descriptor:io.kubernetes.phase\"]},{\"description\":\"Explanation for the current status of the cluster.\",\"displayName\":\"Status Details\",\"path\":\"reason\",\"x-descriptors\":[\"urn:alm:descriptor:io.kubernetes.phase:reason\"]}],\"version\":\"v1beta2\"},{\"description\":\"Represents the intent to backup an etcd cluster.\",\"displayName\":\"etcd Backup\",\"kind\":\"EtcdBackup\",\"name\":\"etcdbackups.etcd.database.coreos.com\",\"specDescriptors\":[{\"description\":\"Specifies the endpoints of an etcd cluster.\",\"displayName\":\"etcd Endpoint(s)\",\"path\":\"etcdEndpoints\",\"x-descriptors\":[\"urn:alm:descriptor:etcd:endpoint\"]},{\"description\":\"The full AWS S3 path where the backup is saved.\",\"displayName\":\"S3 Path\",\"path\":\"s3.path\",\"x-descriptors\":[\"urn:alm:descriptor:aws:s3:path\"]},{\"description\":\"The name of the secret object that stores the AWS credential and config files.\",\"displayName\":\"AWS Secret\",\"path\":\"s3.awsSecret\",\"x-descriptors\":[\"urn:alm:descriptor:io.kubernetes:Secret\"]}],\"statusDescriptors\":[{\"description\":\"Indicates if the backup was successful.\",\"displayName\":\"Succeeded\",\"path\":\"succeeded\",\"x-descriptors\":[\"urn:alm:descriptor:text\"]},{\"description\":\"Indicates the reason for any backup related failures.\",\"displayName\":\"Reason\",\"path\":\"reason\",\"x-descriptors\":[\"urn:alm:descriptor:io.kubernetes.phase:reason\"]}],\"version\":\"v1beta2\"},{\"description\":\"Represents the intent to restore an etcd cluster from a backup.\",\"displayName\":\"etcd Restore\",\"kind\":\"EtcdRestore\",\"name\":\"etcdrestores.etcd.database.coreos.com\",\"specDescriptors\":[{\"description\":\"References the EtcdCluster which should be restored,\",\"displayName\":\"etcd Cluster\",\"path\":\"etcdCluster.name\",\"x-descriptors\":[\"urn:alm:descriptor:io.kubernetes:EtcdCluster\",\"urn:alm:descriptor:text\"]},{\"description\":\"The full AWS S3 path where the backup is saved.\",\"displayName\":\"S3 Path\",\"path\":\"s3.path\",\"x-descriptors\":[\"urn:alm:descriptor:aws:s3:path\"]},{\"description\":\"The name of the secret object that stores the AWS credential and config files.\",\"displayName\":\"AWS Secret\",\"path\":\"s3.awsSecret\",\"x-descriptors\":[\"urn:alm:descriptor:io.kubernetes:Secret\"]}],\"statusDescriptors\":[{\"description\":\"Indicates if the restore was successful.\",\"displayName\":\"Succeeded\",\"path\":\"succeeded\",\"x-descriptors\":[\"urn:alm:descriptor:text\"]},{\"description\":\"Indicates the reason for any restore related failures.\",\"displayName\":\"Reason\",\"path\":\"reason\",\"x-descriptors\":[\"urn:alm:descriptor:io.kubernetes.phase:reason\"]}],\"version\":\"v1beta2\"}]},\"description\":\"The etcd Operater creates and maintains highly-available etcd clusters on Kubernetes, allowing engineers to easily deploy and manage etcd clusters for their applications.\\n\\netcd is a distributed key value store that provides a reliable way to store data across a cluster of machines. It’s open-source and available on GitHub. etcd gracefully handles leader elections during network partitions and will tolerate machine failure, including the leader.\\n\\n\\n### Reading and writing to etcd\\n\\nCommunicate with etcd though its command line utility `etcdctl` via port forwarding:\\n\\n $ kubectl --namespace default port-forward service/example-client 2379:2379\\n $ etcdctl --endpoints http://127.0.0.1:2379 get /\\n\\nOr directly to the API using the Kubernetes Service:\\n\\n $ etcdctl --endpoints http://example-client.default.svc:2379 get /\\n\\nBe sure to secure your etcd cluster (see Common Configurations) before exposing it outside of the namespace or cluster.\\n\\n\\n### Supported Features\\n\\n* **High availability** - Multiple instances of etcd are networked together and secured. Individual failures or networking issues are transparently handled to keep your cluster up and running.\\n\\n* **Automated updates** - Rolling out a new etcd version works like all Kubernetes rolling updates. Simply declare the desired version, and the etcd service starts a safe rolling update to the new version automatically.\\n\\n* **Backups included** - Create etcd backups and restore them through the etcd Operator.\\n\\n### Common Configurations\\n\\n* **Configure TLS** - Specify [static TLS certs](https://github.com/coreos/etcd-operator/blob/master/doc/user/cluster_tls.md) as Kubernetes secrets.\\n\\n* **Set Node Selector and Affinity** - [Spread your etcd Pods](https://github.com/coreos/etcd-operator/blob/master/doc/user/spec_examples.md#three-member-cluster-with-node-selector-and-anti-affinity-across-nodes) across Nodes and availability zones.\\n\\n* **Set Resource Limits** - [Set the Kubernetes limit and request](https://github.com/coreos/etcd-operator/blob/master/doc/user/spec_examples.md#three-member-cluster-with-resource-requirement) values for your etcd Pods.\\n\\n* **Customize Storage** - [Set a custom StorageClass](https://github.com/coreos/etcd-operator/blob/master/doc/user/spec_examples.md#custom-persistentvolumeclaim-definition) that you would like to use.\\n\",\"displayName\":\"etcd\",\"icon\":[{\"base64data\":\"iVBORw0KGgoAAAANSUhEUgAAAOEAAADZCAYAAADWmle6AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAEKlJREFUeNrsndt1GzkShmEev4sTgeiHfRYdgVqbgOgITEVgOgLTEQydwIiKwFQCayoCU6+7DyYjsBiBFyVVz7RkXvqCSxXw/+f04XjGQ6IL+FBVuL769euXgZ7r39f/G9iP0X+u/jWDNZzZdGI/Ftama1jjuV4BwmcNpbAf1Fgu+V/9YRvNAyzT2a59+/GT/3hnn5m16wKWedJrmOCxkYztx9Q+py/+E0GJxtJdReWfz+mxNt+QzS2Mc0AI+HbBBwj9QViKbH5t64DsP2fvmGXUkWU4WgO+Uve2YQzBUGd7r+zH2ZG/tiUQc4QxKwgbwFfVGwwmdLL5wH78aPC/ZBem9jJpCAX3xtcNASSNgJLzUPSQyjB1zQNl8IQJ9MIU4lx2+Jo72ysXYKl1HSzN02BMa/vbZ5xyNJIshJzwf3L0dQhJw4Sih/SFw9Tk8sVeghVPoefaIYCkMZCKbrcP9lnZuk0uPUjGE/KE8JQry7W2tgfuC3vXgvNV+qSQbyFtAtyWk7zWiYevvuUQ9QEQCvJ+5mmu6dTjz1zFHLFj8Eb87MtxaZh/IQFIHom+9vgTWwZxAQjT9X4vtbEVPojwjiV471s00mhAckpwGuCn1HtFtRDaSh6y9zsL+LNBvCG/24ThcxHObdlWc1v+VQJe8LcO0jwtuF8BwnAAUgP9M8JPU2Me+Oh12auPGT6fHuTePE3bLDy+x9pTLnhMn+07TQGh//Bz1iI0c6kvtqInjvPZcYR3KsPVmUsPYt9nFig9SCY8VQNhpPBzn952bbgcsk2EvM89wzh3UEffBbyPqvBUBYQ8ODGPFOLsa7RF096WJ69L+E4EmnpjWu5o4ChlKaRTKT39RMMaVPEQRsz/nIWlDN80chjdJlSd1l0pJCAMVZsniobQVuxceMM9OFoaMd9zqZtjMEYYDW38Drb8Y0DYPLShxn0pvIFuOSxd7YCPet9zk452wsh54FJoeN05hcgSQoG5RR0Qh9Q4E4VvL4wcZq8UACgaRFEQKgSwWrkr5WFnGxiHSutqJGlXjBgIOayhwYBTA0ER0oisIVSUV0AAMT0IASCUO4hRIQSAEECMCCEPwqyQA0JCQBzEGjWNAqHiUVAoXUWbvggOIQCEAOJzxTjoaQ4AIaE64/aZridUsBYUgkhB15oGg1DBIl8IqirYwV6hPSGBSFteMCUBSVXwfYixBmamRubeMyjzMJQBDDowE3OesDD+zwqFoDqiEwXoXJpljB+PvWJGy75BKF1FPxhKygJuqUdYQGlLxNEXkrYyjQ0GbaAwEnUIlLRNvVjQDYUAsJB0HKLE4y0AIpQNgCIhBIhQTgCKhZBBpAN/v6LtQI50JfUgYOnnjmLUFHKhjxbAmdTCaTiBm3ovLPqG2urWAij6im0Nd9aTN9ygLUEt9LgSRnohxUPIKxlGaE+/6Y7znFf0yX+GnkvFFWmarkab2o9PmTeq8sbd2a7DaysXz7i64VeznN4jCQhN9gdDbRiuWrfrsq0mHIrlaq+hlotCtd3Um9u0BYWY8y5D67wccJoZjFca7iUs9VqZcfsZwTd1sbWGG+OcYaTnPAP7rTQVVlM4Sg3oGvB1tmNh0t/HKXZ1jFoIMwCQjtqbhNxUmkGYqgZEDZP11HN/S3gAYRozf0l8C5kKEKUvW0t1IfeWG/5MwgheZTT1E0AEhDkAePQO+Ig2H3DncAkQM4cwUQCD530dU4B5Yvmi2LlDqXfWrxMCcMth51RToRMNUXFnfc2KJ0+Ryl0VNOUwlhh6NoxK5gnViTgQpUG4SqSyt5z3zRJpuKmt3Q1614QaCBPaN6je+2XiFcWAKOXcUfIYKRyL/1lb7pe5VxSxxjQ6hImshqGRt5GWZVKO6q2wHwujfwDtIvaIdexj8Cm8+a68EqMfox6x/voMouZF4dHnEGNeCDMwT6vdNfekH1MafMk4PI06YtqLVGl95aEM9Z5vAeCTOA++YLtoVJRrsqNCaJ6WRmkdYaNec5BT/lcTRMqrhmwfjbpkj55+OKp8IEbU/JLgPJE6Wa3TTe9sHS+ShVD5QIyqIxMEwKh12olC6mHIed5ewEop80CNlfIOADYOT2nd6ZXCop+Ebqchc0JqxKcKASxChycJgUh1rnHA5ow9eTrhqNI7JWiAYYwBGGdpyNLoGw0Pkh96h1BpHihyywtATDM/7Hk2fN9EnH8BgKJCU4ooBkbXFMZJiPbrOyecGl3zgQDQL4hk10IZiOe+5w99Q/gBAEIJgPhJM4QAEEoFREAIAAEiIASAkD8Qt4AQAEIAERAGFlX4CACKAXGVM4ivMwWwCLFAlyeoaa70QePKm5Dlp+/n+ye/5dYgva6YsUaVeMa+tzNFeJtWwc+udbJ0Fg399kLielQJ5Ze61c2+7ytA6EZetiPxZC6tj22yJCv6jUwOyj/zcbqAxOMyAKEbfeHtNa7DtYXptjsk2kJxR+eIeim/tHNofUKYy8DMrQcAKWz6brpvzyIAlpwPhQ49l6b7skJf5Z+YTOYQc4FwLDxvoTDwaygQK+U/kVr+ytSFBG01Q3gnJJR4cNiAhx4HDub8/b5DULXlj6SVZghFiE+LdvE9vo/o8Lp1RmH5hzm0T6wdbZ6n+D6i44zDRc3ln6CpAEJfXiRU45oqLz8gFAThWsh7ughrRibc0QynHgZpNJa/ENJ+loCwu/qOGnFIjYR/n7TfgycULhcQhu6VC+HfF+L3BoAQ4WiZTw1M+FPCnA2gKC6/FAhXgDC+ojQGh3NuWsvfF1L/D5ohlCKtl1j2ldu9a/nPAKFwN56Bst10zCG0CPleXN/zXPgHQZXaZaBgrbzyY5V/mUA+6F0hwtGN9rwu5DVZPuwWqfxdFz1LWbJ2lwKEa+0Qsm4Dl3fp+Pu0lV97PgwIPfSsS+UQhj5Oo+vvFULazRIQyvGEcxPuNLCth2MvFsrKn8UOilAQShkh7TTczYNMoS6OdP47msrPi82lXKGWhCdMZYS0bFy+vcnGAjP1CIfvgbKNA9glecEH9RD6Ol4wRuWyN/G9MHnksS6o/GPf5XcwNSUlHzQhDuAKtWJmkwKElU7lylP5rgIcsquh/FI8YZCDpkJBuE4FQm7Icw8N+SrUGaQKyi8FwiDt1ve5o+Vu7qYHy/psgK8cvh+FTYuO77bhEC7GuaPiys/L1X4IgXDL+e3M5+ovLxBy5VLuIebw1oqcHoPfoaMJUsHays878r8KbDc3xtPx/84gZPBG/JwaufrsY/SRG/OY3//8QMNdsvdZCFtbW6f8pFuf5bflILAlX7O+4fdfugKyFYS8T2zAsXthdG0VurPGKwI06oF5vkBgHWkNp6ry29+lsPZMU3vijnXFNmoclr+6+Ou/FIb8yb30sS8YGjmTqCLyQsi5N/6ZwKs0Yenj68pfPjF6N782Dp2FzV9CTyoSeY8mLK16qGxIkLI8oa1n8tz9juP40DlK0epxYEbojbq+9QfurBeVIlCO9D2396bxiV4lkYQ3hOAFw2pbhqMGISkkQOMcQ9EqhDmGZZdo92JC0YHRNTfoSg+5e0IT+opqCKHoIU+4ztQIgBD1EFNrQAgIpYSil9lDmPHqkROPt+JC6AgPquSuumJmg0YARVCuneDfvPVeJokZ6pIXDkNxQtGzTF9/BQjRG0tQznfb74RwCQghpALBtIQnfK4zhxdyQvVCUeknMIT3hLyY+T5jo0yABqKPQNpUNw/09tGZod5jgCaYFxyYvJcNPkv9eof+I3pnCFEHIETjSM8L9tHZHYCQT9PaZGycU6yg8S4akDnJ+P03L0+t23XGzCLzRgII/Wqa+fv/xlfvmKvMUOcOrlCDdoei1MGdZm6G5VEIfRzzjd4aQs69n699Rx7ewhvCGzr2gmTPs8zNsJOrXt24FbkhhOjCfT4ICA/rPbyhUy94Dks0gJCX1NzCZui9YUd3oei+c257TalFbgg19ILHrlrL2gvWgXAL26EX76gZTNASQnad8Ibwhl284NhgXpB0c+jKhWO3Ms1hP9ihJYB9eMF6qd1BCPk0qA1s+LimFIu7m4nsdQIzPK4VbQ8hYvrnuSH2G9b2ggP78QmWqBdF9Vx8SSY6QYdUW7BTA1schZATyhvY8lHvcRbNUS9YGFy2U+qmzh2YPVc0I7yAOFyHfRpyUwtCSzOdPXMHmz7qDIM0e0V2wZTEk+6Ym6N63eBLp/b5Bts+2cKCSJ/LuoZO3ANSiE5hKAZjnvNSS4931jcw9jpwT0feV/qSJ1pVtCyfHKDkvK8Ejx7pUxGh2xFNSwx8QTi2H9ceC0/nni64MS/5N5dG39pDqvRV+WgGk71c9VFXF9b+xYvOw/d61iv7m3MvEHryhvecwC52jSSx4VIIgwnMNT/UsTxIgpPt3K/ARj15CptwL3Zd/ceDSATj2DGQjbxgWwhdeMMte7zpy5On9vymRm/YxBYljGVjKWF9VJf7I1+sex3wY8w/V1QPTborW/72gkdsRDaZMJBdbdHIC7aCkAu9atlLbtnrzerMnyToDaGwelOnk3/hHSem/ZK7e/t7jeeR20LYBgqa8J80gS8jbwi5F02Uj1u2NYJxap8PLkJfLxA2hIJyvnHX/AfeEPLpBfe0uSFHbnXaea3Qd5d6HcpYZ8L6M7lnFwMQ3MNg+RxUR1+6AshtbsVgfXTEg1sIGax9UND2p7f270wdG3eK9gXVGHdw2k5sOyZv+Nbs39Z308XR9DqWb2J+PwKDhuKHPobfuXf7gnYGHdCs7bhDDadD4entDug7LWNsnRNW4mYqwJ9dk+GGSTPBiA2j0G8RWNM5upZtcG4/3vMfP7KnbK2egx6CCnDPhRn7NgD3cghLIad5WcM2SO38iqHvvMOosyeMpQ5zlVCaaj06GVs9xUbHdiKoqrHWgquFEFMWUEWfXUxJAML23hAHFOctmjZQffKD2pywkhtSGHKNtpitLroscAeE7kCkSsC60vxEl6yMtL9EL5HKGCMszU5bk8gdkklAyEn5FO0yK419rIxBOIqwFMooDE0tHEVYijAUECIshRCGIhxFWIowFJ5QkEYIS5PTJrUwNGlPyN6QQPyKtpuM1E/K5+YJDV/MiA3AaehzqgAm7QnZG9IGYKo8bHnSK7VblLL3hOwNHziPuEGOqE5brrdR6i+atCfckyeWD47HkAkepRGLY/e8A8J0gCwYSNypF08bBm+e6zVz2UL4AshhBUjML/rXLefqC82bcQFhGC9JDwZ1uuu+At0S5gCETYHsV4DUeD9fDN2Zfy5OXaW2zAwQygCzBLJ8cvaW5OXKC1FxfTggFAHmoAJnSiOw2wps9KwRWgJCLaEswaj5NqkLwAYIU4BxqTSXbHXpJdRMPZgAOiAMqABCNGYIEEJutEK5IUAIwYMDQgiCACEEAcJs1Vda7gGqDhCmoiEghAAhBAHCrKXVo2C1DCBMRlp37uMIEECoX7xrX3P5C9QiINSuIcoPAUI0YkAICLNWgfJDh4T9hH7zqYH9+JHAq7zBqWjwhPAicTVCVQJCNF50JghHocahKK0X/ZnQKyEkhSdUpzG8OgQI42qC94EQjsYLRSmH+pbgq73L6bYkeEJ4DYTYmeg1TOBFc/usTTp3V9DdEuXJ2xDCUbXhaXk0/kAYmBvuMB4qkC35E5e5AMKkwSQgyxufyuPy6fMMgAFCSI73LFXU/N8AmEL9X4ABACNSKMHAgb34AAAAAElFTkSuQmCC\",\"mediatype\":\"image/png\"}],\"install\":{\"spec\":{\"deployments\":[{\"name\":\"etcd-operator\",\"spec\":{\"replicas\":1,\"selector\":{\"matchLabels\":{\"name\":\"etcd-operator-alm-owned\"}},\"template\":{\"metadata\":{\"labels\":{\"name\":\"etcd-operator-alm-owned\"},\"name\":\"etcd-operator-alm-owned\"},\"spec\":{\"containers\":[{\"command\":[\"etcd-operator\",\"--create-crd=false\"],\"env\":[{\"name\":\"MY_POD_NAMESPACE\",\"valueFrom\":{\"fieldRef\":{\"fieldPath\":\"metadata.namespace\"}}},{\"name\":\"MY_POD_NAME\",\"valueFrom\":{\"fieldRef\":{\"fieldPath\":\"metadata.name\"}}}],\"image\":\"quay.io/coreos/etcd-operator@sha256:66a37fd61a06a43969854ee6d3e21087a98b93838e284a6086b13917f96b0d9b\",\"name\":\"etcd-operator\"},{\"command\":[\"etcd-backup-operator\",\"--create-crd=false\"],\"env\":[{\"name\":\"MY_POD_NAMESPACE\",\"valueFrom\":{\"fieldRef\":{\"fieldPath\":\"metadata.namespace\"}}},{\"name\":\"MY_POD_NAME\",\"valueFrom\":{\"fieldRef\":{\"fieldPath\":\"metadata.name\"}}}],\"image\":\"quay.io/coreos/etcd-operator@sha256:66a37fd61a06a43969854ee6d3e21087a98b93838e284a6086b13917f96b0d9b\",\"name\":\"etcd-backup-operator\"},{\"command\":[\"etcd-restore-operator\",\"--create-crd=false\"],\"env\":[{\"name\":\"MY_POD_NAMESPACE\",\"valueFrom\":{\"fieldRef\":{\"fieldPath\":\"metadata.namespace\"}}},{\"name\":\"MY_POD_NAME\",\"valueFrom\":{\"fieldRef\":{\"fieldPath\":\"metadata.name\"}}}],\"image\":\"quay.io/coreos/etcd-operator@sha256:66a37fd61a06a43969854ee6d3e21087a98b93838e284a6086b13917f96b0d9b\",\"name\":\"etcd-restore-operator\"}],\"serviceAccountName\":\"etcd-operator\"}}}}],\"permissions\":[{\"rules\":[{\"apiGroups\":[\"etcd.database.coreos.com\"],\"resources\":[\"etcdclusters\",\"etcdbackups\",\"etcdrestores\"],\"verbs\":[\"*\"]},{\"apiGroups\":[\"\"],\"resources\":[\"pods\",\"services\",\"endpoints\",\"persistentvolumeclaims\",\"events\"],\"verbs\":[\"*\"]},{\"apiGroups\":[\"apps\"],\"resources\":[\"deployments\"],\"verbs\":[\"*\"]},{\"apiGroups\":[\"\"],\"resources\":[\"secrets\"],\"verbs\":[\"get\"]}],\"serviceAccountName\":\"etcd-operator\"}]},\"strategy\":\"deployment\"},\"installModes\":[{\"supported\":true,\"type\":\"OwnNamespace\"},{\"supported\":true,\"type\":\"SingleNamespace\"},{\"supported\":false,\"type\":\"MultiNamespace\"},{\"supported\":false,\"type\":\"AllNamespaces\"}],\"keywords\":[\"etcd\",\"key value\",\"database\",\"coreos\",\"open source\"],\"labels\":{\"alm-owner-etcd\":\"etcdoperator\",\"operated-by\":\"etcdoperator\"},\"links\":[{\"name\":\"Blog\",\"url\":\"https://coreos.com/etcd\"},{\"name\":\"Documentation\",\"url\":\"https://coreos.com/operators/etcd/docs/latest/\"},{\"name\":\"etcd Operator Source Code\",\"url\":\"https://github.com/coreos/etcd-operator\"}],\"maintainers\":[{\"email\":\"etcd-dev@googlegroups.com\",\"name\":\"etcd Community\"}],\"maturity\":\"alpha\",\"provider\":{\"name\":\"CNCF\"},\"replaces\":\"etcdoperator.v0.9.2\",\"selector\":{\"matchLabels\":{\"alm-owner-etcd\":\"etcdoperator\",\"operated-by\":\"etcdoperator\"}},\"version\":\"0.9.4\"}}" crdbackups = `{"apiVersion":"apiextensions.k8s.io/v1beta1","kind":"CustomResourceDefinition","metadata":{"name":"etcdbackups.etcd.database.coreos.com"},"spec":{"group":"etcd.database.coreos.com","names":{"kind":"EtcdBackup","listKind":"EtcdBackupList","plural":"etcdbackups","singular":"etcdbackup"},"scope":"Namespaced","version":"v1beta2"}}` crdclusters = `{"apiVersion":"apiextensions.k8s.io/v1beta1","kind":"CustomResourceDefinition","metadata":{"name":"etcdclusters.etcd.database.coreos.com"},"spec":{"group":"etcd.database.coreos.com","names":{"kind":"EtcdCluster","listKind":"EtcdClusterList","plural":"etcdclusters","shortNames":["etcdclus","etcd"],"singular":"etcdcluster"},"scope":"Namespaced","version":"v1beta2"}}` crdrestores = `{"apiVersion":"apiextensions.k8s.io/v1beta1","kind":"CustomResourceDefinition","metadata":{"name":"etcdrestores.etcd.database.coreos.com"},"spec":{"group":"etcd.database.coreos.com","names":{"kind":"EtcdRestore","listKind":"EtcdRestoreList","plural":"etcdrestores","singular":"etcdrestore"},"scope":"Namespaced","version":"v1beta2"}}` @@ -48,7 +48,7 @@ const ( func testModelBundle(t *testing.T) model.Bundle { t.Helper() var csv v1alpha1.ClusterServiceVersion - if err := json.Unmarshal([]byte(csvJson), &csv); err != nil { + if err := json.Unmarshal([]byte(csvJSON), &csv); err != nil { t.Fatalf("failed to unmarshal csv json: %v", err) } b := model.Bundle{ @@ -63,14 +63,14 @@ func testModelBundle(t *testing.T) model.Bundle { property.MustBuildGVK("etcd.database.coreos.com", "v1beta2", "EtcdBackup"), property.MustBuildBundleObject([]byte(crdbackups)), property.MustBuildBundleObject([]byte(crdclusters)), - property.MustBuildBundleObject([]byte(csvJson)), + property.MustBuildBundleObject([]byte(csvJSON)), property.MustBuildBundleObject([]byte(crdrestores)), }, - CsvJSON: csvJson, + CsvJSON: csvJSON, Objects: []string{ crdbackups, crdclusters, - csvJson, + csvJSON, crdrestores, }, RelatedImages: []model.RelatedImage{ @@ -106,11 +106,11 @@ func testAPIBundle() Bundle { {Type: "olm.gvk", Value: `{"group":"etcd.database.coreos.com","kind":"EtcdBackup","version":"v1beta2"}`}, }, Replaces: "etcdoperator.v0.9.2", - CsvJson: csvJson, + CsvJson: csvJSON, Object: []string{ crdbackups, crdclusters, - csvJson, + csvJSON, crdrestores}, } } diff --git a/pkg/api/model_to_api.go b/pkg/api/model_to_api.go index e7714713d..b3368383f 100644 --- a/pkg/api/model_to_api.go +++ b/pkg/api/model_to_api.go @@ -5,10 +5,11 @@ import ( "encoding/json" "fmt" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/operator-framework/api/pkg/lib/version" "github.com/operator-framework/api/pkg/operators" "github.com/operator-framework/api/pkg/operators/v1alpha1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/operator-framework/operator-registry/alpha/model" "github.com/operator-framework/operator-registry/alpha/property" @@ -20,8 +21,8 @@ func ConvertModelBundleToAPIBundle(b model.Bundle) (*Bundle, error) { return nil, fmt.Errorf("parse properties: %v", err) } - csvJson := b.CsvJSON - if csvJson == "" && len(props.CSVMetadatas) == 1 { + csvJSON := b.CsvJSON + if csvJSON == "" && len(props.CSVMetadatas) == 1 { var icons []v1alpha1.Icon if b.Package.Icon != nil { icons = []v1alpha1.Icon{{ @@ -37,7 +38,7 @@ func ConvertModelBundleToAPIBundle(b model.Bundle) (*Bundle, error) { // attemptint to write to a nil map. StrategyName: "deployment", } - csv.Spec.Version = version.OperatorVersion{b.Version} + csv.Spec.Version = version.OperatorVersion{Version: b.Version} csv.Spec.RelatedImages = convertModelRelatedImagesToCSVRelatedImages(b.RelatedImages) if csv.Spec.Description == "" { csv.Spec.Description = b.Package.Description @@ -46,9 +47,9 @@ func ConvertModelBundleToAPIBundle(b model.Bundle) (*Bundle, error) { if err != nil { return nil, err } - csvJson = string(csvData) + csvJSON = string(csvData) if len(b.Objects) == 0 { - b.Objects = []string{csvJson} + b.Objects = []string{csvJSON} } } @@ -76,7 +77,7 @@ func ConvertModelBundleToAPIBundle(b model.Bundle) (*Bundle, error) { Properties: convertModelPropertiesToAPIProperties(b.Properties), Replaces: b.Replaces, Skips: b.Skips, - CsvJson: csvJson, + CsvJson: csvJSON, Object: b.Objects, Deprecation: deprecation, }, nil @@ -127,6 +128,7 @@ func csvMetadataToCsv(m property.CSVMetadata) v1alpha1.ClusterServiceVersion { } func gvksProvidedtoAPIGVKs(in []property.GVK) []*GroupVersionKind { + // nolint:prealloc var out []*GroupVersionKind for _, gvk := range in { out = append(out, &GroupVersionKind{ @@ -138,6 +140,7 @@ func gvksProvidedtoAPIGVKs(in []property.GVK) []*GroupVersionKind { return out } func gvksRequirestoAPIGVKs(in []property.GVKRequired) []*GroupVersionKind { + // nolint:prealloc var out []*GroupVersionKind for _, gvk := range in { out = append(out, &GroupVersionKind{ @@ -150,9 +153,9 @@ func gvksRequirestoAPIGVKs(in []property.GVKRequired) []*GroupVersionKind { } func convertModelPropertiesToAPIProperties(props []property.Property) []*Property { + // nolint:prealloc var out []*Property for _, prop := range props { - // NOTE: This is a special case filter to prevent problems with existing client implementations that // project bundle properties into CSV annotations and store those CSVs in a size-constrained // storage backend (e.g. etcd via kube-apiserver). If the bundle object property has data inlined @@ -172,6 +175,7 @@ func convertModelPropertiesToAPIProperties(props []property.Property) []*Propert } func convertModelPropertiesToAPIDependencies(props []property.Property) ([]*Dependency, error) { + // nolint:prealloc var out []*Dependency for _, prop := range props { switch prop.Type { @@ -196,6 +200,7 @@ func convertModelPropertiesToAPIDependencies(props []property.Property) ([]*Depe } func convertModelRelatedImagesToCSVRelatedImages(in []model.RelatedImage) []v1alpha1.RelatedImage { + // nolint:prealloc var out []v1alpha1.RelatedImage for _, ri := range in { out = append(out, v1alpha1.RelatedImage{ diff --git a/pkg/cache/cache.go b/pkg/cache/cache.go index 938dc9cd6..a02297b36 100644 --- a/pkg/cache/cache.go +++ b/pkg/cache/cache.go @@ -342,7 +342,6 @@ func (c *cache) Build(ctx context.Context, fbcFsys fs.FS) error { pkgsMu.Unlock() } } - return nil }) } if err := eg.Wait(); err != nil { diff --git a/pkg/cache/cache_test.go b/pkg/cache/cache_test.go index 47a156fed..dacf75ea4 100644 --- a/pkg/cache/cache_test.go +++ b/pkg/cache/cache_test.go @@ -17,9 +17,9 @@ func TestCache_GetBundle(t *testing.T) { t.Run(name, func(t *testing.T) { b, err := testQuerier.GetBundle(context.TODO(), "etcd", "singlenamespace-alpha", "etcdoperator.v0.9.4") require.NoError(t, err) - require.Equal(t, b.PackageName, "etcd") - require.Equal(t, b.ChannelName, "singlenamespace-alpha") - require.Equal(t, b.CsvName, "etcdoperator.v0.9.4") + require.Equal(t, "etcd", b.PackageName) + require.Equal(t, "singlenamespace-alpha", b.ChannelName) + require.Equal(t, "etcdoperator.v0.9.4", b.CsvName) }) } } @@ -31,9 +31,9 @@ func TestCache_GetBundleForChannel(t *testing.T) { require.NoError(t, err) require.NotNil(t, b) - require.Equal(t, b.PackageName, "etcd") - require.Equal(t, b.ChannelName, "singlenamespace-alpha") - require.Equal(t, b.CsvName, "etcdoperator.v0.9.4") + require.Equal(t, "etcd", b.PackageName) + require.Equal(t, "singlenamespace-alpha", b.ChannelName) + require.Equal(t, "etcdoperator.v0.9.4", b.CsvName) }) } } @@ -44,9 +44,9 @@ func TestCache_GetBundleThatProvides(t *testing.T) { b, err := testQuerier.GetBundleThatProvides(context.TODO(), "etcd.database.coreos.com", "v1beta2", "EtcdBackup") require.NoError(t, err) require.NotNil(t, b) - require.Equal(t, b.PackageName, "etcd") - require.Equal(t, b.ChannelName, "singlenamespace-alpha") - require.Equal(t, b.CsvName, "etcdoperator.v0.9.4") + require.Equal(t, "etcd", b.PackageName) + require.Equal(t, "singlenamespace-alpha", b.ChannelName) + require.Equal(t, "etcdoperator.v0.9.4", b.CsvName) }) } } @@ -57,9 +57,9 @@ func TestCache_GetBundleThatReplaces(t *testing.T) { b, err := testQuerier.GetBundleThatReplaces(context.TODO(), "etcdoperator.v0.9.0", "etcd", "singlenamespace-alpha") require.NoError(t, err) require.NotNil(t, b) - require.Equal(t, b.PackageName, "etcd") - require.Equal(t, b.ChannelName, "singlenamespace-alpha") - require.Equal(t, b.CsvName, "etcdoperator.v0.9.2") + require.Equal(t, "etcd", b.PackageName) + require.Equal(t, "singlenamespace-alpha", b.ChannelName) + require.Equal(t, "etcdoperator.v0.9.2", b.CsvName) }) } } @@ -214,7 +214,7 @@ func TestCache_ListPackages(t *testing.T) { packages, err := testQuerier.ListPackages(context.TODO()) require.NoError(t, err) require.NotNil(t, packages) - require.Equal(t, 2, len(packages)) + require.Len(t, packages, 2) }) } } diff --git a/pkg/cache/json.go b/pkg/cache/json.go index fc73431e9..92b17f752 100644 --- a/pkg/cache/json.go +++ b/pkg/cache/json.go @@ -102,11 +102,11 @@ func (q *jsonBackend) GetPackageIndex(_ context.Context) (packageIndex, error) { } func (q *jsonBackend) PutPackageIndex(_ context.Context, pi packageIndex) error { - packageJson, err := json.Marshal(pi) + packageJSON, err := json.Marshal(pi) if err != nil { return err } - if err := os.WriteFile(filepath.Join(q.baseDir, jsonPackagesFile), packageJson, jsonCacheModeFile); err != nil { + if err := os.WriteFile(filepath.Join(q.baseDir, jsonPackagesFile), packageJSON, jsonCacheModeFile); err != nil { return err } return nil diff --git a/pkg/cache/json_test.go b/pkg/cache/json_test.go index 9cb31a435..b4d79c74b 100644 --- a/pkg/cache/json_test.go +++ b/pkg/cache/json_test.go @@ -21,7 +21,7 @@ func TestJSON_StableDigest(t *testing.T) { require.NoError(t, err) // NOTE: The entire purpose of this test is to ensure that we don't change the cache - // implementation and inadvertantly invalidate existing caches. + // implementation and inadvertently invalidate existing caches. // // Therefore, DO NOT CHANGE the expected digest value here unless validFS also // changes. diff --git a/pkg/cache/pkgs.go b/pkg/cache/pkgs.go index e590823b4..c89a9aab4 100644 --- a/pkg/cache/pkgs.go +++ b/pkg/cache/pkgs.go @@ -14,6 +14,7 @@ import ( type packageIndex map[string]cPkg func (pkgs packageIndex) ListPackages(_ context.Context) ([]string, error) { + // nolint:prealloc var packages []string for pkgName := range pkgs { packages = append(packages, pkgName) @@ -27,6 +28,7 @@ func (pkgs packageIndex) GetPackage(_ context.Context, name string) (*registry.P return nil, fmt.Errorf("package %q not found", name) } + // nolint:prealloc var channels []registry.PackageChannel for _, ch := range pkg.Channels { var deprecation *registry.Deprecation diff --git a/pkg/cache/pogrebv1.go b/pkg/cache/pogrebv1.go index a340b4458..a590832cb 100644 --- a/pkg/cache/pogrebv1.go +++ b/pkg/cache/pogrebv1.go @@ -14,7 +14,7 @@ import ( "github.com/akrylysov/pogreb" pogrebfs "github.com/akrylysov/pogreb/fs" - "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/proto" "github.com/operator-framework/operator-registry/alpha/declcfg" "github.com/operator-framework/operator-registry/pkg/api" @@ -38,7 +38,7 @@ const ( pograbV1CacheDir = FormatPogrebV1 pogrebDigestFile = pograbV1CacheDir + "/digest" - pogrebDbDir = pograbV1CacheDir + "/db" + pogrebDBDir = pograbV1CacheDir + "/db" ) type pogrebV1Backend struct { @@ -76,7 +76,7 @@ func (q *pogrebV1Backend) Init() error { } func (q *pogrebV1Backend) Open() error { - db, err := pogreb.Open(filepath.Join(q.baseDir, pogrebDbDir), &pogreb.Options{FileSystem: pogrebfs.OSMMap}) + db, err := pogreb.Open(filepath.Join(q.baseDir, pogrebDBDir), &pogreb.Options{FileSystem: pogrebfs.OSMMap}) if err != nil { return err } @@ -93,7 +93,7 @@ func (q *pogrebV1Backend) Close() error { } // Recursively fixup permissions on the DB directory. - return filepath.Walk(filepath.Join(q.baseDir, pogrebDbDir), func(path string, info os.FileInfo, err error) error { + return filepath.Walk(filepath.Join(q.baseDir, pogrebDBDir), func(path string, info os.FileInfo, err error) error { if err != nil { return err } @@ -128,11 +128,11 @@ func (q *pogrebV1Backend) GetPackageIndex(_ context.Context) (packageIndex, erro } func (q *pogrebV1Backend) PutPackageIndex(_ context.Context, index packageIndex) error { - packageJson, err := json.Marshal(index) + packageJSON, err := json.Marshal(index) if err != nil { return err } - return q.db.Put([]byte("packages.json"), packageJson) + return q.db.Put([]byte("packages.json"), packageJSON) } func (q *pogrebV1Backend) dbKey(in bundleKey) []byte { diff --git a/pkg/cache/pogrebv1_test.go b/pkg/cache/pogrebv1_test.go index f084509fe..4fee9f292 100644 --- a/pkg/cache/pogrebv1_test.go +++ b/pkg/cache/pogrebv1_test.go @@ -21,7 +21,7 @@ func TestPogrebV1_StableDigest(t *testing.T) { require.NoError(t, err) // NOTE: The entire purpose of this test is to ensure that we don't change the cache - // implementation and inadvertantly invalidate existing caches. + // implementation and inadvertently invalidate existing caches. // // Therefore, DO NOT CHANGE the expected digest value here unless validFS also // changes. diff --git a/pkg/cache/tar.go b/pkg/cache/tar.go index 92e83c181..2c00c55b2 100644 --- a/pkg/cache/tar.go +++ b/pkg/cache/tar.go @@ -14,7 +14,7 @@ import ( // of archives produced by this function do not need to account for differences in // permissions between source and destination filesystems. func fsToTar(w io.Writer, fsys fs.FS, buf []byte) error { - if buf == nil || len(buf) == 0 { + if len(buf) == 0 { // We are not sensitive to the size of this buffer, we just need it to be shared. // For simplicity, do the same as io.Copy() would. buf = make([]byte, 32*1024) diff --git a/pkg/cache/tar_test.go b/pkg/cache/tar_test.go index d95321f93..02b1f3d8a 100644 --- a/pkg/cache/tar_test.go +++ b/pkg/cache/tar_test.go @@ -2,7 +2,6 @@ package cache import ( "bytes" - "errors" "fmt" "hash/fnv" "io/fs" @@ -26,7 +25,7 @@ func Test_fsToTar(t *testing.T) { return notExist }, expect: func(t *testing.T, bytes []byte, err error) { - require.True(t, errors.Is(err, fs.ErrNotExist)) + require.ErrorIs(t, err, fs.ErrNotExist) }, }, { diff --git a/pkg/client/client.go b/pkg/client/client.go index ed3637dae..c8fdaf19f 100644 --- a/pkg/client/client.go +++ b/pkg/client/client.go @@ -2,6 +2,7 @@ package client import ( "context" + "errors" "io" "time" @@ -49,7 +50,7 @@ func (it *BundleIterator) Next() *api.Bundle { return nil } next, err := it.stream.Recv() - if err == io.EOF { + if errors.Is(err, io.EOF) { return nil } if err != nil { @@ -67,6 +68,7 @@ func (c *Client) GetBundle(ctx context.Context, packageName, channelName, csvNam } func (c *Client) GetBundleInPackageChannel(ctx context.Context, packageName, channelName string) (*api.Bundle, error) { + // nolint:staticcheck return c.Registry.GetBundleForChannel(ctx, &api.GetBundleInChannelRequest{PkgName: packageName, ChannelName: channelName}) } @@ -116,6 +118,7 @@ func (c *Client) HealthCheck(ctx context.Context, reconnectTimeout time.Duration } func NewClient(address string) (*Client, error) { + // nolint:staticcheck conn, err := grpc.Dial(address, grpc.WithInsecure()) if err != nil { return nil, err diff --git a/pkg/client/errors.go b/pkg/client/errors.go index 948012c9f..b9320501d 100644 --- a/pkg/client/errors.go +++ b/pkg/client/errors.go @@ -51,6 +51,7 @@ func IsErrorUnrecoverable(err error) bool { } func reasonForError(err error) HealthErrorReason { + // nolint:errorlint switch t := err.(type) { case HealthError: return t.Reason diff --git a/pkg/client/kubeclient.go b/pkg/client/kubeclient.go index 17a6532f8..7b63e1c55 100644 --- a/pkg/client/kubeclient.go +++ b/pkg/client/kubeclient.go @@ -10,13 +10,14 @@ import ( "k8s.io/client-go/tools/clientcmd" ) -func NewKubeClient(kubeconfig string, logger *logrus.Logger) (clientset *kubernetes.Clientset, err error) { +func NewKubeClient(kubeconfig string, logger *logrus.Logger) (*kubernetes.Clientset, error) { var config *rest.Config if overrideConfig := os.Getenv(clientcmd.RecommendedConfigPathEnvVar); overrideConfig != "" { kubeconfig = overrideConfig } + var err error if kubeconfig != "" { logger.Infof("Loading kube client config from path %q", kubeconfig) config, err = clientcmd.BuildConfigFromFlags("", kubeconfig) @@ -26,10 +27,11 @@ func NewKubeClient(kubeconfig string, logger *logrus.Logger) (clientset *kuberne } if err != nil { + // nolint:stylecheck err = fmt.Errorf("Cannot load config for REST client: %v", err) - return + return nil, err } - clientset, err = kubernetes.NewForConfig(config) - return + clientset, err := kubernetes.NewForConfig(config) + return clientset, err } diff --git a/pkg/configmap/configmap.go b/pkg/configmap/configmap.go index 0c95407e2..2b310371f 100644 --- a/pkg/configmap/configmap.go +++ b/pkg/configmap/configmap.go @@ -32,10 +32,11 @@ type BundleLoader struct { // creates an operator registry Bundle object. // If the Data section has a PackageManifest resource then it is also // deserialized and included in the result. -func (l *BundleLoader) Load(cm *corev1.ConfigMap) (bundle *api.Bundle, err error) { +func (l *BundleLoader) Load(cm *corev1.ConfigMap) (*api.Bundle, error) { + var err error if cm == nil { err = errors.New("ConfigMap must not be <nil>") - return + return nil, err } logger := l.logger.WithFields(logrus.Fields{ @@ -45,15 +46,15 @@ func (l *BundleLoader) Load(cm *corev1.ConfigMap) (bundle *api.Bundle, err error bundle, skipped, bundleErr := loadBundle(logger, cm) if bundleErr != nil { err = fmt.Errorf("failed to extract bundle from configmap - %v", bundleErr) - return + return nil, err } l.logger.Debugf("couldn't unpack skipped: %#v", skipped) - return + return bundle, nil } -func loadBundle(entry *logrus.Entry, cm *corev1.ConfigMap) (bundle *api.Bundle, skipped map[string]string, err error) { - bundle = &api.Bundle{Object: []string{}} - skipped = map[string]string{} +func loadBundle(entry *logrus.Entry, cm *corev1.ConfigMap) (*api.Bundle, map[string]string, error) { + bundle := &api.Bundle{Object: []string{}} + skipped := map[string]string{} data := cm.Data if hasGzipEncodingAnnotation(cm) { @@ -95,7 +96,7 @@ func loadBundle(entry *logrus.Entry, cm *corev1.ConfigMap) (bundle *api.Bundle, logger.Infof("added to bundle, Kind=%s", resource.GetKind()) } - return + return bundle, skipped, nil } func decodeGzipBinaryData(cm *corev1.ConfigMap) (map[string]string, error) { diff --git a/pkg/configmap/configmap_test.go b/pkg/configmap/configmap_test.go index 9a0f6f204..05e54bd93 100644 --- a/pkg/configmap/configmap_test.go +++ b/pkg/configmap/configmap_test.go @@ -5,14 +5,15 @@ import ( "os" "testing" - "github.com/operator-framework/operator-registry/pkg/api" - unstructuredlib "github.com/operator-framework/operator-registry/pkg/lib/unstructured" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/yaml" "k8s.io/client-go/kubernetes/fake" + + "github.com/operator-framework/operator-registry/pkg/api" + unstructuredlib "github.com/operator-framework/operator-registry/pkg/lib/unstructured" ) const ( @@ -36,7 +37,7 @@ func TestLoad(t *testing.T) { crdListGot := bundleGot.GetObject() // 1 CSV + 1 CRD = 2 objects - assert.Equal(t, 2, len(crdListGot)) + assert.Len(t, crdListGot, 2) }, }, { @@ -45,11 +46,11 @@ func TestLoad(t *testing.T) { assertFunc: func(t *testing.T, bundleGot *api.Bundle) { objects := bundleGot.GetObject() assert.NotNil(t, objects) - assert.Equal(t, 1, len(objects)) + assert.Len(t, objects, 1) unst, err := unstructuredlib.FromString(objects[0]) - assert.NoError(t, err) - assert.True(t, unst.GetKind() == "Foo") + require.NoError(t, err) + assert.Equal(t, "Foo", unst.GetKind()) }, }, { @@ -60,7 +61,7 @@ func TestLoad(t *testing.T) { assert.NotNil(t, csvGot) unst, err := unstructuredlib.FromString(csvGot) - assert.NoError(t, err) + require.NoError(t, err) assert.True(t, unst.GetName() == "first" || unst.GetName() == "second") }, }, @@ -79,12 +80,12 @@ func TestLoad(t *testing.T) { csvGot := bundleGot.GetCsvJson() assert.NotNil(t, csvGot) unst, err := unstructuredlib.FromString(csvGot) - assert.NoError(t, err) - assert.True(t, unst.GetName() == "kiali-operator.v1.4.2") + require.NoError(t, err) + assert.Equal(t, "kiali-operator.v1.4.2", unst.GetName()) objects := bundleGot.GetObject() // 2 CRDs + 1 CSV == 3 objects - assert.Equal(t, 3, len(objects)) + assert.Len(t, objects, 3) }, }, { @@ -94,11 +95,11 @@ func TestLoad(t *testing.T) { csvGot := bundleGot.GetCsvJson() assert.NotNil(t, csvGot) unst, err := unstructuredlib.FromString(csvGot) - assert.NoError(t, err) - assert.True(t, unst.GetName() == "kiali-operator.v1.4.2") + require.NoError(t, err) + assert.Equal(t, "kiali-operator.v1.4.2", unst.GetName()) objects := bundleGot.GetObject() - assert.Equal(t, 3, len(objects)) + assert.Len(t, objects, 3) }, }, } @@ -110,7 +111,7 @@ func TestLoad(t *testing.T) { loader := NewBundleLoader() bundleGot, errGot := loader.Load(cm) - assert.NoError(t, errGot) + require.NoError(t, errGot) assert.NotNil(t, bundleGot) if tt.assertFunc != nil { @@ -147,23 +148,24 @@ func TestLoadWriteRead(t *testing.T) { }, } clientset := fake.NewSimpleClientset() - clientset.CoreV1().ConfigMaps(configMapNamespace).Create(context.TODO(), cm, metav1.CreateOptions{}) + _, _ = clientset.CoreV1().ConfigMaps(configMapNamespace).Create(context.TODO(), cm, metav1.CreateOptions{}) cmLoader := NewConfigMapLoaderWithClient(configMapName, configMapNamespace, tt.source, tt.gzip, clientset) err := cmLoader.Populate(1 << 20) - assert.NoError(t, err) + require.NoError(t, err) cm, err = clientset.CoreV1().ConfigMaps(configMapNamespace).Get(context.TODO(), configMapName, metav1.GetOptions{}) - assert.NoError(t, err) + require.NoError(t, err) bundleLoader := NewBundleLoader() bundle, err := bundleLoader.Load(cm) + require.NoError(t, err) expectedObjects, err := unstructuredlib.FromDir(tt.source + "manifests/") - assert.NoError(t, err) + require.NoError(t, err) bundleObjects, err := unstructuredlib.FromBundle(bundle) - assert.NoError(t, err) + require.NoError(t, err) assert.ElementsMatch(t, expectedObjects, bundleObjects) }) diff --git a/pkg/configmap/configmap_writer.go b/pkg/configmap/configmap_writer.go index dd8931cc9..1ee4ff917 100644 --- a/pkg/configmap/configmap_writer.go +++ b/pkg/configmap/configmap_writer.go @@ -139,7 +139,7 @@ func (c *ConfigMapWriter) Populate(maxDataSizeLimit uint64) error { logrus.WithFields(logrus.Fields{ "file.Name": file.Name(), "validConfigMapKey": validConfigMapKey, - }).Info("translated filename for configmap comptability") + }).Info("translated filename for configmap compatibility") } if c.gzip { diff --git a/pkg/containertools/containertool.go b/pkg/containertools/containertool.go index ea38c21d1..b2e51977a 100644 --- a/pkg/containertools/containertool.go +++ b/pkg/containertools/containertool.go @@ -8,7 +8,8 @@ const ( DockerTool ) -func (t ContainerTool) String() (s string) { +func (t ContainerTool) String() string { + var s string switch t { case NoneTool: s = "none" @@ -17,7 +18,7 @@ func (t ContainerTool) String() (s string) { case DockerTool: s = "docker" } - return + return s } func (t ContainerTool) CommandFactory() CommandFactory { @@ -30,7 +31,8 @@ func (t ContainerTool) CommandFactory() CommandFactory { return &StubCommandFactory{} } -func NewContainerTool(s string, defaultTool ContainerTool) (t ContainerTool) { +func NewContainerTool(s string, defaultTool ContainerTool) ContainerTool { + var t ContainerTool switch s { case "podman": t = PodmanTool @@ -41,16 +43,17 @@ func NewContainerTool(s string, defaultTool ContainerTool) (t ContainerTool) { default: t = defaultTool } - return + return t } // NewCommandContainerTool returns a tool that can be used in `exec` statements. -func NewCommandContainerTool(s string) (t ContainerTool) { +func NewCommandContainerTool(s string) ContainerTool { + var t ContainerTool switch s { case "docker": t = DockerTool default: t = PodmanTool } - return + return t } diff --git a/pkg/containertools/dockerfilegenerator.go b/pkg/containertools/dockerfilegenerator.go index 79059b9ee..dd46ce22f 100644 --- a/pkg/containertools/dockerfilegenerator.go +++ b/pkg/containertools/dockerfilegenerator.go @@ -9,9 +9,11 @@ import ( const ( DefaultBinarySourceImage = "quay.io/operator-framework/opm:latest" - DefaultDbLocation = "/database/index.db" - DbLocationLabel = "operators.operatorframework.io.index.database.v1" - ConfigsLocationLabel = "operators.operatorframework.io.index.configs.v1" + // nolint:stylecheck + DefaultDbLocation = "/database/index.db" + // nolint:stylecheck + DbLocationLabel = "operators.operatorframework.io.index.database.v1" + ConfigsLocationLabel = "operators.operatorframework.io.index.configs.v1" ) // DockerfileGenerator defines functions to generate index dockerfiles diff --git a/pkg/containertools/dockerfilegenerator_test.go b/pkg/containertools/dockerfilegenerator_test.go index 9952812bc..41810bc2e 100644 --- a/pkg/containertools/dockerfilegenerator_test.go +++ b/pkg/containertools/dockerfilegenerator_test.go @@ -31,7 +31,7 @@ CMD ["registry", "serve", "--database", "/database/index.db"] } dockerfile := dockerfileGenerator.GenerateIndexDockerfile(binarySourceImage, databasePath) - require.Equal(t, dockerfile, expectedDockerfile) + require.Equal(t, expectedDockerfile, dockerfile) } func TestGenerateDockerfile_EmptyBaseImage(t *testing.T) { @@ -54,5 +54,5 @@ CMD ["registry", "serve", "--database", "/database/index.db"] } dockerfile := dockerfileGenerator.GenerateIndexDockerfile("", databasePath) - require.Equal(t, dockerfile, expectedDockerfile) + require.Equal(t, expectedDockerfile, dockerfile) } diff --git a/pkg/containertools/labelreader.go b/pkg/containertools/labelreader.go index 57de73829..18ad46d98 100644 --- a/pkg/containertools/labelreader.go +++ b/pkg/containertools/labelreader.go @@ -71,5 +71,6 @@ func (r ImageLabelReader) GetLabelsFromImage(image string) (map[string]string, e return data[0].Labels, nil } + // nolint:stylecheck return nil, fmt.Errorf("Unable to parse label data from container") } diff --git a/pkg/containertools/labelreader_test.go b/pkg/containertools/labelreader_test.go index f685765f1..334dbdf31 100644 --- a/pkg/containertools/labelreader_test.go +++ b/pkg/containertools/labelreader_test.go @@ -32,7 +32,7 @@ func TestReadDockerLabels(t *testing.T) { labels, err := labelReader.GetLabelsFromImage(image) require.NoError(t, err) - require.Equal(t, labels[expectedLabelKey], expectedLabelVal) + require.Equal(t, expectedLabelVal, labels[expectedLabelKey]) } func TestReadDockerLabelsNoLabels(t *testing.T) { @@ -55,7 +55,7 @@ func TestReadDockerLabelsNoLabels(t *testing.T) { labels, err := labelReader.GetLabelsFromImage(image) require.NoError(t, err) - require.Equal(t, len(labels), 0) + require.Empty(t, labels) } func TestReadPodmanLabels(t *testing.T) { @@ -80,7 +80,7 @@ func TestReadPodmanLabels(t *testing.T) { labels, err := labelReader.GetLabelsFromImage(image) require.NoError(t, err) - require.Equal(t, labels[expectedLabelKey], expectedLabelVal) + require.Equal(t, expectedLabelVal, labels[expectedLabelKey]) } func TestReadPodmanLabelsNoLabels(t *testing.T) { @@ -103,7 +103,7 @@ func TestReadPodmanLabelsNoLabels(t *testing.T) { labels, err := labelReader.GetLabelsFromImage(image) require.NoError(t, err) - require.Equal(t, len(labels), 0) + require.Empty(t, labels) } func TestReadDockerLabels_PullError(t *testing.T) { diff --git a/pkg/containertools/runner.go b/pkg/containertools/runner.go index 660c92c6a..b5995b40f 100644 --- a/pkg/containertools/runner.go +++ b/pkg/containertools/runner.go @@ -2,6 +2,7 @@ package containertools import ( + "errors" "fmt" "os/exec" "strings" @@ -83,13 +84,14 @@ func (r *ContainerCommandRunner) GetToolName() string { func (r *ContainerCommandRunner) Pull(image string) error { args := r.argsForCmd("pull", image) + // nolint:gosec command := exec.Command(r.containerTool.String(), args...) r.logger.Infof("running %s", command.String()) out, err := command.CombinedOutput() if err != nil { - r.logger.Errorf(string(out)) + r.logger.Error(string(out)) return fmt.Errorf("error pulling image: %s. %v", string(out), err) } @@ -114,7 +116,7 @@ func (r *ContainerCommandRunner) Build(dockerfile, tag string) error { out, err := command.CombinedOutput() if err != nil { - r.logger.Errorf(string(out)) + r.logger.Error(string(out)) return fmt.Errorf("error building image: %s. %v", string(out), err) } @@ -125,6 +127,7 @@ func (r *ContainerCommandRunner) Build(dockerfile, tag string) error { func (r *ContainerCommandRunner) Unpack(image, src, dst string) error { args := r.argsForCmd("create", image, "") + // nolint:gosec command := exec.Command(r.containerTool.String(), args...) r.logger.Infof("running %s create", r.containerTool) @@ -133,7 +136,8 @@ func (r *ContainerCommandRunner) Unpack(image, src, dst string) error { out, err := command.Output() if err != nil { msg := err.Error() - if exitErr, ok := err.(*exec.ExitError); ok { + var exitErr *exec.ExitError + if errors.As(err, &exitErr) { msg = fmt.Sprintf("%s: %s", err, exitErr.Stderr) } return fmt.Errorf("error creating container %s: %s", string(out), msg) @@ -141,6 +145,7 @@ func (r *ContainerCommandRunner) Unpack(image, src, dst string) error { id := strings.TrimSuffix(string(out), "\n") args = r.argsForCmd("cp", id+":"+src, dst) + // nolint:gosec command = exec.Command(r.containerTool.String(), args...) r.logger.Infof("running %s cp", r.containerTool) @@ -148,11 +153,12 @@ func (r *ContainerCommandRunner) Unpack(image, src, dst string) error { out, err = command.CombinedOutput() if err != nil { - r.logger.Errorf(string(out)) + r.logger.Error(string(out)) return fmt.Errorf("error copying container directory %s: %v", string(out), err) } args = r.argsForCmd("rm", id) + // nolint:gosec command = exec.Command(r.containerTool.String(), args...) r.logger.Infof("running %s rm", r.containerTool) @@ -160,7 +166,7 @@ func (r *ContainerCommandRunner) Unpack(image, src, dst string) error { out, err = command.CombinedOutput() if err != nil { - r.logger.Errorf(string(out)) + r.logger.Error(string(out)) return fmt.Errorf("error removing container %s: %v", string(out), err) } @@ -172,6 +178,7 @@ func (r *ContainerCommandRunner) Unpack(image, src, dst string) error { func (r *ContainerCommandRunner) Inspect(image string) ([]byte, error) { args := r.argsForCmd("inspect", image) + // nolint:gosec command := exec.Command(r.containerTool.String(), args...) r.logger.Infof("running %s inspect", r.containerTool) @@ -179,7 +186,7 @@ func (r *ContainerCommandRunner) Inspect(image string) ([]byte, error) { out, err := command.Output() if err != nil { - r.logger.Errorf(string(out)) + r.logger.Error(string(out)) return nil, err } diff --git a/pkg/image/containerdregistry/options.go b/pkg/image/containerdregistry/options.go index d447dc155..c045750e2 100644 --- a/pkg/image/containerdregistry/options.go +++ b/pkg/image/containerdregistry/options.go @@ -60,28 +60,31 @@ func defaultConfig() *RegistryConfig { // NewRegistry returns a new containerd Registry and a function to destroy it after use. // The destroy function is safe to call more than once, but is a no-op after the first call. -func NewRegistry(options ...RegistryOption) (registry *Registry, err error) { +func NewRegistry(options ...RegistryOption) (*Registry, error) { + var registry *Registry + config := defaultConfig() config.apply(options) - if err = config.complete(); err != nil { - return + if err := config.complete(); err != nil { + return nil, err } cs, err := contentlocal.NewStore(config.CacheDir) if err != nil { - return + return nil, err } var bdb *bolt.DB bdb, err = bolt.Open(config.DBPath, 0644, nil) if err != nil { - return + return nil, err } var once sync.Once + // nolint:nonamedreturns destroy := func() (destroyErr error) { once.Do(func() { - if destroyErr = bdb.Close(); destroyErr != nil { + if err := bdb.Close(); err != nil { return } if config.PreserveCache { @@ -102,12 +105,13 @@ func NewRegistry(options ...RegistryOption) (registry *Registry, err error) { resolverFunc: func(repo string) (remotes.Resolver, error) { return NewResolver(httpClient, config.ResolverConfigDir, config.PlainHTTP, repo) }, + // nolint: staticcheck platform: platforms.Ordered(platforms.DefaultSpec(), specs.Platform{ OS: "linux", Architecture: "amd64", }), } - return + return registry, nil } type RegistryOption func(config *RegistryConfig) @@ -168,12 +172,15 @@ func newClient(skipTlSVerify bool, roots *x509.CertPool) *http.Client { TLSClientConfig: &tls.Config{ InsecureSkipVerify: false, RootCAs: roots, + MinVersion: tls.VersionTLS12, }, } if skipTlSVerify { transport.TLSClientConfig = &tls.Config{ + // nolint:gosec InsecureSkipVerify: true, + MinVersion: tls.VersionTLS12, } } headers := http.Header{} diff --git a/pkg/image/containerdregistry/registry.go b/pkg/image/containerdregistry/registry.go index 61fb5c73d..9c421dc68 100644 --- a/pkg/image/containerdregistry/registry.go +++ b/pkg/image/containerdregistry/registry.go @@ -14,11 +14,11 @@ import ( "github.com/containerd/containerd/archive" "github.com/containerd/containerd/archive/compression" - "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/images" "github.com/containerd/containerd/namespaces" "github.com/containerd/containerd/platforms" "github.com/containerd/containerd/remotes" + "github.com/containerd/errdefs" "github.com/containers/image/v5/docker/reference" ocispec "github.com/opencontainers/image-spec/specs-go/v1" "github.com/sirupsen/logrus" @@ -34,7 +34,8 @@ type Registry struct { destroy func() error log *logrus.Entry resolverFunc func(repo string) (remotes.Resolver, error) - platform platforms.MatchComparer + // nolint:staticcheck + platform platforms.MatchComparer } var _ image.Registry = &Registry{} @@ -56,9 +57,26 @@ func (r *Registry) Pull(ctx context.Context, ref image.Reference) error { return err } - name, root, err := resolver.Resolve(ctx, ref.String()) - if err != nil { - return fmt.Errorf("error resolving name for image ref %s: %v", ref.String(), err) + retryBackoff := wait.Backoff{ + Duration: 1 * time.Second, + Factor: 1.0, + Jitter: 0.1, + Steps: 5, + } + + var name string + var root ocispec.Descriptor + if err := retry.OnError(retryBackoff, + func(pullErr error) bool { + r.log.Warnf("Error resolving registry %q: %v. Retrying", ref.String(), pullErr) + return true + }, + func() error { + name, root, err = resolver.Resolve(ctx, ref.String()) + return err + }, + ); err != nil { + return fmt.Errorf("error resolving remote name %s: %v", ref.String(), err) } r.log.Debugf("resolved name: %s", name) @@ -67,13 +85,6 @@ func (r *Registry) Pull(ctx context.Context, ref image.Reference) error { return err } - retryBackoff := wait.Backoff{ - Duration: 1 * time.Second, - Factor: 1.0, - Jitter: 0.1, - Steps: 5, - } - if err := retry.OnError(retryBackoff, func(pullErr error) bool { if nonRetriablePullError.MatchString(pullErr.Error()) { @@ -143,7 +154,7 @@ func (r *Registry) Labels(ctx context.Context, ref image.Reference) (map[string] } // Destroy cleans up the on-disk boltdb file and other cache files, unless preserve cache is true -func (r *Registry) Destroy() (err error) { +func (r *Registry) Destroy() error { return r.destroy() } @@ -263,6 +274,7 @@ const paxSchilyXattr = "SCHILY.xattr." // dropXattrs removes all xattrs from a Header. // This is useful for unpacking on systems where writing certain xattrs is a restricted operation; e.g. "security.capability" on SELinux. func dropXattrs(h *tar.Header) (bool, error) { + // nolint:staticcheck h.Xattrs = nil // Deprecated, but still in use, clear anyway. for key := range h.PAXRecords { if strings.HasPrefix(key, paxSchilyXattr) { // Xattrs are stored under keys with the "Schilly.xattr." prefix. diff --git a/pkg/image/execregistry/registry.go b/pkg/image/execregistry/registry.go index 40769d23e..0d299b66d 100644 --- a/pkg/image/execregistry/registry.go +++ b/pkg/image/execregistry/registry.go @@ -26,7 +26,7 @@ type Registry struct { var _ image.Registry = &Registry{} // NewRegistry instantiates and returns a new registry which manipulates images via exec podman/docker commands. -func NewRegistry(tool containertools.ContainerTool, logger *logrus.Entry, opts ...containertools.RunnerOption) (registry *Registry, err error) { +func NewRegistry(tool containertools.ContainerTool, logger *logrus.Entry, opts ...containertools.RunnerOption) (*Registry, error) { return &Registry{ log: logger, cmd: containertools.NewCommandRunner(tool, logger, opts...), diff --git a/pkg/image/mock.go b/pkg/image/mock.go index f46d58516..1709a4a5d 100644 --- a/pkg/image/mock.go +++ b/pkg/image/mock.go @@ -39,7 +39,7 @@ func (i *MockImage) unpack(dir string) error { if err := os.MkdirAll(pathDir, 0777); err != nil { return err } - return os.WriteFile(path, data, 0666) + return os.WriteFile(path, data, 0600) }) } diff --git a/pkg/image/mock_test.go b/pkg/image/mock_test.go index 8829a2240..2f1d77b14 100644 --- a/pkg/image/mock_test.go +++ b/pkg/image/mock_test.go @@ -19,7 +19,7 @@ func TestMockRegistry(t *testing.T) { r := MockRegistry{ RemoteImages: map[Reference]*MockImage{ - exists: &MockImage{ + exists: { Labels: map[string]string{ "key1": "value1", "key2": "value2", diff --git a/pkg/image/registry_test.go b/pkg/image/registry_test.go index 378292a34..ac1df7ca4 100644 --- a/pkg/image/registry_test.go +++ b/pkg/image/registry_test.go @@ -2,12 +2,13 @@ package image_test import ( "context" + "crypto/rand" "crypto/x509" "errors" "fmt" "io" "math" - "math/rand" + "math/big" "net/http" "os" "sync" @@ -44,9 +45,11 @@ func poolForCertFile(t *testing.T, file string) *x509.CertPool { func TestRegistries(t *testing.T) { registries := map[string]newRegistryFunc{ "containerd": func(t *testing.T, cafile string) (image.Registry, cleanupFunc) { + val, err := rand.Int(rand.Reader, big.NewInt(math.MaxInt64)) + require.NoError(t, err) r, err := containerdregistry.NewRegistry( containerdregistry.WithLog(logrus.New().WithField("test", t.Name())), - containerdregistry.WithCacheDir(fmt.Sprintf("cache-%x", rand.Int())), + containerdregistry.WithCacheDir(fmt.Sprintf("cache-%x", val)), containerdregistry.WithRootCAs(poolForCertFile(t, cafile)), ) require.NoError(t, err) @@ -180,7 +183,10 @@ func testPullAndUnpack(t *testing.T, name string, newRegistry newRegistryFunc) { maxCount: tt.args.pullErrCount, err: tt.args.pullErr, }} - middlewareName := fmt.Sprintf("test-%x", rand.Int()) + val, err := rand.Int(rand.Reader, big.NewInt(math.MaxInt64)) + require.NoError(t, err) + + middlewareName := fmt.Sprintf("test-%x", val) require.NoError(t, repositorymiddleware.Register(middlewareName, mockRepo.init)) config.Middleware["repository"] = append(config.Middleware["repository"], configuration.Middleware{ Name: middlewareName, diff --git a/pkg/lib/bundle/build.go b/pkg/lib/bundle/build.go index 08b0fa808..5bfb517fc 100644 --- a/pkg/lib/bundle/build.go +++ b/pkg/lib/bundle/build.go @@ -31,6 +31,7 @@ func ExecuteCommand(cmd *exec.Cmd) error { log.Debugf("Running %#v", cmd.Args) if err := cmd.Run(); err != nil { + // nolint:stylecheck return fmt.Errorf("Failed to exec %#v: %v", cmd.Args, err) } diff --git a/pkg/lib/bundle/errors.go b/pkg/lib/bundle/errors.go index 5e0735adf..869cf061c 100644 --- a/pkg/lib/bundle/errors.go +++ b/pkg/lib/bundle/errors.go @@ -12,6 +12,7 @@ type ValidationError struct { } func (v ValidationError) Error() string { + // nolint:prealloc var errs []string for _, err := range v.Errors { errs = append(errs, err.Error()) diff --git a/pkg/lib/bundle/exporter.go b/pkg/lib/bundle/exporter.go index 043aac1ac..49f50dc23 100644 --- a/pkg/lib/bundle/exporter.go +++ b/pkg/lib/bundle/exporter.go @@ -30,7 +30,6 @@ func NewExporterForBundle(image, directory string, containerTool containertools. } func (i *BundleExporter) Export(skipTLSVerify, plainHTTP bool) error { - log := logrus.WithField("img", i.image) tmpDir, err := os.MkdirTemp("./", "bundle_tmp") diff --git a/pkg/lib/bundle/exporter_test.go b/pkg/lib/bundle/exporter_test.go index 6a9477497..b62b31457 100644 --- a/pkg/lib/bundle/exporter_test.go +++ b/pkg/lib/bundle/exporter_test.go @@ -3,19 +3,20 @@ package bundle import ( "testing" + "github.com/stretchr/testify/require" + "github.com/operator-framework/operator-registry/pkg/containertools" - "github.com/stretchr/testify/assert" ) func TestExportForBundleWithBadImage(t *testing.T) { exporter := NewExporterForBundle("foo", "", containertools.DockerTool) err := exporter.Export(true, false) - assert.Error(t, err) + require.Error(t, err) err = exporter.Export(false, true) - assert.Error(t, err) + require.Error(t, err) exporter = NewExporterForBundle("foo", "", containertools.NoneTool) err = exporter.Export(true, false) - assert.Error(t, err) + require.Error(t, err) } diff --git a/pkg/lib/bundle/generate.go b/pkg/lib/bundle/generate.go index 7f20e4288..72e781e0b 100644 --- a/pkg/lib/bundle/generate.go +++ b/pkg/lib/bundle/generate.go @@ -79,6 +79,7 @@ func GenerateFunc(directory, outputDir, packageName, channels, channelDefault st // Channels and packageName are required fields where as default channel is automatically filled if unspecified // and that either of the required field is missing. We are interpreting the bundle information through // bundle directory embedded in the package folder. + // nolint:nestif if channels == "" || packageName == "" { var notProvided []string if channels == "" { @@ -155,9 +156,10 @@ func GenerateFunc(directory, outputDir, packageName, channels, channelDefault st // CopyYamlOutput takes the generated annotations yaml and writes it to disk. // If an outputDir is specified, it will copy the input manifests // It returns two strings. resultMetadata is the path to the output metadata/ folder. -// resultManifests is the path to the output manifests/ folder -- if no copy occured, +// resultManifests is the path to the output manifests/ folder -- if no copy occurred, // it just returns the input manifestDir -func CopyYamlOutput(annotationsContent []byte, manifestDir, outputDir, workingDir string, overwrite bool) (resultManifests, resultMetadata string, err error) { +func CopyYamlOutput(annotationsContent []byte, manifestDir, outputDir, workingDir string, overwrite bool) (string, string, error) { + var resultManifests, resultMetadata string // First, determine the parent directory of the metadata and manifest directories copyDir := "" @@ -204,6 +206,7 @@ func CopyYamlOutput(annotationsContent []byte, manifestDir, outputDir, workingDi // Currently able to detect helm chart, registry+v1 (CSV) and plain k8s resources // such as CRD. func GetMediaType(directory string) (string, error) { + // nolint:prealloc var files []string k8sFiles := make(map[string]*unstructured.Unstructured) @@ -219,6 +222,7 @@ func GetMediaType(directory string) (string, error) { fileWithPath := filepath.Join(directory, item.Name()) fileBlob, err := os.ReadFile(fileWithPath) if err != nil { + // nolint:stylecheck return "", fmt.Errorf("Unable to read file %s in bundle", fileWithPath) } @@ -230,6 +234,7 @@ func GetMediaType(directory string) (string, error) { } if len(files) == 0 { + // nolint:stylecheck return "", fmt.Errorf("The directory %s contains no yaml files", directory) } @@ -276,11 +281,13 @@ func ValidateAnnotations(existing, expected []byte) error { for label, item := range expectedAnnotations.Annotations { value, hasAnnotation := fileAnnotations.Annotations[label] if !hasAnnotation { + // nolint:stylecheck errs = append(errs, fmt.Errorf("Missing field: %s", label)) continue } if item != value { + // nolint:stylecheck errs = append(errs, fmt.Errorf("Expect field %q to have value %q instead of %q", label, item, value)) } @@ -443,6 +450,7 @@ func copyManifestDir(from, to string, overwrite bool) error { return nil } +// nolint:unused func containsString(slice []string, s string) bool { for _, item := range slice { if item == s { diff --git a/pkg/lib/bundle/generate_test.go b/pkg/lib/bundle/generate_test.go index 6130fe1fd..45cf621f5 100644 --- a/pkg/lib/bundle/generate_test.go +++ b/pkg/lib/bundle/generate_test.go @@ -55,12 +55,12 @@ func TestValidateAnnotations(t *testing.T) { err error }{ { - buildTestAnnotations("annotations", + buildTestAnnotations( map[string]string{ "test1": "stable", "test2": "stable,beta", }), - buildTestAnnotations("annotations", + buildTestAnnotations( map[string]string{ "test1": "stable", "test2": "stable,beta", @@ -68,13 +68,13 @@ func TestValidateAnnotations(t *testing.T) { nil, }, { - buildTestAnnotations("annotations", + buildTestAnnotations( map[string]string{ "test1": "stable", "test2": "stable,beta", "test3": "beta", }), - buildTestAnnotations("annotations", + buildTestAnnotations( map[string]string{ "test1": "stable", "test2": "stable,beta", @@ -82,12 +82,12 @@ func TestValidateAnnotations(t *testing.T) { nil, }, { - buildTestAnnotations("annotations", + buildTestAnnotations( map[string]string{ "test1": "stable", "test2": "stable", }), - buildTestAnnotations("annotations", + buildTestAnnotations( map[string]string{ "test1": "stable", "test2": "stable,beta", @@ -95,12 +95,12 @@ func TestValidateAnnotations(t *testing.T) { fmt.Errorf(`Expect field "test2" to have value "stable,beta" instead of "stable"`), }, { - buildTestAnnotations("annotations", + buildTestAnnotations( map[string]string{ "test1": "stable", "test3": "stable", }), - buildTestAnnotations("annotations", + buildTestAnnotations( map[string]string{ "test1": "stable", "test2": "stable,beta", @@ -109,7 +109,7 @@ func TestValidateAnnotations(t *testing.T) { }, { []byte("\t"), - buildTestAnnotations("annotations", + buildTestAnnotations( map[string]string{ "test1": "stable", "test2": "stable,beta", @@ -117,7 +117,7 @@ func TestValidateAnnotations(t *testing.T) { fmt.Errorf("yaml: found character that cannot start any token"), }, { - buildTestAnnotations("annotations", + buildTestAnnotations( map[string]string{ "test1": "stable", "test2": "stable,beta", @@ -132,7 +132,7 @@ func TestValidateAnnotations(t *testing.T) { if item.err != nil { require.Equal(t, item.err.Error(), err.Error()) } else { - require.Nil(t, err) + require.NoError(t, err) } } } @@ -183,10 +183,10 @@ COPY x/y/z /metadata/ } for _, tt := range tests { - tt_expected := fmt.Sprintf(expected, tt.baseImage) + ttExpected := fmt.Sprintf(expected, tt.baseImage) actual, err := GenerateDockerfile("test1", "test2", "metadata/", filepath.Join("a", "b", "c"), filepath.Join("x", "y", "z"), "./", "test4", "test5", "", tt.baseImage) require.NoError(t, err) - require.Equal(t, tt_expected, string(actual)) + require.Equal(t, ttExpected, string(actual)) } } diff --git a/pkg/lib/bundle/interpreter.go b/pkg/lib/bundle/interpreter.go index d523b82eb..f3efaeea8 100644 --- a/pkg/lib/bundle/interpreter.go +++ b/pkg/lib/bundle/interpreter.go @@ -32,9 +32,10 @@ func NewBundleDirInterperter(bundleDir string) (*bundleDirInterpreter, error) { return &bundleDirInterpreter{bundleCsvName: csv.GetName(), pkg: p}, nil } -func (b *bundleDirInterpreter) GetBundleChannels() (channelNames []string) { +func (b *bundleDirInterpreter) GetBundleChannels() []string { + var channelNames []string for channelName, channel := range b.pkg.Channels { - for bundle, _ := range channel.Nodes { + for bundle := range channel.Nodes { if bundle.CsvName == b.bundleCsvName { channelNames = append(channelNames, channelName) break @@ -42,7 +43,7 @@ func (b *bundleDirInterpreter) GetBundleChannels() (channelNames []string) { } } sort.Strings(channelNames) - return + return channelNames } func (b *bundleDirInterpreter) GetDefaultChannel() string { diff --git a/pkg/lib/bundle/utils_test.go b/pkg/lib/bundle/utils_test.go index 6757b6ac7..b1977068e 100644 --- a/pkg/lib/bundle/utils_test.go +++ b/pkg/lib/bundle/utils_test.go @@ -36,7 +36,7 @@ func cleanup() { } func createDir(dir string) { - os.MkdirAll(dir, os.ModePerm) + _ = os.MkdirAll(dir, os.ModePerm) } func createFiles(dir, input string) { @@ -56,20 +56,9 @@ func createFiles(dir, input string) { } } -func buildTestAnnotations(key string, items map[string]string) []byte { +func buildTestAnnotations(items map[string]string) []byte { temp := make(map[string]interface{}) - temp[key] = items + temp["annotations"] = items output, _ := yaml.Marshal(temp) return output } - -func clearDir(dir string) { - items, _ := os.ReadDir(dir) - - for _, item := range items { - if item.IsDir() { - continue - } - os.Remove(filepath.Join(dir, item.Name())) - } -} diff --git a/pkg/lib/bundle/validate.go b/pkg/lib/bundle/validate.go index 66e29dffc..2ed926603 100644 --- a/pkg/lib/bundle/validate.go +++ b/pkg/lib/bundle/validate.go @@ -22,6 +22,7 @@ import ( "github.com/operator-framework/api/pkg/manifests" v1 "github.com/operator-framework/api/pkg/operators/v1alpha1" v "github.com/operator-framework/api/pkg/validation" + "github.com/operator-framework/operator-registry/pkg/image" validation "github.com/operator-framework/operator-registry/pkg/lib/validation" "github.com/operator-framework/operator-registry/pkg/registry" @@ -99,10 +100,12 @@ func (i imageValidator) ValidateBundleFormat(directory string) error { } } - if manifestsFound == false { + if !manifestsFound { + // nolint:stylecheck validationErrors = append(validationErrors, fmt.Errorf("Unable to locate manifests directory")) } - if metadataFound == false { + if !metadataFound { + // nolint:stylecheck validationErrors = append(validationErrors, fmt.Errorf("Unable to locate metadata directory")) } @@ -144,6 +147,7 @@ func (i imageValidator) ValidateBundleFormat(directory string) error { } if !annotationsFound { + // nolint:stylecheck validationErrors = append(validationErrors, fmt.Errorf("Could not find annotations file")) } else { i.logger.Debug("Found annotations file") @@ -185,6 +189,7 @@ func validateAnnotations(mediaType string, fileAnnotations *AnnotationMetadata) for label, item := range annotations { val, ok := fileAnnotations.Annotations[label] if !ok && label != ChannelDefaultLabel { + // nolint:stylecheck aErr := fmt.Errorf("Missing annotation %q", label) validationErrors = append(validationErrors, aErr) } @@ -192,26 +197,31 @@ func validateAnnotations(mediaType string, fileAnnotations *AnnotationMetadata) switch label { case MediatypeLabel: if item != val { + // nolint:stylecheck aErr := fmt.Errorf("Expecting annotation %q to have value %q instead of %q", label, item, val) validationErrors = append(validationErrors, aErr) } case ManifestsLabel: if item != ManifestsDir { + // nolint:stylecheck aErr := fmt.Errorf("Expecting annotation %q to have value %q instead of %q", label, ManifestsDir, val) validationErrors = append(validationErrors, aErr) } case MetadataDir: if item != MetadataLabel { + // nolint:stylecheck aErr := fmt.Errorf("Expecting annotation %q to have value %q instead of %q", label, MetadataDir, val) validationErrors = append(validationErrors, aErr) } case ChannelsLabel: if val == "" { + // nolint:stylecheck aErr := fmt.Errorf("Expecting annotation %q to have non-empty value", label) validationErrors = append(validationErrors, aErr) } case ChannelDefaultLabel: if ok && val == "" { + // nolint:stylecheck aErr := fmt.Errorf("Expecting annotation %q to have non-empty value", label) validationErrors = append(validationErrors, aErr) } @@ -291,6 +301,7 @@ func (i imageValidator) ValidateBundleContent(manifestDir string) error { fileWithPath := filepath.Join(manifestDir, item.Name()) data, err := os.ReadFile(fileWithPath) if err != nil { + // nolint:stylecheck validationErrors = append(validationErrors, fmt.Errorf("Unable to read file %s in supported types", fileWithPath)) continue } @@ -313,6 +324,7 @@ func (i imageValidator) ValidateBundleContent(manifestDir string) error { continue } + // nolint:nestif if gvk.Kind == CSVKind { err := runtime.DefaultUnstructuredConverter.FromUnstructured(k8sFile.Object, csv) if err != nil { @@ -361,6 +373,7 @@ func (i imageValidator) ValidateBundleContent(manifestDir string) error { } } default: + // nolint:stylecheck validationErrors = append(validationErrors, fmt.Errorf("Unsupported api version of CRD: %s", gv)) } } else { @@ -390,6 +403,7 @@ func (i imageValidator) ValidateBundleContent(manifestDir string) error { if _, ok := optionalValidators[validateOperatorHubKey]; ok { i.logger.Debug("Performing operatorhub validation") bundle := &manifests.Bundle{Name: csvName, CSV: csv} + // nolint:staticcheck results := v.OperatorHubValidator.Validate(bundle) if len(results) > 0 { for _, err := range results[0].Errors { diff --git a/pkg/lib/bundle/validate_test.go b/pkg/lib/bundle/validate_test.go index aafe18a69..cb4a7283f 100644 --- a/pkg/lib/bundle/validate_test.go +++ b/pkg/lib/bundle/validate_test.go @@ -98,7 +98,7 @@ func TestValidateBundle_InvalidRegistryVersion(t *testing.T) { var validationError ValidationError isValidationErr := errors.As(err, &validationError) require.True(t, isValidationErr) - require.Equal(t, len(validationError.Errors), 1) + require.Len(t, validationError.Errors, 1) } func TestValidateBundleContent(t *testing.T) { diff --git a/pkg/lib/dns/nsswitch.go b/pkg/lib/dns/nsswitch.go index 1693272fd..d648e670c 100644 --- a/pkg/lib/dns/nsswitch.go +++ b/pkg/lib/dns/nsswitch.go @@ -23,5 +23,6 @@ func EnsureNsswitch() error { return nil } + // nolint:gosec return os.WriteFile(NsswitchFilename, NsswitchContents, 0644) } diff --git a/pkg/lib/dns/nsswitch_test.go b/pkg/lib/dns/nsswitch_test.go index c49bc6b0e..02fd17819 100644 --- a/pkg/lib/dns/nsswitch_test.go +++ b/pkg/lib/dns/nsswitch_test.go @@ -49,7 +49,7 @@ func TestEnsureNsswitch(t *testing.T) { NsswitchFilename = "testfile" if tt.existingFile { - require.NoError(t, os.WriteFile(NsswitchFilename, []byte("test"), 0644)) + require.NoError(t, os.WriteFile(NsswitchFilename, []byte("test"), 0600)) } if err := EnsureNsswitch(); (err != nil) != tt.wantErr { diff --git a/pkg/lib/image/registry.go b/pkg/lib/image/registry.go index 2c5c7f07a..c535379ae 100644 --- a/pkg/lib/image/registry.go +++ b/pkg/lib/image/registry.go @@ -99,16 +99,19 @@ func RunDockerRegistry(ctx context.Context, rootDir string, configOpts ...Config } }() - err = wait.Poll(100*time.Millisecond, 10*time.Second, func() (done bool, err error) { + // nolint:staticcheck + err = wait.Poll(100*time.Millisecond, 10*time.Second, func() (bool, error) { tr := &http.Transport{TLSClientConfig: &tls.Config{ InsecureSkipVerify: false, RootCAs: certPool, + MinVersion: tls.VersionTLS12, }} client := &http.Client{Transport: tr} r, err := client.Get("https://" + host + "/v2/") if err != nil { return false, nil } + defer r.Body.Close() if r.StatusCode == http.StatusOK { return true, nil } diff --git a/pkg/lib/indexer/indexer.go b/pkg/lib/indexer/indexer.go index b3e5c1848..e91aba091 100644 --- a/pkg/lib/indexer/indexer.go +++ b/pkg/lib/indexer/indexer.go @@ -37,6 +37,7 @@ const ( concurrencyLimitForExport = 10 ) +// nolint:stylecheck var ErrFileBasedCatalogPrune = errors.New("`opm index prune` only supports sqlite-based catalogs. See https://github.com/redhat-openshift-ecosystem/community-operators-prod/issues/793 for instructions on pruning a plaintext files backed catalog.") // ImageIndexer is a struct implementation of the Indexer interface @@ -409,9 +410,10 @@ func copyDatabaseTo(databaseFile, targetDir string) (string, error) { return to.Name(), err } -func buildContext(generate bool, requestedDockerfile string) (buildDir, outDockerfile string, cleanup func(), err error) { +func buildContext(generate bool, requestedDockerfile string) (string, string, func(), error) { + var buildDir, outDockerfile string // set cleanup to a no-op until explicitly set - cleanup = func() {} + cleanup := func() {} if generate { buildDir = "./" @@ -421,13 +423,13 @@ func buildContext(generate bool, requestedDockerfile string) (buildDir, outDocke outDockerfile = requestedDockerfile } cleanup = func() {} - return + return buildDir, outDockerfile, cleanup, nil } // set a temp directory for building the new image - buildDir, err = os.MkdirTemp(".", tmpBuildDirPrefix) + buildDir, err := os.MkdirTemp(".", tmpBuildDirPrefix) if err != nil { - return + return "", "", cleanup, err } cleanup = func() { os.RemoveAll(buildDir) @@ -435,14 +437,14 @@ func buildContext(generate bool, requestedDockerfile string) (buildDir, outDocke if len(requestedDockerfile) > 0 { outDockerfile = requestedDockerfile - return + return buildDir, outDockerfile, cleanup, nil } // generate a temp dockerfile if needed tempDockerfile, err := os.CreateTemp(".", defaultDockerfileName) if err != nil { defer cleanup() - return + return "", "", cleanup, err } outDockerfile = tempDockerfile.Name() cleanup = func() { @@ -450,7 +452,7 @@ func buildContext(generate bool, requestedDockerfile string) (buildDir, outDocke os.Remove(outDockerfile) } - return + return buildDir, outDockerfile, cleanup, nil } func build(dockerfilePath, imageTag string, commandRunner containertools.CommandRunner, logger *logrus.Entry) error { @@ -561,6 +563,7 @@ func (i ImageIndexer) ExportFromIndex(request ExportFromIndexRequest) error { // generate a random folder name if bundle version is empty if bundleDir.bundleVersion == "" { + // nolint:gosec bundleDir.bundleVersion = strconv.Itoa(rand.Intn(10000)) } exporter := bundle.NewExporterForBundle(bundleImage, filepath.Join(request.DownloadPath, bundleDir.pkgName, bundleDir.bundleVersion), request.ContainerTool) @@ -600,7 +603,7 @@ func getBundlesToExport(dbQuerier pregistry.Query, packages []string) (map[strin if err != nil { return nil, err } - for k, _ := range bundlesForPackage { + for k := range bundlesForPackage { bundleMap[k.BundlePath] = bundleDirPrefix{pkgName: packageName, bundleVersion: k.Version} } } diff --git a/pkg/lib/indexer/indexer_test.go b/pkg/lib/indexer/indexer_test.go index f2fce1d32..570b1eabd 100644 --- a/pkg/lib/indexer/indexer_test.go +++ b/pkg/lib/indexer/indexer_test.go @@ -33,15 +33,15 @@ func TestGetBundlesToExport(t *testing.T) { t.Fatalf("exporting bundles from db: %s", err) } - var bundleImages []string - for bundlePath, _ := range bundleMap { + bundleImages := make([]string, 0, len(bundleMap)) + for bundlePath := range bundleMap { bundleImages = append(bundleImages, bundlePath) } sort.Strings(bundleImages) if !reflect.DeepEqual(expected, bundleImages) { - t.Fatalf("exporting images: expected matching bundlepaths: expected %s got %s", expected, bundleImages) + t.Fatalf("exporting images: expected matching bundlepaths: expected %#v got %#v", expected, bundleImages) } } diff --git a/pkg/lib/indexer/interfaces.go b/pkg/lib/indexer/interfaces.go index 5ebefdd1e..26fea581d 100644 --- a/pkg/lib/indexer/interfaces.go +++ b/pkg/lib/indexer/interfaces.go @@ -2,9 +2,10 @@ package indexer import ( + "github.com/sirupsen/logrus" + "github.com/operator-framework/operator-registry/pkg/containertools" "github.com/operator-framework/operator-registry/pkg/lib/registry" - "github.com/sirupsen/logrus" ) // IndexAdder allows the creation of index container images from scratch or diff --git a/pkg/lib/registry/registry.go b/pkg/lib/registry/registry.go index a4174197b..d6be014e1 100644 --- a/pkg/lib/registry/registry.go +++ b/pkg/lib/registry/registry.go @@ -2,6 +2,7 @@ package registry import ( "context" + "errors" "fmt" "os" @@ -133,6 +134,7 @@ func unpackImage(ctx context.Context, reg image.Registry, ref image.Reference) ( func populate(ctx context.Context, loader registry.Load, graphLoader registry.GraphLoader, querier registry.Query, reg image.Registry, refs []image.Reference, mode registry.Mode, overwrite bool) error { unpackedImageMap := make(map[image.Reference]string, 0) overwrittenBundles := map[string][]string{} + // nolint:prealloc var imagesToAdd []*registry.Bundle for _, ref := range refs { to, from, cleanup, err := unpackImage(ctx, reg, ref) @@ -151,7 +153,7 @@ func populate(ctx context.Context, loader registry.Load, graphLoader registry.Gr if overwrite { overwritten, err := querier.GetBundlePathIfExists(ctx, img.Bundle.Name) if err != nil { - if err == registry.ErrBundleImageNotInDatabase { + if errors.Is(err, registry.ErrBundleImageNotInDatabase) { continue } return err @@ -166,9 +168,7 @@ func populate(ctx context.Context, loader registry.Load, graphLoader registry.Gr populator := registry.NewDirectoryPopulator(loader, graphLoader, querier, unpackedImageMap, overwrittenBundles) if err := populator.Populate(mode); err != nil { - return err - } return checkForBundles(ctx, querier.(*sqlite.SQLQuerier), graphLoader, imagesToAdd) } @@ -393,6 +393,7 @@ func checkForBundlePaths(querier registry.GRPCQuery, bundlePaths []string) ([]st registryBundlePaths[b.BundlePath] = struct{}{} } + // nolint:prealloc var found, missing []string for _, b := range bundlePaths { if _, ok := registryBundlePaths[b]; ok { @@ -410,7 +411,7 @@ func checkForBundlePaths(querier registry.GRPCQuery, bundlePaths []string) ([]st // replaces mode selects highest version as channel head and // prunes any bundles in the upgrade chain after the channel head. // check for the presence of newly added bundles after a replaces-mode add. -func checkForBundles(ctx context.Context, q *sqlite.SQLQuerier, g registry.GraphLoader, required []*registry.Bundle) error { +func checkForBundles(_ context.Context, _ *sqlite.SQLQuerier, g registry.GraphLoader, required []*registry.Bundle) error { var errs []error for _, bundle := range required { graph, err := g.Generate(bundle.Package) diff --git a/pkg/lib/registry/registry_test.go b/pkg/lib/registry/registry_test.go index 71092faf8..aa4012527 100644 --- a/pkg/lib/registry/registry_test.go +++ b/pkg/lib/registry/registry_test.go @@ -2,21 +2,22 @@ package registry import ( "context" + "crypto/rand" "database/sql" "encoding/json" "errors" "fmt" "io" - "math/rand" + "math" + "math/big" "os" "path/filepath" "testing" "testing/fstest" - "time" "github.com/blang/semver/v4" "github.com/stretchr/testify/require" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "sigs.k8s.io/yaml" @@ -78,13 +79,13 @@ func newCache(t *testing.T, bundles []*model.Bundle) cache.Cache { } } if !pkgPropertyFound { - pkgJson, _ := json.Marshal(property.Package{ + pkgJSON, _ := json.Marshal(property.Package{ PackageName: b.Package.Name, Version: b.Version.String(), }) b.Properties = append(b.Properties, property.Property{ Type: property.TypePackage, - Value: pkgJson, + Value: pkgJSON, }) } } @@ -281,12 +282,10 @@ func TestUnpackImage(t *testing.T) { } } -func init() { - rand.Seed(time.Now().UTC().UnixNano()) -} - -func CreateTestDb(t *testing.T) (*sql.DB, func()) { - dbName := fmt.Sprintf("test-%d.db", rand.Int()) +func CreateTestDB(t *testing.T) (*sql.DB, func()) { + r, err := rand.Int(rand.Reader, big.NewInt(math.MaxInt64)) + require.NoError(t, err) + dbName := fmt.Sprintf("test-%d.db", r) db, err := sqlite.Open(dbName) require.NoError(t, err) @@ -326,10 +325,10 @@ func newUnpackedTestBundle(dir, name string, csvSpec json.RawMessage, annotation } rawCSV, err := json.Marshal(registry.ClusterServiceVersion{ - TypeMeta: v1.TypeMeta{ + TypeMeta: metav1.TypeMeta{ Kind: sqlite.ClusterServiceVersionKind, }, - ObjectMeta: v1.ObjectMeta{ + ObjectMeta: metav1.ObjectMeta{ Name: name, }, Spec: csvSpec, @@ -342,14 +341,17 @@ func newUnpackedTestBundle(dir, name string, csvSpec json.RawMessage, annotation if err := json.Unmarshal(rawCSV, &rawObj); err != nil { return bundleDir, cleanup, err } - rawObj.SetCreationTimestamp(v1.Time{}) + rawObj.SetCreationTimestamp(metav1.Time{}) jsonout, err := rawObj.MarshalJSON() + if err != nil { + return bundleDir, cleanup, err + } out, err := yaml.JSONToYAML(jsonout) if err != nil { return bundleDir, cleanup, err } - if err := os.WriteFile(filepath.Join(bundleDir, bundle.ManifestsDir, "csv.yaml"), out, 0666); err != nil { + if err := os.WriteFile(filepath.Join(bundleDir, bundle.ManifestsDir, "csv.yaml"), out, 0600); err != nil { return bundleDir, cleanup, err } @@ -357,7 +359,7 @@ func newUnpackedTestBundle(dir, name string, csvSpec json.RawMessage, annotation if err != nil { return bundleDir, cleanup, err } - if err := os.WriteFile(filepath.Join(bundleDir, bundle.MetadataDir, "annotations.yaml"), out, 0666); err != nil { + if err := os.WriteFile(filepath.Join(bundleDir, bundle.MetadataDir, "annotations.yaml"), out, 0600); err != nil { return bundleDir, cleanup, err } return bundleDir, cleanup, nil @@ -653,7 +655,7 @@ func TestCheckForBundles(t *testing.T) { for _, tt := range tests { t.Run(tt.description, func(t *testing.T) { tmpdir := t.TempDir() - db, cleanup := CreateTestDb(t) + db, cleanup := CreateTestDB(t) defer cleanup() load, err := sqlite.NewSQLLiteLoader(db) require.NoError(t, err) @@ -693,7 +695,6 @@ func TestCheckForBundles(t *testing.T) { overwriteRefs[img.Bundle.Package] = append(overwriteRefs[img.Bundle.Package], name) } refs[image.SimpleReference(bundleImage)] = dir - } require.NoError(t, registry.NewDirectoryPopulator( load, @@ -704,6 +705,7 @@ func TestCheckForBundles(t *testing.T) { } err = checkForBundles(context.TODO(), query, graphLoader, expected) if step.wantErr == nil { + // nolint:testifylint require.NoError(t, err, fmt.Sprintf("%d", step.action)) continue } diff --git a/pkg/lib/semver/semver.go b/pkg/lib/semver/semver.go index 6875566d0..60721cdaf 100644 --- a/pkg/lib/semver/semver.go +++ b/pkg/lib/semver/semver.go @@ -8,6 +8,7 @@ import ( // BuildIdCompare compares two versions and returns negative one if the first arg is less than the second arg, positive one if it is larger, and zero if they are equal. // This comparison follows typical semver precedence rules, with one addition: whenever two versions are equal with the exception of their build-ids, the build-ids are compared using prerelease precedence rules. Further, versions with no build-id are always less than versions with build-ids; e.g. 1.0.0 < 1.0.0+1. +// nolint:stylecheck func BuildIdCompare(b semver.Version, v semver.Version) (int, error) { if c := b.Compare(v); c != 0 { return c, nil @@ -27,6 +28,7 @@ func BuildIdCompare(b semver.Version, v semver.Version) (int, error) { } func buildAsPrerelease(v semver.Version) (*semver.Version, error) { + // nolint:prealloc var pre []semver.PRVersion for _, b := range v.Build { p, err := semver.NewPRVersion(b) diff --git a/pkg/lib/tmp/copy.go b/pkg/lib/tmp/copy.go index a48a3e219..f72a59ad8 100644 --- a/pkg/lib/tmp/copy.go +++ b/pkg/lib/tmp/copy.go @@ -7,7 +7,7 @@ import ( ) // CopyTmpDB reads the file at the given path and copies it to a tmp directory, returning the copied file path or an err -func CopyTmpDB(original string) (path string, err error) { +func CopyTmpDB(original string) (string, error) { dst, err := os.CreateTemp("", "db-") if err != nil { return "", err diff --git a/pkg/lib/unstructured/unstructured.go b/pkg/lib/unstructured/unstructured.go index b6f3f4a82..bc81d227d 100644 --- a/pkg/lib/unstructured/unstructured.go +++ b/pkg/lib/unstructured/unstructured.go @@ -7,10 +7,10 @@ import ( "path" "strings" - "github.com/operator-framework/operator-registry/pkg/api" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/util/yaml" + + "github.com/operator-framework/operator-registry/pkg/api" ) func FromReader(reader io.Reader) (*unstructured.Unstructured, error) { @@ -49,7 +49,7 @@ func FromDir(dirpath string) ([]*unstructured.Unstructured, error) { return nil, err } - unsts := make([]*unstructured.Unstructured, 0, 0) + unsts := make([]*unstructured.Unstructured, 0) for _, file := range files { unst, err := FromFile(path.Join(dirpath, file.Name())) if err != nil { diff --git a/pkg/lib/validation/bundle.go b/pkg/lib/validation/bundle.go index d8f6d5b8e..a88b7b630 100644 --- a/pkg/lib/validation/bundle.go +++ b/pkg/lib/validation/bundle.go @@ -8,12 +8,14 @@ import ( "github.com/operator-framework/api/pkg/validation/errors" interfaces "github.com/operator-framework/api/pkg/validation/interfaces" + "github.com/operator-framework/operator-registry/pkg/registry" ) var RegistryBundleValidator interfaces.Validator = interfaces.ValidatorFunc(validateBundles) -func validateBundles(objs ...interface{}) (results []errors.ManifestResult) { +func validateBundles(objs ...interface{}) []errors.ManifestResult { + var results []errors.ManifestResult for _, obj := range objs { switch v := obj.(type) { case *registry.Bundle: @@ -23,7 +25,8 @@ func validateBundles(objs ...interface{}) (results []errors.ManifestResult) { return results } -func validateBundle(bundle *registry.Bundle) (result errors.ManifestResult) { +func validateBundle(bundle *registry.Bundle) errors.ManifestResult { + var result errors.ManifestResult csv, err := bundle.ClusterServiceVersion() if err != nil { result.Add(errors.ErrInvalidParse("error getting bundle CSV", err)) @@ -39,7 +42,8 @@ func validateBundle(bundle *registry.Bundle) (result errors.ManifestResult) { return result } -func validateOwnedCRDs(bundle *registry.Bundle, csv *registry.ClusterServiceVersion) (result errors.ManifestResult) { +func validateOwnedCRDs(bundle *registry.Bundle, csv *registry.ClusterServiceVersion) errors.ManifestResult { + var result errors.ManifestResult ownedKeys, _, err := csv.GetCustomResourceDefintions() if err != nil { result.Add(errors.ErrInvalidParse("error getting CSV CRDs", err)) diff --git a/pkg/lib/validation/bundle_test.go b/pkg/lib/validation/bundle_test.go index a0e31eef5..116099384 100644 --- a/pkg/lib/validation/bundle_test.go +++ b/pkg/lib/validation/bundle_test.go @@ -6,11 +6,11 @@ import ( "strings" "testing" - "github.com/operator-framework/operator-registry/pkg/registry" "github.com/stretchr/testify/require" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - k8syaml "k8s.io/apimachinery/pkg/util/yaml" + + "github.com/operator-framework/operator-registry/pkg/registry" ) func TestValidateBundle(t *testing.T) { diff --git a/pkg/mirror/mirror_test.go b/pkg/mirror/mirror_test.go index 301380a14..e5de413c1 100644 --- a/pkg/mirror/mirror_test.go +++ b/pkg/mirror/mirror_test.go @@ -2,9 +2,11 @@ package mirror import ( "context" + "crypto/rand" "database/sql" "fmt" - "math/rand" + "math" + "math/big" "os" "testing" @@ -13,8 +15,10 @@ import ( "github.com/operator-framework/operator-registry/pkg/sqlite" ) -func CreateTestDb(t *testing.T) (*sql.DB, string, func()) { - dbName := fmt.Sprintf("test-%d.db", rand.Int()) +func CreateTestDB(t *testing.T) (*sql.DB, string, func()) { + r, err := rand.Int(rand.Reader, big.NewInt(math.MaxInt64)) + require.NoError(t, err) + dbName := fmt.Sprintf("test-%d.db", r.Int64()) db, err := sqlite.Open(dbName) require.NoError(t, err) @@ -39,10 +43,10 @@ func CreateTestDb(t *testing.T) (*sql.DB, string, func()) { } func TestIndexImageMirrorer_Mirror(t *testing.T) { - _, path, cleanup := CreateTestDb(t) + _, path, cleanup := CreateTestDB(t) defer cleanup() - var testExtractor DatabaseExtractorFunc = func(from string) (s string, e error) { + var testExtractor DatabaseExtractorFunc = func(from string) (string, error) { return path, nil } type fields struct { diff --git a/pkg/mirror/options.go b/pkg/mirror/options.go index c9d3b3d9e..51c004faa 100644 --- a/pkg/mirror/options.go +++ b/pkg/mirror/options.go @@ -44,30 +44,30 @@ func (o *IndexImageMirrorerOptions) Complete() error { } // Apply sequentially applies the given options to the config. -func (c *IndexImageMirrorerOptions) Apply(options []ImageIndexMirrorOption) { +func (o *IndexImageMirrorerOptions) Apply(options []ImageIndexMirrorOption) { for _, option := range options { - option(c) + option(o) } } // ToOption converts an IndexImageMirrorerOptions object into a function that applies // its current configuration to another IndexImageMirrorerOptions instance -func (c *IndexImageMirrorerOptions) ToOption() ImageIndexMirrorOption { - return func(o *IndexImageMirrorerOptions) { - if c.ImageMirrorer != nil { - o.ImageMirrorer = c.ImageMirrorer +func (o *IndexImageMirrorerOptions) ToOption() ImageIndexMirrorOption { + return func(io *IndexImageMirrorerOptions) { + if o.ImageMirrorer != nil { + io.ImageMirrorer = o.ImageMirrorer } - if c.DatabaseExtractor != nil { - o.DatabaseExtractor = c.DatabaseExtractor + if o.DatabaseExtractor != nil { + io.DatabaseExtractor = o.DatabaseExtractor } - if c.Source != "" { - o.Source = c.Source + if o.Source != "" { + io.Source = o.Source } - if c.Dest != "" { - o.Dest = c.Dest + if o.Dest != "" { + io.Dest = o.Dest } - if c.ManifestDir != "" { - o.ManifestDir = c.ManifestDir + if o.ManifestDir != "" { + io.ManifestDir = o.ManifestDir } } } diff --git a/pkg/prettyunmarshaler/prettyunmarshaler.go b/pkg/prettyunmarshaler/prettyunmarshaler.go index 2f740151a..788428440 100644 --- a/pkg/prettyunmarshaler/prettyunmarshaler.go +++ b/pkg/prettyunmarshaler/prettyunmarshaler.go @@ -8,29 +8,29 @@ import ( "strings" ) -type JsonUnmarshalError struct { +type JSONUnmarshalError struct { data []byte offset int64 err error } -func NewJSONUnmarshalError(data []byte, err error) *JsonUnmarshalError { +func NewJSONUnmarshalError(data []byte, err error) *JSONUnmarshalError { var te *json.UnmarshalTypeError if errors.As(err, &te) { - return &JsonUnmarshalError{data: data, offset: te.Offset, err: te} + return &JSONUnmarshalError{data: data, offset: te.Offset, err: te} } var se *json.SyntaxError if errors.As(err, &se) { - return &JsonUnmarshalError{data: data, offset: se.Offset, err: se} + return &JSONUnmarshalError{data: data, offset: se.Offset, err: se} } - return &JsonUnmarshalError{data: data, offset: -1, err: err} + return &JSONUnmarshalError{data: data, offset: -1, err: err} } -func (e *JsonUnmarshalError) Error() string { +func (e *JSONUnmarshalError) Error() string { return e.err.Error() } -func (e *JsonUnmarshalError) Pretty() string { +func (e *JSONUnmarshalError) Pretty() string { if len(e.data) == 0 || e.offset < 0 || e.offset > int64(len(e.data)) { return e.err.Error() } @@ -82,7 +82,6 @@ func (e *JsonUnmarshalError) Pretty() string { // We found the byte in the pretty data that matches the byte in the original data, // so increment the pretty index. pIndex++ - } _, _ = sb.Write(pretty[:pOffset]) diff --git a/pkg/prettyunmarshaler/prettyunmarshaler_test.go b/pkg/prettyunmarshaler/prettyunmarshaler_test.go index a32287319..a904cd34f 100644 --- a/pkg/prettyunmarshaler/prettyunmarshaler_test.go +++ b/pkg/prettyunmarshaler/prettyunmarshaler_test.go @@ -20,6 +20,7 @@ func TestJsonUnmarshalError(t *testing.T) { } validData := []byte(`{"messages": ["Hello", "world!"]}`) invalidData := []byte(`{"messages": ["Hello", "world!"]`) + var invalidDataSource byte = 0 for _, tc := range []testCase{ { name: "unknown error", @@ -91,7 +92,7 @@ func TestJsonUnmarshalError(t *testing.T) { { name: "syntax error: no data", data: nil, - inErr: json.Unmarshal(invalidData, nil), + inErr: json.Unmarshal(invalidData, &invalidDataSource), expectErrorString: `unexpected end of JSON input`, expectPrettyString: `unexpected end of JSON input`, }, @@ -148,7 +149,13 @@ func TestJsonUnmarshalError(t *testing.T) { // // If the data does not cause a syntax error, this function will panic. func customOffsetSyntaxError(data []byte, offset int64) *json.SyntaxError { - err := json.Unmarshal(data, nil).(*json.SyntaxError) - err.Offset = offset - return err + var d *byte = nil + var se *json.SyntaxError + err := json.Unmarshal(data, d) + if errors.As(err, &se) { + se.Offset = offset + return se + } + + panic("error was not of type json.SyntaxError") } diff --git a/pkg/registry/bundle.go b/pkg/registry/bundle.go index b5fb28b94..8b3be74b0 100644 --- a/pkg/registry/bundle.go +++ b/pkg/registry/bundle.go @@ -7,7 +7,6 @@ import ( apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" apiextensionsv1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/serializer" @@ -54,7 +53,8 @@ type Bundle struct { func NewBundle(name string, annotations *Annotations, objs ...*unstructured.Unstructured) *Bundle { bundle := &Bundle{ - Name: name, + Name: name, + // nolint:staticcheck Package: annotations.PackageName, Annotations: annotations, } @@ -62,6 +62,7 @@ func NewBundle(name string, annotations *Annotations, objs ...*unstructured.Unst bundle.Add(o) } + // nolint:staticcheck if annotations == nil { return bundle } @@ -168,6 +169,7 @@ func (b *Bundle) CustomResourceDefinitions() ([]runtime.Object, error) { if err := b.cache(); err != nil { return nil, err } + // nolint:prealloc var crds []runtime.Object for _, crd := range b.v1crds { crds = append(crds, crd) @@ -235,7 +237,6 @@ func (b *Bundle) RequiredAPIs() (map[APIKey]struct{}, error) { return nil, fmt.Errorf("couldn't parse plural.group from crd name: %s", api.Name) } required[APIKey{parts[1], api.Version, api.Kind, parts[0]}] = struct{}{} - } _, requiredAPIs, err := csv.GetApiServiceDefinitions() if err != nil { @@ -278,10 +279,18 @@ func (b *Bundle) AllProvidedAPIsInBundle() error { return nil } -func (b *Bundle) Serialize() (csvName, bundleImage string, csvBytes []byte, bundleBytes []byte, annotationBytes []byte, err error) { +// (csvName, bundleImage string, csvBytes []byte, bundleBytes []byte, annotationBytes []byte, err error) { +func (b *Bundle) Serialize() (string, string, []byte, []byte, []byte, error) { + var bundleBytes []byte + var csvName string + var csvBytes []byte + var annotationBytes []byte + var err error + csvCount := 0 for _, obj := range b.Objects { - objBytes, err := runtime.Encode(unstructured.UnstructuredJSONScheme, obj) + var objBytes []byte + objBytes, err = runtime.Encode(unstructured.UnstructuredJSONScheme, obj) if err != nil { return "", "", nil, nil, nil, err } @@ -301,7 +310,7 @@ func (b *Bundle) Serialize() (csvName, bundleImage string, csvBytes []byte, bund } if b.Annotations != nil { - annotationBytes, err = json.Marshal(b.Annotations) + annotationBytes, _ = json.Marshal(b.Annotations) } return csvName, b.BundleImage, csvBytes, bundleBytes, annotationBytes, nil diff --git a/pkg/registry/bundle_test.go b/pkg/registry/bundle_test.go index 682d56938..a7fd8c8d4 100644 --- a/pkg/registry/bundle_test.go +++ b/pkg/registry/bundle_test.go @@ -8,13 +8,12 @@ import ( "strings" "testing" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "k8s.io/apimachinery/pkg/runtime/serializer" - k8syaml "k8s.io/apimachinery/pkg/util/yaml" - "github.com/stretchr/testify/require" apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" apiextensionsv1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/apimachinery/pkg/runtime/serializer" + k8syaml "k8s.io/apimachinery/pkg/util/yaml" ) const ( @@ -63,10 +62,11 @@ func TestV1CRDsInBundle(t *testing.T) { // check provided APIs in bundle are what is expected expectedAPIs := map[APIKey]struct{}{ - APIKey{Group: "objectbucket.io", Version: "v1alpha1", Kind: "ObjectBucket", Plural: "objectbuckets"}: {}, - APIKey{Group: "objectbucket.io", Version: "v1alpha1", Kind: "ObjectBucketClaim", Plural: "objectbucketclaims"}: {}, + {Group: "objectbucket.io", Version: "v1alpha1", Kind: "ObjectBucket", Plural: "objectbuckets"}: {}, + {Group: "objectbucket.io", Version: "v1alpha1", Kind: "ObjectBucketClaim", Plural: "objectbucketclaims"}: {}, } providedAPIs, err := bundle.ProvidedAPIs() + require.NoError(t, err) t.Logf("provided CRDs: \n%#v", providedAPIs) if !reflect.DeepEqual(expectedAPIs, providedAPIs) { @@ -77,6 +77,7 @@ func TestV1CRDsInBundle(t *testing.T) { // bundle contains one v1beta1 and one v1 CRD dec := serializer.NewCodecFactory(Scheme).UniversalDeserializer() crds, err := bundle.CustomResourceDefinitions() + require.NoError(t, err) for _, crd := range crds { switch crd.(type) { case *apiextensionsv1.CustomResourceDefinition: diff --git a/pkg/registry/bundlegraphloader.go b/pkg/registry/bundlegraphloader.go index e8664c4e8..2854003a2 100644 --- a/pkg/registry/bundlegraphloader.go +++ b/pkg/registry/bundlegraphloader.go @@ -16,6 +16,7 @@ type BundleGraphLoader struct { func (g *BundleGraphLoader) AddBundleToGraph(bundle *Bundle, graph *Package, annotations *AnnotationsFile, skippatch bool) (*Package, error) { bundleVersion, err := bundle.Version() if err != nil { + // nolint:stylecheck return nil, fmt.Errorf("Unable to extract bundle version from bundle %s, can't insert in semver mode", bundle.BundleImage) } @@ -43,6 +44,7 @@ func (g *BundleGraphLoader) AddBundleToGraph(bundle *Bundle, graph *Package, ann if graph.DefaultChannel == "" { // Infer default channel from channel list if annotations.SelectDefaultChannel() == "" { + // nolint:stylecheck return nil, fmt.Errorf("Default channel is missing and can't be inferred") } graph.DefaultChannel = annotations.SelectDefaultChannel() @@ -83,6 +85,7 @@ func (g *BundleGraphLoader) AddBundleToGraph(bundle *Bundle, graph *Package, ann for node := range channelGraph.Nodes { nodeVersion, err := semver.Make(node.Version) if err != nil { + // nolint:stylecheck return nil, fmt.Errorf("Unable to parse existing bundle version stored in index %s %s %s", node.CsvName, node.Version, node.BundlePath) } @@ -131,7 +134,7 @@ func (g *BundleGraphLoader) AddBundleToGraph(bundle *Bundle, graph *Package, ann // the new channel head if !lowestAhead.IsEmpty() { channelGraph.Nodes[lowestAhead] = map[BundleKey]struct{}{ - newBundleKey: struct{}{}, + newBundleKey: {}, } } else { channelGraph.Head = newBundleKey diff --git a/pkg/registry/bundlegraphloader_test.go b/pkg/registry/bundlegraphloader_test.go index 5d6e3c2a1..783b9b6da 100644 --- a/pkg/registry/bundlegraphloader_test.go +++ b/pkg/registry/bundlegraphloader_test.go @@ -5,7 +5,6 @@ import ( "testing" "github.com/blang/semver/v4" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) @@ -33,23 +32,23 @@ func TestBundleGraphLoader(t *testing.T) { Channels: map[string]Channel{ "alpha": {Head: BundleKey{CsvName: "etcdoperator.v0.9.2", Version: "0.9.2"}, Nodes: map[BundleKey]map[BundleKey]struct{}{ - BundleKey{CsvName: "etcdoperator.v0.6.1", Version: "0.6.1"}: {}, - BundleKey{CsvName: "etcdoperator.v0.9.0", Version: "0.9.0"}: {BundleKey{CsvName: "etcdoperator.v0.6.1", Version: "0.6.1"}: {}}, - BundleKey{CsvName: "etcdoperator.v0.9.2", Version: "0.9.2"}: {BundleKey{CsvName: "etcdoperator.v0.9.0", Version: "0.9.0"}: {}, + {CsvName: "etcdoperator.v0.6.1", Version: "0.6.1"}: {}, + {CsvName: "etcdoperator.v0.9.0", Version: "0.9.0"}: {BundleKey{CsvName: "etcdoperator.v0.6.1", Version: "0.6.1"}: {}}, + {CsvName: "etcdoperator.v0.9.2", Version: "0.9.2"}: {BundleKey{CsvName: "etcdoperator.v0.9.0", Version: "0.9.0"}: {}, BundleKey{CsvName: "etcdoperator.v0.9.1"}: {}}, }}, "beta": {Head: BundleKey{CsvName: "etcdoperator.v0.9.0", Version: "0.9.0"}, Nodes: map[BundleKey]map[BundleKey]struct{}{ - BundleKey{CsvName: "etcdoperator.v0.6.1", Version: "0.6.1"}: {}, - BundleKey{CsvName: "etcdoperator.v0.9.0", Version: "0.9.0"}: {BundleKey{CsvName: "etcdoperator.v0.6.1", Version: "0.6.1"}: {}}, + {CsvName: "etcdoperator.v0.6.1", Version: "0.6.1"}: {}, + {CsvName: "etcdoperator.v0.9.0", Version: "0.9.0"}: {BundleKey{CsvName: "etcdoperator.v0.6.1", Version: "0.6.1"}: {}}, }}, "stable": {Head: BundleKey{CsvName: "etcdoperator.v0.9.2", Version: "0.9.2"}, Nodes: map[BundleKey]map[BundleKey]struct{}{ - BundleKey{CsvName: "etcdoperator.v0.6.1", Version: "0.6.1"}: {}, - BundleKey{CsvName: "etcdoperator.v0.9.0", Version: "0.9.0"}: {BundleKey{CsvName: "etcdoperator.v0.6.1", Version: "0.6.1"}: {}}, - BundleKey{CsvName: "etcdoperator.v0.9.2", Version: "0.9.2"}: {BundleKey{CsvName: "etcdoperator.v0.9.0", Version: "0.9.0"}: {}, + {CsvName: "etcdoperator.v0.6.1", Version: "0.6.1"}: {}, + {CsvName: "etcdoperator.v0.9.0", Version: "0.9.0"}: {BundleKey{CsvName: "etcdoperator.v0.6.1", Version: "0.6.1"}: {}}, + {CsvName: "etcdoperator.v0.9.2", Version: "0.9.2"}: {BundleKey{CsvName: "etcdoperator.v0.9.0", Version: "0.9.0"}: {}, BundleKey{CsvName: "etcdoperator.v0.9.1"}: {}}, }}, }, @@ -71,26 +70,26 @@ func TestBundleGraphLoader(t *testing.T) { Channels: map[string]Channel{ "alpha": {Head: BundleKey{CsvName: "etcdoperator.v0.9.3", Version: "0.9.3"}, Nodes: map[BundleKey]map[BundleKey]struct{}{ - BundleKey{CsvName: "etcdoperator.v0.6.1", Version: "0.6.1"}: {}, - BundleKey{CsvName: "etcdoperator.v0.9.0", Version: "0.9.0"}: {BundleKey{CsvName: "etcdoperator.v0.6.1", Version: "0.6.1"}: {}}, - BundleKey{CsvName: "etcdoperator.v0.9.2", Version: "0.9.2"}: {BundleKey{CsvName: "etcdoperator.v0.9.0", Version: "0.9.0"}: {}, + {CsvName: "etcdoperator.v0.6.1", Version: "0.6.1"}: {}, + {CsvName: "etcdoperator.v0.9.0", Version: "0.9.0"}: {BundleKey{CsvName: "etcdoperator.v0.6.1", Version: "0.6.1"}: {}}, + {CsvName: "etcdoperator.v0.9.2", Version: "0.9.2"}: {BundleKey{CsvName: "etcdoperator.v0.9.0", Version: "0.9.0"}: {}, BundleKey{CsvName: "etcdoperator.v0.9.1"}: {}}, - BundleKey{CsvName: "etcdoperator.v0.9.3", Version: "0.9.3"}: {BundleKey{CsvName: "etcdoperator.v0.9.2", Version: "0.9.2"}: {}}, + {CsvName: "etcdoperator.v0.9.3", Version: "0.9.3"}: {BundleKey{CsvName: "etcdoperator.v0.9.2", Version: "0.9.2"}: {}}, }}, "beta": {Head: BundleKey{CsvName: "etcdoperator.v0.9.0", Version: "0.9.0"}, Nodes: map[BundleKey]map[BundleKey]struct{}{ - BundleKey{CsvName: "etcdoperator.v0.6.1", Version: "0.6.1"}: {}, - BundleKey{CsvName: "etcdoperator.v0.9.0", Version: "0.9.0"}: {BundleKey{CsvName: "etcdoperator.v0.6.1", Version: "0.6.1"}: {}}, + {CsvName: "etcdoperator.v0.6.1", Version: "0.6.1"}: {}, + {CsvName: "etcdoperator.v0.9.0", Version: "0.9.0"}: {BundleKey{CsvName: "etcdoperator.v0.6.1", Version: "0.6.1"}: {}}, }}, "stable": {Head: BundleKey{CsvName: "etcdoperator.v0.9.3", Version: "0.9.3"}, Nodes: map[BundleKey]map[BundleKey]struct{}{ - BundleKey{CsvName: "etcdoperator.v0.6.1", Version: "0.6.1"}: {}, - BundleKey{CsvName: "etcdoperator.v0.9.0", Version: "0.9.0"}: {BundleKey{CsvName: "etcdoperator.v0.6.1", Version: "0.6.1"}: {}}, - BundleKey{CsvName: "etcdoperator.v0.9.2", Version: "0.9.2"}: {BundleKey{CsvName: "etcdoperator.v0.9.0", Version: "0.9.0"}: {}, + {CsvName: "etcdoperator.v0.6.1", Version: "0.6.1"}: {}, + {CsvName: "etcdoperator.v0.9.0", Version: "0.9.0"}: {BundleKey{CsvName: "etcdoperator.v0.6.1", Version: "0.6.1"}: {}}, + {CsvName: "etcdoperator.v0.9.2", Version: "0.9.2"}: {BundleKey{CsvName: "etcdoperator.v0.9.0", Version: "0.9.0"}: {}, BundleKey{CsvName: "etcdoperator.v0.9.1"}: {}}, - BundleKey{CsvName: "etcdoperator.v0.9.3", Version: "0.9.3"}: {BundleKey{CsvName: "etcdoperator.v0.9.2", Version: "0.9.2"}: {}}, + {CsvName: "etcdoperator.v0.9.3", Version: "0.9.3"}: {BundleKey{CsvName: "etcdoperator.v0.9.2", Version: "0.9.2"}: {}}, }}, }, }, @@ -105,7 +104,7 @@ func TestBundleGraphLoader(t *testing.T) { Channels: map[string]Channel{ "beta": {Head: BundleKey{CsvName: "etcdoperator.v0.6.1", Version: "0.6.1"}, Nodes: map[BundleKey]map[BundleKey]struct{}{ - BundleKey{CsvName: "etcdoperator.v0.6.1", Version: "0.6.1"}: {}, + {CsvName: "etcdoperator.v0.6.1", Version: "0.6.1"}: {}, }}, }, }, @@ -131,7 +130,7 @@ func TestBundleGraphLoader(t *testing.T) { Channels: map[string]Channel{ "beta": {Head: BundleKey{CsvName: "etcdoperator.v0.9.3", Version: "0.9.3"}, Nodes: map[BundleKey]map[BundleKey]struct{}{ - BundleKey{CsvName: "etcdoperator.v0.9.3", Version: "0.9.3"}: {}, + {CsvName: "etcdoperator.v0.9.3", Version: "0.9.3"}: {}, }}, }, }, @@ -152,8 +151,8 @@ func TestBundleGraphLoader(t *testing.T) { Channels: map[string]Channel{ "beta": {Head: BundleKey{CsvName: "etcdoperator.v0.9.3", Version: "0.9.3"}, Nodes: map[BundleKey]map[BundleKey]struct{}{ - BundleKey{CsvName: "etcdoperator.v0.6.1", Version: "0.6.1"}: {}, - BundleKey{CsvName: "etcdoperator.v0.9.3", Version: "0.9.3"}: {BundleKey{CsvName: "etcdoperator.v0.6.1", Version: "0.6.1"}: {}}, + {CsvName: "etcdoperator.v0.6.1", Version: "0.6.1"}: {}, + {CsvName: "etcdoperator.v0.9.3", Version: "0.9.3"}: {BundleKey{CsvName: "etcdoperator.v0.6.1", Version: "0.6.1"}: {}}, }}, }, }, @@ -168,7 +167,7 @@ func TestBundleGraphLoader(t *testing.T) { Channels: map[string]Channel{ "beta": {Head: BundleKey{CsvName: "etcdoperator.v0.6.1", Version: "0.6.1"}, Nodes: map[BundleKey]map[BundleKey]struct{}{ - BundleKey{CsvName: "etcdoperator.v0.6.1", Version: "0.6.1"}: {}, + {CsvName: "etcdoperator.v0.6.1", Version: "0.6.1"}: {}, }}, }, }, @@ -189,11 +188,11 @@ func TestBundleGraphLoader(t *testing.T) { Channels: map[string]Channel{ "beta": {Head: BundleKey{CsvName: "etcdoperator.v0.6.1", Version: "0.6.1"}, Nodes: map[BundleKey]map[BundleKey]struct{}{ - BundleKey{CsvName: "etcdoperator.v0.6.1", Version: "0.6.1"}: {}, + {CsvName: "etcdoperator.v0.6.1", Version: "0.6.1"}: {}, }}, "alpha": {Head: BundleKey{CsvName: "etcdoperator.v0.9.3", Version: "0.9.3"}, Nodes: map[BundleKey]map[BundleKey]struct{}{ - BundleKey{CsvName: "etcdoperator.v0.9.3", Version: "0.9.3"}: nil, + {CsvName: "etcdoperator.v0.9.3", Version: "0.9.3"}: nil, }}, }, }, @@ -220,7 +219,7 @@ func TestBundleGraphLoader(t *testing.T) { Channels: map[string]Channel{ "alpha": {Head: BundleKey{CsvName: "etcdoperator.v0.9.3", Version: "0.9.3"}, Nodes: map[BundleKey]map[BundleKey]struct{}{ - BundleKey{CsvName: "etcdoperator.v0.9.3", Version: "0.9.3"}: nil, + {CsvName: "etcdoperator.v0.9.3", Version: "0.9.3"}: nil, }}, }, }, @@ -235,23 +234,23 @@ func TestBundleGraphLoader(t *testing.T) { Channels: map[string]Channel{ "alpha": {Head: BundleKey{CsvName: "etcdoperator.v0.9.2", Version: "0.9.2"}, Nodes: map[BundleKey]map[BundleKey]struct{}{ - BundleKey{CsvName: "etcdoperator.v0.6.1", Version: "0.6.1"}: {}, - BundleKey{CsvName: "etcdoperator.v0.9.0", Version: "0.9.0"}: {BundleKey{CsvName: "etcdoperator.v0.6.1", Version: "0.6.1"}: {}}, - BundleKey{CsvName: "etcdoperator.v0.9.2", Version: "0.9.2"}: {BundleKey{CsvName: "etcdoperator.v0.9.0", Version: "0.9.0"}: {}, + {CsvName: "etcdoperator.v0.6.1", Version: "0.6.1"}: {}, + {CsvName: "etcdoperator.v0.9.0", Version: "0.9.0"}: {BundleKey{CsvName: "etcdoperator.v0.6.1", Version: "0.6.1"}: {}}, + {CsvName: "etcdoperator.v0.9.2", Version: "0.9.2"}: {BundleKey{CsvName: "etcdoperator.v0.9.0", Version: "0.9.0"}: {}, BundleKey{CsvName: "etcdoperator.v0.9.1"}: {}}, }}, "beta": {Head: BundleKey{CsvName: "etcdoperator.v0.9.0", Version: "0.9.0"}, Nodes: map[BundleKey]map[BundleKey]struct{}{ - BundleKey{CsvName: "etcdoperator.v0.6.1", Version: "0.6.1"}: {}, - BundleKey{CsvName: "etcdoperator.v0.9.0", Version: "0.9.0"}: {BundleKey{CsvName: "etcdoperator.v0.6.1", Version: "0.6.1"}: {}}, + {CsvName: "etcdoperator.v0.6.1", Version: "0.6.1"}: {}, + {CsvName: "etcdoperator.v0.9.0", Version: "0.9.0"}: {BundleKey{CsvName: "etcdoperator.v0.6.1", Version: "0.6.1"}: {}}, }}, "stable": {Head: BundleKey{CsvName: "etcdoperator.v0.9.2", Version: "0.9.2"}, Nodes: map[BundleKey]map[BundleKey]struct{}{ - BundleKey{CsvName: "etcdoperator.v0.6.1", Version: "0.6.1"}: {}, - BundleKey{CsvName: "etcdoperator.v0.9.0", Version: "0.9.0"}: {BundleKey{CsvName: "etcdoperator.v0.6.1", Version: "0.6.1"}: {}}, - BundleKey{CsvName: "etcdoperator.v0.9.2", Version: "0.9.2"}: {BundleKey{CsvName: "etcdoperator.v0.9.0", Version: "0.9.0"}: {}, + {CsvName: "etcdoperator.v0.6.1", Version: "0.6.1"}: {}, + {CsvName: "etcdoperator.v0.9.0", Version: "0.9.0"}: {BundleKey{CsvName: "etcdoperator.v0.6.1", Version: "0.6.1"}: {}}, + {CsvName: "etcdoperator.v0.9.2", Version: "0.9.2"}: {BundleKey{CsvName: "etcdoperator.v0.9.0", Version: "0.9.0"}: {}, BundleKey{CsvName: "etcdoperator.v0.9.1"}: {}}, }}, }, @@ -274,22 +273,22 @@ func TestBundleGraphLoader(t *testing.T) { Channels: map[string]Channel{ "alpha": {Head: BundleKey{CsvName: "etcdoperator.v0.9.3", Version: "0.9.3"}, Nodes: map[BundleKey]map[BundleKey]struct{}{ - BundleKey{CsvName: "etcdoperator.v0.6.1", Version: "0.6.1"}: {}, - BundleKey{CsvName: "etcdoperator.v0.9.3", Version: "0.9.3"}: {BundleKey{CsvName: "etcdoperator.v0.9.2", Version: "0.9.2"}: {}, + {CsvName: "etcdoperator.v0.6.1", Version: "0.6.1"}: {}, + {CsvName: "etcdoperator.v0.9.3", Version: "0.9.3"}: {BundleKey{CsvName: "etcdoperator.v0.9.2", Version: "0.9.2"}: {}, BundleKey{CsvName: "etcdoperator.v0.9.0", Version: "0.9.0"}: {}, }, }}, "beta": {Head: BundleKey{CsvName: "etcdoperator.v0.9.0", Version: "0.9.0"}, Nodes: map[BundleKey]map[BundleKey]struct{}{ - BundleKey{CsvName: "etcdoperator.v0.6.1", Version: "0.6.1"}: {}, - BundleKey{CsvName: "etcdoperator.v0.9.0", Version: "0.9.0"}: {BundleKey{CsvName: "etcdoperator.v0.6.1", Version: "0.6.1"}: {}}, + {CsvName: "etcdoperator.v0.6.1", Version: "0.6.1"}: {}, + {CsvName: "etcdoperator.v0.9.0", Version: "0.9.0"}: {BundleKey{CsvName: "etcdoperator.v0.6.1", Version: "0.6.1"}: {}}, }}, "stable": {Head: BundleKey{CsvName: "etcdoperator.v0.9.3", Version: "0.9.3"}, Nodes: map[BundleKey]map[BundleKey]struct{}{ - BundleKey{CsvName: "etcdoperator.v0.6.1", Version: "0.6.1"}: {}, - BundleKey{CsvName: "etcdoperator.v0.9.3", Version: "0.9.3"}: {BundleKey{CsvName: "etcdoperator.v0.9.2", Version: "0.9.2"}: {}, + {CsvName: "etcdoperator.v0.6.1", Version: "0.6.1"}: {}, + {CsvName: "etcdoperator.v0.9.3", Version: "0.9.3"}: {BundleKey{CsvName: "etcdoperator.v0.9.2", Version: "0.9.2"}: {}, BundleKey{CsvName: "etcdoperator.v0.9.0", Version: "0.9.0"}: {}, }, }}, diff --git a/pkg/registry/channelupdateoptions.go b/pkg/registry/channelupdateoptions.go index 85f5acb40..d45bd414e 100644 --- a/pkg/registry/channelupdateoptions.go +++ b/pkg/registry/channelupdateoptions.go @@ -22,6 +22,7 @@ func GetModeFromString(mode string) (Mode, error) { case "semver-skippatch": return SkipPatchMode, nil default: + // nolint:stylecheck return -1, fmt.Errorf("Invalid channel update mode %s specified", mode) } } diff --git a/pkg/registry/csv.go b/pkg/registry/csv.go index 8dcdf65ad..4a3d8ceaf 100644 --- a/pkg/registry/csv.go +++ b/pkg/registry/csv.go @@ -7,19 +7,20 @@ import ( "os" "path" - prettyunmarshaler "github.com/operator-framework/operator-registry/pkg/prettyunmarshaler" - - v1 "k8s.io/api/apps/v1" + appsv1 "k8s.io/api/apps/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/yaml" "github.com/operator-framework/api/pkg/operators" + + prettyunmarshaler "github.com/operator-framework/operator-registry/pkg/prettyunmarshaler" ) const ( // Name of the CSV's kind + // nolint:unused clusterServiceVersionKind = "ClusterServiceVersion" // Name of the section under which the list of owned and required list of @@ -44,9 +45,11 @@ const ( icon = "icon" // The yaml attribute that points to the icon.base64data for the ClusterServiceVersion + // nolint:unused base64data = "base64data" // The yaml attribute that points to the icon.mediatype for the ClusterServiceVersion + // nolint:unused mediatype = "mediatype" // The yaml attribute that points to the description for the ClusterServiceVersion description = "description" @@ -131,7 +134,6 @@ func ReadCSVFromBundleDirectory(bundleDir string) (*ClusterServiceVersion, error return &csv, nil } return nil, fmt.Errorf("no ClusterServiceVersion object found in %s", bundleDir) - } // GetReplaces returns the name of the older ClusterServiceVersion object that @@ -224,16 +226,16 @@ func (csv *ClusterServiceVersion) GetSkips() ([]string, error) { // // If owned or required is not defined in the spec then an empty list is // returned respectively. -func (csv *ClusterServiceVersion) GetCustomResourceDefintions() (owned []*DefinitionKey, required []*DefinitionKey, err error) { +func (csv *ClusterServiceVersion) GetCustomResourceDefintions() ([]*DefinitionKey, []*DefinitionKey, error) { var objmap map[string]*json.RawMessage - if err = json.Unmarshal(csv.Spec, &objmap); err != nil { - return + if err := json.Unmarshal(csv.Spec, &objmap); err != nil { + return nil, nil, err } rawValue, ok := objmap[customResourceDefinitions] if !ok || rawValue == nil { - return + return nil, nil, nil } var definitions struct { @@ -241,13 +243,11 @@ func (csv *ClusterServiceVersion) GetCustomResourceDefintions() (owned []*Defini Required []*DefinitionKey `json:"required"` } - if err = json.Unmarshal(*rawValue, &definitions); err != nil { - return + if err := json.Unmarshal(*rawValue, &definitions); err != nil { + return nil, nil, err } - owned = definitions.Owned - required = definitions.Required - return + return definitions.Owned, definitions.Required, nil } // GetApiServiceDefinitions returns a list of owned and required @@ -261,16 +261,17 @@ func (csv *ClusterServiceVersion) GetCustomResourceDefintions() (owned []*Defini // // If owned or required is not defined in the spec then an empty list is // returned respectively. -func (csv *ClusterServiceVersion) GetApiServiceDefinitions() (owned []*DefinitionKey, required []*DefinitionKey, err error) { +// nolint:stylecheck +func (csv *ClusterServiceVersion) GetApiServiceDefinitions() ([]*DefinitionKey, []*DefinitionKey, error) { var objmap map[string]*json.RawMessage - if err = json.Unmarshal(csv.Spec, &objmap); err != nil { + if err := json.Unmarshal(csv.Spec, &objmap); err != nil { return nil, nil, fmt.Errorf("error unmarshaling into object map: %s", err) } rawValue, ok := objmap[apiServiceDefinitions] if !ok || rawValue == nil { - return + return nil, nil, nil } var definitions struct { @@ -278,27 +279,25 @@ func (csv *ClusterServiceVersion) GetApiServiceDefinitions() (owned []*Definitio Required []*DefinitionKey `json:"required"` } - if err = json.Unmarshal(*rawValue, &definitions); err != nil { - return + if err := json.Unmarshal(*rawValue, &definitions); err != nil { + return nil, nil, err } - owned = definitions.Owned - required = definitions.Required - return + return definitions.Owned, definitions.Required, nil } // GetRelatedImage returns the list of associated images for the operator -func (csv *ClusterServiceVersion) GetRelatedImages() (imageSet map[string]struct{}, err error) { +func (csv *ClusterServiceVersion) GetRelatedImages() (map[string]struct{}, error) { var objmap map[string]*json.RawMessage - imageSet = make(map[string]struct{}) + imageSet := make(map[string]struct{}) - if err = json.Unmarshal(csv.Spec, &objmap); err != nil { - return + if err := json.Unmarshal(csv.Spec, &objmap); err != nil { + return nil, err } rawValue, ok := objmap[relatedImages] if !ok || rawValue == nil { - return + return imageSet, nil } type relatedImage struct { @@ -306,15 +305,15 @@ func (csv *ClusterServiceVersion) GetRelatedImages() (imageSet map[string]struct Ref string `json:"image"` } var relatedImages []relatedImage - if err = json.Unmarshal(*rawValue, &relatedImages); err != nil { - return + if err := json.Unmarshal(*rawValue, &relatedImages); err != nil { + return nil, err } for _, img := range relatedImages { imageSet[img.Ref] = struct{}{} } - return + return imageSet, nil } // GetOperatorImages returns a list of any images used to run the operator. @@ -322,7 +321,7 @@ func (csv *ClusterServiceVersion) GetRelatedImages() (imageSet map[string]struct func (csv *ClusterServiceVersion) GetOperatorImages() (map[string]struct{}, error) { type dep struct { Name string - Spec v1.DeploymentSpec + Spec appsv1.DeploymentSpec } type strategySpec struct { Deployments []dep @@ -416,7 +415,6 @@ func (csv *ClusterServiceVersion) GetSubstitutesFor() string { } func (csv *ClusterServiceVersion) UnmarshalJSON(data []byte) error { - if err := csv.UnmarshalSpec(data); err != nil { return err } diff --git a/pkg/registry/csv_test.go b/pkg/registry/csv_test.go index caa7f18d7..8f23f0478 100644 --- a/pkg/registry/csv_test.go +++ b/pkg/registry/csv_test.go @@ -7,13 +7,13 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) func TestClusterServiceVersion_GetApiServiceDefinitions(t *testing.T) { type fields struct { - TypeMeta v1.TypeMeta - ObjectMeta v1.ObjectMeta + TypeMeta metav1.TypeMeta + ObjectMeta metav1.ObjectMeta Spec json.RawMessage } tests := []struct { @@ -26,8 +26,8 @@ func TestClusterServiceVersion_GetApiServiceDefinitions(t *testing.T) { { name: "v1alpha1 with owned, required", fields: fields{ - TypeMeta: v1.TypeMeta{}, - ObjectMeta: v1.ObjectMeta{}, + TypeMeta: metav1.TypeMeta{}, + ObjectMeta: metav1.ObjectMeta{}, Spec: json.RawMessage(` { "apiservicedefinitions": { @@ -60,8 +60,8 @@ func TestClusterServiceVersion_GetApiServiceDefinitions(t *testing.T) { { name: "v1alpha1 with owned", fields: fields{ - TypeMeta: v1.TypeMeta{}, - ObjectMeta: v1.ObjectMeta{}, + TypeMeta: metav1.TypeMeta{}, + ObjectMeta: metav1.ObjectMeta{}, Spec: json.RawMessage(` { "apiservicedefinitions": { @@ -83,8 +83,8 @@ func TestClusterServiceVersion_GetApiServiceDefinitions(t *testing.T) { { name: "v1alpha1 with required", fields: fields{ - TypeMeta: v1.TypeMeta{}, - ObjectMeta: v1.ObjectMeta{}, + TypeMeta: metav1.TypeMeta{}, + ObjectMeta: metav1.ObjectMeta{}, Spec: json.RawMessage(` { "apiservicedefinitions": { @@ -106,16 +106,16 @@ func TestClusterServiceVersion_GetApiServiceDefinitions(t *testing.T) { { name: "v1alpha1 missing owned,required", fields: fields{ - TypeMeta: v1.TypeMeta{}, - ObjectMeta: v1.ObjectMeta{}, + TypeMeta: metav1.TypeMeta{}, + ObjectMeta: metav1.ObjectMeta{}, Spec: json.RawMessage(`{"replaces": 5}`), }, }, { name: "v1alpha1 malformed owned,required", fields: fields{ - TypeMeta: v1.TypeMeta{}, - ObjectMeta: v1.ObjectMeta{}, + TypeMeta: metav1.TypeMeta{}, + ObjectMeta: metav1.ObjectMeta{}, Spec: json.RawMessage(` { "apiservicedefinitions": { @@ -151,8 +151,8 @@ func TestClusterServiceVersion_GetApiServiceDefinitions(t *testing.T) { func TestClusterServiceVersion_GetCustomResourceDefintions(t *testing.T) { type fields struct { - TypeMeta v1.TypeMeta - ObjectMeta v1.ObjectMeta + TypeMeta metav1.TypeMeta + ObjectMeta metav1.ObjectMeta Spec json.RawMessage } tests := []struct { @@ -165,8 +165,8 @@ func TestClusterServiceVersion_GetCustomResourceDefintions(t *testing.T) { { name: "v1alpha1 with owned, required", fields: fields{ - TypeMeta: v1.TypeMeta{}, - ObjectMeta: v1.ObjectMeta{}, + TypeMeta: metav1.TypeMeta{}, + ObjectMeta: metav1.ObjectMeta{}, Spec: json.RawMessage(` { "customresourcedefinitions": { @@ -199,8 +199,8 @@ func TestClusterServiceVersion_GetCustomResourceDefintions(t *testing.T) { { name: "v1alpha1 with owned", fields: fields{ - TypeMeta: v1.TypeMeta{}, - ObjectMeta: v1.ObjectMeta{}, + TypeMeta: metav1.TypeMeta{}, + ObjectMeta: metav1.ObjectMeta{}, Spec: json.RawMessage(` { "customresourcedefinitions": { @@ -222,8 +222,8 @@ func TestClusterServiceVersion_GetCustomResourceDefintions(t *testing.T) { { name: "v1alpha1 with required", fields: fields{ - TypeMeta: v1.TypeMeta{}, - ObjectMeta: v1.ObjectMeta{}, + TypeMeta: metav1.TypeMeta{}, + ObjectMeta: metav1.ObjectMeta{}, Spec: json.RawMessage(` { "customresourcedefinitions": { @@ -245,16 +245,16 @@ func TestClusterServiceVersion_GetCustomResourceDefintions(t *testing.T) { { name: "v1alpha1 missing owned,required", fields: fields{ - TypeMeta: v1.TypeMeta{}, - ObjectMeta: v1.ObjectMeta{}, + TypeMeta: metav1.TypeMeta{}, + ObjectMeta: metav1.ObjectMeta{}, Spec: json.RawMessage(`{"replaces": 5}`), }, }, { name: "v1alpha1 malformed owned,required", fields: fields{ - TypeMeta: v1.TypeMeta{}, - ObjectMeta: v1.ObjectMeta{}, + TypeMeta: metav1.TypeMeta{}, + ObjectMeta: metav1.ObjectMeta{}, Spec: json.RawMessage(` { "customresourcedefinitions": { @@ -291,8 +291,8 @@ func TestClusterServiceVersion_GetCustomResourceDefintions(t *testing.T) { func TestClusterServiceVersion_GetReplaces(t *testing.T) { type fields struct { - TypeMeta v1.TypeMeta - ObjectMeta v1.ObjectMeta + TypeMeta metav1.TypeMeta + ObjectMeta metav1.ObjectMeta Spec json.RawMessage } tests := []struct { @@ -304,8 +304,8 @@ func TestClusterServiceVersion_GetReplaces(t *testing.T) { { name: "v1alpha1 with replaces", fields: fields{ - TypeMeta: v1.TypeMeta{}, - ObjectMeta: v1.ObjectMeta{}, + TypeMeta: metav1.TypeMeta{}, + ObjectMeta: metav1.ObjectMeta{}, Spec: json.RawMessage(`{"replaces": "etcd-operator.v0.9.2"}`), }, want: "etcd-operator.v0.9.2", @@ -313,8 +313,8 @@ func TestClusterServiceVersion_GetReplaces(t *testing.T) { { name: "v1alpha1 no replaces", fields: fields{ - TypeMeta: v1.TypeMeta{}, - ObjectMeta: v1.ObjectMeta{}, + TypeMeta: metav1.TypeMeta{}, + ObjectMeta: metav1.ObjectMeta{}, Spec: json.RawMessage(`{"other": "field"}`), }, want: "", @@ -322,8 +322,8 @@ func TestClusterServiceVersion_GetReplaces(t *testing.T) { { name: "v1alpha1 malformed replaces", fields: fields{ - TypeMeta: v1.TypeMeta{}, - ObjectMeta: v1.ObjectMeta{}, + TypeMeta: metav1.TypeMeta{}, + ObjectMeta: metav1.ObjectMeta{}, Spec: json.RawMessage(`{"replaces": 5}`), }, wantErr: true, @@ -350,8 +350,8 @@ func TestClusterServiceVersion_GetReplaces(t *testing.T) { func TestClusterServiceVersion_GetSkips(t *testing.T) { type fields struct { - TypeMeta v1.TypeMeta - ObjectMeta v1.ObjectMeta + TypeMeta metav1.TypeMeta + ObjectMeta metav1.ObjectMeta Spec json.RawMessage } tests := []struct { @@ -363,8 +363,8 @@ func TestClusterServiceVersion_GetSkips(t *testing.T) { { name: "v1alpha1 with skips", fields: fields{ - TypeMeta: v1.TypeMeta{}, - ObjectMeta: v1.ObjectMeta{}, + TypeMeta: metav1.TypeMeta{}, + ObjectMeta: metav1.ObjectMeta{}, Spec: json.RawMessage(`{"skips": ["1.0.5", "1.0.4"]}`), }, want: []string{"1.0.5", "1.0.4"}, @@ -372,8 +372,8 @@ func TestClusterServiceVersion_GetSkips(t *testing.T) { { name: "v1alpha1 no skips", fields: fields{ - TypeMeta: v1.TypeMeta{}, - ObjectMeta: v1.ObjectMeta{}, + TypeMeta: metav1.TypeMeta{}, + ObjectMeta: metav1.ObjectMeta{}, Spec: json.RawMessage(`{"other": "field"}`), }, want: nil, @@ -381,8 +381,8 @@ func TestClusterServiceVersion_GetSkips(t *testing.T) { { name: "v1alpha1 malformed skips", fields: fields{ - TypeMeta: v1.TypeMeta{}, - ObjectMeta: v1.ObjectMeta{}, + TypeMeta: metav1.TypeMeta{}, + ObjectMeta: metav1.ObjectMeta{}, Spec: json.RawMessage(`{"skips": 5}`), }, wantErr: true, @@ -408,8 +408,8 @@ func TestClusterServiceVersion_GetSkips(t *testing.T) { func TestClusterServiceVersion_GetVersion(t *testing.T) { type fields struct { - TypeMeta v1.TypeMeta - ObjectMeta v1.ObjectMeta + TypeMeta metav1.TypeMeta + ObjectMeta metav1.ObjectMeta Spec json.RawMessage } tests := []struct { @@ -421,8 +421,8 @@ func TestClusterServiceVersion_GetVersion(t *testing.T) { { name: "v1alpha1 with version", fields: fields{ - TypeMeta: v1.TypeMeta{}, - ObjectMeta: v1.ObjectMeta{}, + TypeMeta: metav1.TypeMeta{}, + ObjectMeta: metav1.ObjectMeta{}, Spec: json.RawMessage(`{"version": "1.0.5"}`), }, want: "1.0.5", @@ -430,8 +430,8 @@ func TestClusterServiceVersion_GetVersion(t *testing.T) { { name: "v1alpha1 no version", fields: fields{ - TypeMeta: v1.TypeMeta{}, - ObjectMeta: v1.ObjectMeta{}, + TypeMeta: metav1.TypeMeta{}, + ObjectMeta: metav1.ObjectMeta{}, Spec: json.RawMessage(`{"other": "field"}`), }, want: "", @@ -439,8 +439,8 @@ func TestClusterServiceVersion_GetVersion(t *testing.T) { { name: "v1alpha1 malformed version", fields: fields{ - TypeMeta: v1.TypeMeta{}, - ObjectMeta: v1.ObjectMeta{}, + TypeMeta: metav1.TypeMeta{}, + ObjectMeta: metav1.ObjectMeta{}, Spec: json.RawMessage(`{"version": 5}`), }, wantErr: true, @@ -467,8 +467,8 @@ func TestClusterServiceVersion_GetVersion(t *testing.T) { func TestClusterServiceVersion_GetRelatedImages(t *testing.T) { type fields struct { - TypeMeta v1.TypeMeta - ObjectMeta v1.ObjectMeta + TypeMeta metav1.TypeMeta + ObjectMeta metav1.ObjectMeta Spec json.RawMessage } tests := []struct { @@ -480,8 +480,8 @@ func TestClusterServiceVersion_GetRelatedImages(t *testing.T) { { name: "no related images", fields: fields{ - TypeMeta: v1.TypeMeta{}, - ObjectMeta: v1.ObjectMeta{}, + TypeMeta: metav1.TypeMeta{}, + ObjectMeta: metav1.ObjectMeta{}, Spec: json.RawMessage(`{"no": "field"}`), }, want: map[string]struct{}{}, @@ -489,8 +489,8 @@ func TestClusterServiceVersion_GetRelatedImages(t *testing.T) { { name: "one related image", fields: fields{ - TypeMeta: v1.TypeMeta{}, - ObjectMeta: v1.ObjectMeta{}, + TypeMeta: metav1.TypeMeta{}, + ObjectMeta: metav1.ObjectMeta{}, Spec: json.RawMessage(`{"relatedImages": [ {"name": "test", "image": "quay.io/etcd/etcd-operator@sha256:123"} ]}`), @@ -500,8 +500,8 @@ func TestClusterServiceVersion_GetRelatedImages(t *testing.T) { { name: "multiple related images", fields: fields{ - TypeMeta: v1.TypeMeta{}, - ObjectMeta: v1.ObjectMeta{}, + TypeMeta: metav1.TypeMeta{}, + ObjectMeta: metav1.ObjectMeta{}, Spec: json.RawMessage(`{"relatedImages": [ {"name": "test", "image": "quay.io/etcd/etcd-operator@sha256:123"}, {"name": "operand", "image": "quay.io/etcd/etcd@sha256:123"} @@ -529,8 +529,8 @@ func TestClusterServiceVersion_GetRelatedImages(t *testing.T) { func TestClusterServiceVersion_GetOperatorImages(t *testing.T) { type fields struct { - TypeMeta v1.TypeMeta - ObjectMeta v1.ObjectMeta + TypeMeta metav1.TypeMeta + ObjectMeta metav1.ObjectMeta Spec json.RawMessage } tests := []struct { @@ -542,8 +542,8 @@ func TestClusterServiceVersion_GetOperatorImages(t *testing.T) { { name: "bad strategy", fields: fields{ - TypeMeta: v1.TypeMeta{}, - ObjectMeta: v1.ObjectMeta{}, + TypeMeta: metav1.TypeMeta{}, + ObjectMeta: metav1.ObjectMeta{}, Spec: json.RawMessage(` {"install": {"strategy": "nope", "spec": {"deployments":[{"name":"etcd-operator","spec":{"template":{"spec":{"containers":[{ "command":["etcd-operator"], @@ -555,8 +555,8 @@ func TestClusterServiceVersion_GetOperatorImages(t *testing.T) { { name: "no images", fields: fields{ - TypeMeta: v1.TypeMeta{}, - ObjectMeta: v1.ObjectMeta{}, + TypeMeta: metav1.TypeMeta{}, + ObjectMeta: metav1.ObjectMeta{}, Spec: json.RawMessage(` {"install": {"strategy": "deployment","spec": {"deployments":[{"name":"etcd-operator","spec":{"template":{"spec": "containers":[] @@ -568,8 +568,8 @@ func TestClusterServiceVersion_GetOperatorImages(t *testing.T) { { name: "one image", fields: fields{ - TypeMeta: v1.TypeMeta{}, - ObjectMeta: v1.ObjectMeta{}, + TypeMeta: metav1.TypeMeta{}, + ObjectMeta: metav1.ObjectMeta{}, Spec: json.RawMessage(` {"install": {"strategy": "deployment", "spec": {"deployments":[{ "name":"etcd-operator", @@ -592,8 +592,8 @@ func TestClusterServiceVersion_GetOperatorImages(t *testing.T) { { name: "two container images", fields: fields{ - TypeMeta: v1.TypeMeta{}, - ObjectMeta: v1.ObjectMeta{}, + TypeMeta: metav1.TypeMeta{}, + ObjectMeta: metav1.ObjectMeta{}, Spec: json.RawMessage(` {"install": {"strategy": "deployment", "spec": {"deployments":[{ "name":"etcd-operator", @@ -621,8 +621,8 @@ func TestClusterServiceVersion_GetOperatorImages(t *testing.T) { { name: "init container image", fields: fields{ - TypeMeta: v1.TypeMeta{}, - ObjectMeta: v1.ObjectMeta{}, + TypeMeta: metav1.TypeMeta{}, + ObjectMeta: metav1.ObjectMeta{}, Spec: json.RawMessage(` { "install": { @@ -655,8 +655,8 @@ func TestClusterServiceVersion_GetOperatorImages(t *testing.T) { { name: "two init container images", fields: fields{ - TypeMeta: v1.TypeMeta{}, - ObjectMeta: v1.ObjectMeta{}, + TypeMeta: metav1.TypeMeta{}, + ObjectMeta: metav1.ObjectMeta{}, Spec: json.RawMessage(` { "install": { @@ -694,8 +694,8 @@ func TestClusterServiceVersion_GetOperatorImages(t *testing.T) { { name: "container and init container", fields: fields{ - TypeMeta: v1.TypeMeta{}, - ObjectMeta: v1.ObjectMeta{}, + TypeMeta: metav1.TypeMeta{}, + ObjectMeta: metav1.ObjectMeta{}, Spec: json.RawMessage(` { "install": { @@ -740,7 +740,7 @@ func TestClusterServiceVersion_GetOperatorImages(t *testing.T) { } }`), }, - want: map[string]struct{}{"quay.io/coreos/etcd-operator2@sha256:c0301e4686c3ed4206e370b42de5a3bd2229b9fb4906cf85f3f30650424abec2": {}, "quay.io/coreos/etcd-operator@sha256:c0301e4686c3ed4206e370b42de5a3bd2229b9fb4906cf85f3f30650424abec2": struct{}{}, "quay.io/coreos/init-etcd-operator2@sha256:c0301e4686c3ed4206e370b42de5a3bd2229b9fb4906cf85f3f30650424abec2": {}, "quay.io/coreos/init-etcd-operator@sha256:c0301e4686c3ed4206e370b42de5a3bd2229b9fb4906cf85f3f30650424abec2": {}}, + want: map[string]struct{}{"quay.io/coreos/etcd-operator2@sha256:c0301e4686c3ed4206e370b42de5a3bd2229b9fb4906cf85f3f30650424abec2": {}, "quay.io/coreos/etcd-operator@sha256:c0301e4686c3ed4206e370b42de5a3bd2229b9fb4906cf85f3f30650424abec2": {}, "quay.io/coreos/init-etcd-operator2@sha256:c0301e4686c3ed4206e370b42de5a3bd2229b9fb4906cf85f3f30650424abec2": {}, "quay.io/coreos/init-etcd-operator@sha256:c0301e4686c3ed4206e370b42de5a3bd2229b9fb4906cf85f3f30650424abec2": {}}, }, } for _, tt := range tests { @@ -820,17 +820,17 @@ func TestLoadingCsvFromBundleDirectory(t *testing.T) { assert.EqualValues(t, tt.name, csv.GetName()) csvVersion, err := csv.GetVersion() - assert.NoError(t, err) + require.NoError(t, err) assert.EqualValues(t, tt.version, csvVersion) assert.EqualValues(t, tt.skipRange, csv.GetSkipRange()) csvReplace, err := csv.GetReplaces() - assert.NoError(t, err) + require.NoError(t, err) assert.EqualValues(t, tt.replace, csvReplace) csvSkips, err := csv.GetSkips() - assert.NoError(t, err) + require.NoError(t, err) assert.EqualValues(t, tt.skips, csvSkips) }) } diff --git a/pkg/registry/decode.go b/pkg/registry/decode.go index 0a9587d09..1818cc305 100644 --- a/pkg/registry/decode.go +++ b/pkg/registry/decode.go @@ -13,36 +13,34 @@ import ( // DecodeUnstructured decodes a raw stream into a an // unstructured.Unstructured instance. -func DecodeUnstructured(reader io.Reader) (obj *unstructured.Unstructured, err error) { +func DecodeUnstructured(reader io.Reader) (*unstructured.Unstructured, error) { decoder := yaml.NewYAMLOrJSONDecoder(reader, 30) t := &unstructured.Unstructured{} - if err = decoder.Decode(t); err != nil { - return + if err := decoder.Decode(t); err != nil { + return nil, err } - obj = t - return + return t, nil } // DecodePackageManifest decodes a raw stream into a a PackageManifest instance. // If a package name is empty we consider the object invalid! -func DecodePackageManifest(reader io.Reader) (manifest *PackageManifest, err error) { +func DecodePackageManifest(reader io.Reader) (*PackageManifest, error) { decoder := yaml.NewYAMLOrJSONDecoder(reader, 30) obj := &PackageManifest{} if decodeErr := decoder.Decode(obj); decodeErr != nil { - err = fmt.Errorf("could not decode contents into package manifest - %v", decodeErr) - return + err := fmt.Errorf("could not decode contents into package manifest - %v", decodeErr) + return nil, err } if obj.PackageName == "" { - err = errors.New("name of package (packageName) is missing") - return + err := errors.New("name of package (packageName) is missing") + return nil, err } - manifest = obj - return + return obj, nil } func decodeFileFS(root fs.FS, path string, into interface{}, log *logrus.Entry) error { diff --git a/pkg/registry/decode_test.go b/pkg/registry/decode_test.go index 02b26de5a..7dc7c6698 100644 --- a/pkg/registry/decode_test.go +++ b/pkg/registry/decode_test.go @@ -23,7 +23,7 @@ func TestDecodeUnstructured(t *testing.T) { name: "ValidObjectWithKind", file: "testdata/valid-unstructured.yaml", assertFunc: func(t *testing.T, objGot *unstructured.Unstructured, errGot error) { - assert.NoError(t, errGot) + require.NoError(t, errGot) assert.NotNil(t, objGot) assert.Equal(t, "FooKind", objGot.GetKind()) @@ -34,7 +34,7 @@ func TestDecodeUnstructured(t *testing.T) { name: "InvalidObjectWithoutKind", file: "testdata/invalid-unstructured.yaml", assertFunc: func(t *testing.T, objGot *unstructured.Unstructured, errGot error) { - assert.Error(t, errGot) + require.Error(t, errGot) assert.Nil(t, objGot) }, }, @@ -63,7 +63,7 @@ func TestDecodePackageManifest(t *testing.T) { name: "WithValidObject", file: "testdata/valid-package-manifest.yaml", assertFunc: func(t *testing.T, packageManifestGot *PackageManifest, errGot error) { - assert.NoError(t, errGot) + require.NoError(t, errGot) assert.NotNil(t, packageManifestGot) assert.Equal(t, "foo", packageManifestGot.PackageName) @@ -74,7 +74,7 @@ func TestDecodePackageManifest(t *testing.T) { name: "WithoutPackageName", file: "testdata/invalid-package-manifest.yaml", assertFunc: func(t *testing.T, packageManifestGot *PackageManifest, errGot error) { - assert.Error(t, errGot) + require.Error(t, errGot) assert.Nil(t, packageManifestGot) }, }, @@ -109,21 +109,21 @@ func TestDecodeFileFS(t *testing.T) { var nilPtr *foo require.NoError(t, decodeFileFS(root, "foo.yaml", nilPtr, entry)) require.Nil(t, nilPtr) - require.Equal(t, 0, len(logHook.Entries)) + require.Empty(t, logHook.Entries) logHook.Reset() ptr := &foo{} require.NoError(t, decodeFileFS(root, "foo.yaml", ptr, entry)) require.NotNil(t, ptr) require.Equal(t, "baz", ptr.Bar) - require.Equal(t, 0, len(logHook.Entries)) + require.Empty(t, logHook.Entries) logHook.Reset() ptr = &foo{} require.NoError(t, decodeFileFS(root, "multi.yaml", ptr, entry)) require.NotNil(t, ptr) require.Equal(t, "baz", ptr.Bar) - require.Equal(t, 1, len(logHook.Entries)) + require.Len(t, logHook.Entries, 1) require.Equal(t, logrus.WarnLevel, logHook.LastEntry().Level) require.Equal(t, "found more than one document inside multi.yaml, using only the first one", logHook.LastEntry().Message) logHook.Reset() diff --git a/pkg/registry/directoryGraphLoader.go b/pkg/registry/directoryGraphLoader.go index a899f01e0..4b7209188 100644 --- a/pkg/registry/directoryGraphLoader.go +++ b/pkg/registry/directoryGraphLoader.go @@ -51,7 +51,7 @@ func NewPackageGraphLoaderFromDir(packageDir string) (*DirGraphLoader, error) { func (g *DirGraphLoader) Generate() (*Package, error) { err := g.loadBundleCsvPathMap() if err != nil { - return nil, fmt.Errorf("error geting CSVs from bundles in the package directory, %v", err) + return nil, fmt.Errorf("error getting CSVs from bundles in the package directory, %v", err) } pkg, err := g.parsePackageYAMLFile() @@ -76,6 +76,7 @@ func (g *DirGraphLoader) loadBundleCsvPathMap() error { } CsvNameAndReplaceMap := make(map[string]csvReplaces) for _, bundlePath := range bundleDirs { + //nolint:nestif if bundlePath.IsDir() { csvStruct, err := ReadCSVFromBundleDirectory(filepath.Join(g.PackageDir, bundlePath.Name())) if err != nil { @@ -131,7 +132,7 @@ func (g *DirGraphLoader) getChannelNodes(channelHeadCsv string) *map[BundleKey]m // Iterate through remainingCSVsInChannel and add replaces of each encountered CSVs if not already in nodes. // Loop only exit after all remaining csvs are visited/deleted. for len(remainingCSVsInChannel) > 0 { - for bk, _ := range remainingCSVsInChannel { + for bk := range remainingCSVsInChannel { if _, ok := nodes[BundleKey{CsvName: bk.CsvName}]; !ok { nodes[BundleKey{CsvName: bk.CsvName}] = func() map[BundleKey]struct{} { subNode := make(map[BundleKey]struct{}) @@ -203,5 +204,4 @@ func convertFromPackageManifest(pkgManifest PackageManifest) *Package { DefaultChannel: pkgManifest.GetDefaultChannel(), Channels: pkgChannels, } - } diff --git a/pkg/registry/directoryGraphLoader_test.go b/pkg/registry/directoryGraphLoader_test.go index 7d88e3e8e..3658b8041 100644 --- a/pkg/registry/directoryGraphLoader_test.go +++ b/pkg/registry/directoryGraphLoader_test.go @@ -23,25 +23,25 @@ func TestPackageGraphLoader(t *testing.T) { channel: map[string]Channel{ "alpha": {Head: BundleKey{CsvName: "etcdoperator.v0.9.2"}, Nodes: map[BundleKey]map[BundleKey]struct{}{ - BundleKey{CsvName: "etcdoperator.v0.6.1"}: {}, - BundleKey{CsvName: "etcdoperator.v0.9.0"}: {BundleKey{CsvName: "etcdoperator.v0.6.1"}: {}}, - BundleKey{CsvName: "etcdoperator.v0.9.1"}: {}, - BundleKey{CsvName: "etcdoperator.v0.9.2"}: {BundleKey{CsvName: "etcdoperator.v0.9.0"}: {}, + {CsvName: "etcdoperator.v0.6.1"}: {}, + {CsvName: "etcdoperator.v0.9.0"}: {BundleKey{CsvName: "etcdoperator.v0.6.1"}: {}}, + {CsvName: "etcdoperator.v0.9.1"}: {}, + {CsvName: "etcdoperator.v0.9.2"}: {BundleKey{CsvName: "etcdoperator.v0.9.0"}: {}, BundleKey{CsvName: "etcdoperator.v0.9.1"}: {}}, }}, "beta": {Head: BundleKey{CsvName: "etcdoperator.v0.9.0"}, Nodes: map[BundleKey]map[BundleKey]struct{}{ - BundleKey{CsvName: "etcdoperator.v0.6.1"}: {}, - BundleKey{CsvName: "etcdoperator.v0.9.0"}: {BundleKey{CsvName: "etcdoperator.v0.6.1"}: {}}, + {CsvName: "etcdoperator.v0.6.1"}: {}, + {CsvName: "etcdoperator.v0.9.0"}: {BundleKey{CsvName: "etcdoperator.v0.6.1"}: {}}, }}, "stable": {Head: BundleKey{CsvName: "etcdoperator.v0.9.2"}, Nodes: map[BundleKey]map[BundleKey]struct{}{ - BundleKey{CsvName: "etcdoperator.v0.6.1"}: {}, - BundleKey{CsvName: "etcdoperator.v0.9.0"}: {BundleKey{CsvName: "etcdoperator.v0.6.1"}: {}}, - BundleKey{CsvName: "etcdoperator.v0.9.1"}: {}, - BundleKey{CsvName: "etcdoperator.v0.9.2"}: {BundleKey{CsvName: "etcdoperator.v0.9.0"}: {}, + {CsvName: "etcdoperator.v0.6.1"}: {}, + {CsvName: "etcdoperator.v0.9.0"}: {BundleKey{CsvName: "etcdoperator.v0.6.1"}: {}}, + {CsvName: "etcdoperator.v0.9.1"}: {}, + {CsvName: "etcdoperator.v0.9.2"}: {BundleKey{CsvName: "etcdoperator.v0.9.0"}: {}, BundleKey{CsvName: "etcdoperator.v0.9.1"}: {}}, }}, }, @@ -54,9 +54,9 @@ func TestPackageGraphLoader(t *testing.T) { channel: map[string]Channel{ "preview": {Head: BundleKey{CsvName: "prometheusoperator.0.22.2"}, Nodes: map[BundleKey]map[BundleKey]struct{}{ - BundleKey{CsvName: "prometheusoperator.0.14.0"}: {}, - BundleKey{CsvName: "prometheusoperator.0.15.0"}: {BundleKey{CsvName: "prometheusoperator.0.14.0"}: {}}, - BundleKey{CsvName: "prometheusoperator.0.22.2"}: {BundleKey{CsvName: "prometheusoperator.0.15.0"}: {}}, + {CsvName: "prometheusoperator.0.14.0"}: {}, + {CsvName: "prometheusoperator.0.15.0"}: {BundleKey{CsvName: "prometheusoperator.0.14.0"}: {}}, + {CsvName: "prometheusoperator.0.22.2"}: {BundleKey{CsvName: "prometheusoperator.0.15.0"}: {}}, }}}, }, { @@ -71,15 +71,15 @@ func TestPackageGraphLoader(t *testing.T) { channel: map[string]Channel{ "stable": {Head: BundleKey{CsvName: "aqua-operator.v1.0.0"}, Nodes: map[BundleKey]map[BundleKey]struct{}{ - BundleKey{CsvName: "aqua-operator.v1.0.0"}: {}, + {CsvName: "aqua-operator.v1.0.0"}: {}, }}, "alpha": {Head: BundleKey{CsvName: "aqua-operator.v1.0.0"}, Nodes: map[BundleKey]map[BundleKey]struct{}{ - BundleKey{CsvName: "aqua-operator.v1.0.0"}: {}, + {CsvName: "aqua-operator.v1.0.0"}: {}, }}, "beta": {Head: BundleKey{CsvName: "aqua-operator.v0.0.1"}, Nodes: map[BundleKey]map[BundleKey]struct{}{ - BundleKey{CsvName: "aqua-operator.v0.0.1"}: {}, + {CsvName: "aqua-operator.v0.0.1"}: {}, }}, }, }, diff --git a/pkg/registry/empty.go b/pkg/registry/empty.go index 936f39cca..dc34f06dc 100644 --- a/pkg/registry/empty.go +++ b/pkg/registry/empty.go @@ -40,7 +40,7 @@ func (EmptyQuery) GetBundleForChannel(ctx context.Context, pkgName string, chann return nil, errors.New("empty querier: cannot get bundle for channel") } -func (EmptyQuery) GetChannelEntriesThatReplace(ctx context.Context, name string) (entries []*ChannelEntry, err error) { +func (EmptyQuery) GetChannelEntriesThatReplace(ctx context.Context, name string) ([]*ChannelEntry, error) { return nil, errors.New("empty querier: cannot get channel entries that replace") } @@ -48,11 +48,11 @@ func (EmptyQuery) GetBundleThatReplaces(ctx context.Context, name, pkgName, chan return nil, errors.New("empty querier: cannot get bundle that replaces") } -func (EmptyQuery) GetChannelEntriesThatProvide(ctx context.Context, group, version, kind string) (entries []*ChannelEntry, err error) { +func (EmptyQuery) GetChannelEntriesThatProvide(ctx context.Context, group, version, kind string) ([]*ChannelEntry, error) { return nil, errors.New("empty querier: cannot get channel entries that provide") } -func (EmptyQuery) GetLatestChannelEntriesThatProvide(ctx context.Context, group, version, kind string) (entries []*ChannelEntry, err error) { +func (EmptyQuery) GetLatestChannelEntriesThatProvide(ctx context.Context, group, version, kind string) ([]*ChannelEntry, error) { return nil, errors.New("empty querier: cannot get latest channel entries that provide") } @@ -68,7 +68,8 @@ func (EmptyQuery) GetImagesForBundle(ctx context.Context, bundleName string) ([] return nil, errors.New("empty querier: cannot get image list") } -func (EmptyQuery) GetApisForEntry(ctx context.Context, entryId int64) (provided []*api.GroupVersionKind, required []*api.GroupVersionKind, err error) { +// nolint:stylecheck +func (EmptyQuery) GetApisForEntry(ctx context.Context, entryId int64) ([]*api.GroupVersionKind, []*api.GroupVersionKind, error) { return nil, nil, errors.New("empty querier: cannot apis") } @@ -104,11 +105,11 @@ func (EmptyQuery) SendBundles(ctx context.Context, stream BundleSender) error { return errors.New("empty querier: cannot stream bundles") } -func (EmptyQuery) GetDependenciesForBundle(ctx context.Context, name, version, path string) (dependencies []*api.Dependency, err error) { +func (EmptyQuery) GetDependenciesForBundle(ctx context.Context, name, version, path string) ([]*api.Dependency, error) { return nil, errors.New("empty querier: cannot get dependencies for bundle") } -func (EmptyQuery) GetBundlePathIfExists(ctx context.Context, csvName string) (bundlePath string, err error) { +func (EmptyQuery) GetBundlePathIfExists(ctx context.Context, csvName string) (string, error) { return "", errors.New("empty querier: cannot get bundle path for bundle") } diff --git a/pkg/registry/graph.go b/pkg/registry/graph.go index 32185f189..d2623f2a6 100644 --- a/pkg/registry/graph.go +++ b/pkg/registry/graph.go @@ -35,7 +35,7 @@ type Channel struct { func (c *Channel) String() string { var b strings.Builder - for node, _ := range c.Nodes { + for node := range c.Nodes { b.WriteString(node.String()) b.WriteString("\n") } diff --git a/pkg/registry/helper_test.go b/pkg/registry/helper_test.go index 9121fa450..f0a2a8b18 100644 --- a/pkg/registry/helper_test.go +++ b/pkg/registry/helper_test.go @@ -18,13 +18,13 @@ func TestBundleVersionCompare(t *testing.T) { type order func(t *testing.T, val int) var ( lt order = func(t *testing.T, val int) { - require.Less(t, val, 0) + require.Negative(t, val) } gt order = func(t *testing.T, val int) { - require.Greater(t, val, 0) + require.Positive(t, val) } eq order = func(t *testing.T, val int) { - require.Equal(t, val, 0) + require.Equal(t, 0, val) } ) type expect struct { diff --git a/pkg/registry/imageinput.go b/pkg/registry/imageinput.go index 69fe210ef..ed287e687 100644 --- a/pkg/registry/imageinput.go +++ b/pkg/registry/imageinput.go @@ -4,8 +4,9 @@ import ( "os" "path/filepath" - "github.com/operator-framework/operator-registry/pkg/image" "github.com/sirupsen/logrus" + + "github.com/operator-framework/operator-registry/pkg/image" ) type ImageInput struct { diff --git a/pkg/registry/parse.go b/pkg/registry/parse.go index 4b13ef767..24445ffe0 100644 --- a/pkg/registry/parse.go +++ b/pkg/registry/parse.go @@ -6,9 +6,10 @@ import ( "io/fs" "strings" - operatorsv1alpha1 "github.com/operator-framework/api/pkg/operators/v1alpha1" "github.com/sirupsen/logrus" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + + operatorsv1alpha1 "github.com/operator-framework/api/pkg/operators/v1alpha1" ) type bundleParser struct { @@ -156,6 +157,7 @@ func (b *bundleParser) addMetadata(metadata fs.FS, bundle *Bundle) error { bundle.Package = af.Annotations.PackageName bundle.Channels = af.GetChannels() } else { + // nolint:stylecheck return fmt.Errorf("Could not find annotations file") } @@ -184,6 +186,7 @@ func (b *bundleParser) derivedProperties(bundle *Bundle) ([]Property, error) { return nil, fmt.Errorf("bundle missing csv") } + // nolint:prealloc var derived []Property if len(csv.GetAnnotations()) > 0 { properties, ok := csv.GetAnnotations()[PropertyKey] @@ -235,6 +238,7 @@ func (b *bundleParser) derivedProperties(bundle *Bundle) ([]Property, error) { // propertySet returns the deduplicated set of a property list. func propertySet(properties []Property) []Property { + // nolint:prealloc var ( set []Property visited = map[string]struct{}{} diff --git a/pkg/registry/parse_test.go b/pkg/registry/parse_test.go index fa7cccb2e..a912a9e41 100644 --- a/pkg/registry/parse_test.go +++ b/pkg/registry/parse_test.go @@ -394,7 +394,6 @@ properties: assert.Equal(t, tt.bundle.Annotations, bundle.Annotations) }) } - } func TestDerivedProperties(t *testing.T) { @@ -564,16 +563,15 @@ func TestDerivedProperties(t *testing.T) { properties, err := parser.derivedProperties(in) if tt.expected.err { - assert.Error(t, err) + require.Error(t, err) assert.Nil(t, properties) return } - assert.NoError(t, err) + require.NoError(t, err) assert.ElementsMatch(t, tt.expected.properties, properties) }) } - } func TestPropertySet(t *testing.T) { diff --git a/pkg/registry/populator.go b/pkg/registry/populator.go index 730d27fb9..ea86a163e 100644 --- a/pkg/registry/populator.go +++ b/pkg/registry/populator.go @@ -151,6 +151,7 @@ func (i *DirectoryPopulator) loadManifests(imagesToAdd []*ImageInput, mode Mode) // globalSanityCheck should have verified this to be a head without anything replacing it // and that we have a single overwrite per package + // nolint:nestif if len(i.overwrittenImages) > 0 { if overwriter, ok := i.loader.(HeadOverwriter); ok { // Assume loader has some way to handle overwritten heads if HeadOverwriter isn't implemented explicitly @@ -180,6 +181,7 @@ func (i *DirectoryPopulator) loadManifests(imagesToAdd []*ImageInput, mode Mode) } } default: + // nolint:stylecheck return fmt.Errorf("Unsupported update mode") } @@ -195,6 +197,7 @@ var packageContextKey = "package" // ContextWithPackage adds a package value to a context. func ContextWithPackage(ctx context.Context, pkg string) context.Context { + // nolint:staticcheck return context.WithValue(ctx, packageContextKey, pkg) } @@ -262,6 +265,7 @@ func (i *DirectoryPopulator) loadManifestsSemver(bundle *Bundle, skippatch bool) } // loadOperatorBundle adds the package information to the loader's store +// nolint:unused func (i *DirectoryPopulator) loadOperatorBundle(manifest PackageManifest, bundle *Bundle) error { if manifest.PackageName == "" { return nil diff --git a/pkg/registry/populator_test.go b/pkg/registry/populator_test.go index 561d4437e..561e718fb 100644 --- a/pkg/registry/populator_test.go +++ b/pkg/registry/populator_test.go @@ -2,28 +2,30 @@ package registry_test import ( "context" + "crypto/rand" "database/sql" "encoding/json" + "errors" "fmt" - "math/rand" + "math" + "math/big" "os" "path/filepath" "reflect" "strings" "testing" - "time" "github.com/blang/semver/v4" "github.com/sirupsen/logrus" "github.com/stretchr/testify/require" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "k8s.io/apimachinery/pkg/util/errors" utilerrors "k8s.io/apimachinery/pkg/util/errors" "sigs.k8s.io/yaml" "github.com/operator-framework/api/pkg/lib/version" "github.com/operator-framework/api/pkg/operators/v1alpha1" + "github.com/operator-framework/operator-registry/pkg/api" "github.com/operator-framework/operator-registry/pkg/image" "github.com/operator-framework/operator-registry/pkg/lib/bundle" @@ -31,12 +33,10 @@ import ( "github.com/operator-framework/operator-registry/pkg/sqlite" ) -func init() { - rand.Seed(time.Now().UTC().UnixNano()) -} - -func CreateTestDb(t *testing.T) (*sql.DB, func()) { - dbName := fmt.Sprintf("test-%d.db", rand.Int()) +func CreateTestDB(t *testing.T) (*sql.DB, func()) { + r, err := rand.Int(rand.Reader, big.NewInt(math.MaxInt64)) + require.NoError(t, err) + dbName := fmt.Sprintf("test-%d.db", r.Int64()) db, err := sqlite.Open(dbName) require.NoError(t, err) @@ -91,7 +91,7 @@ func createAndPopulateDB(db *sql.DB) (*sqlite.SQLQuerier, error) { func TestImageLoader(t *testing.T) { logrus.SetLevel(logrus.DebugLevel) - db, cleanup := CreateTestDb(t) + db, cleanup := CreateTestDB(t) defer cleanup() _, err := createAndPopulateDB(db) @@ -100,7 +100,7 @@ func TestImageLoader(t *testing.T) { func TestQuerierForImage(t *testing.T) { logrus.SetLevel(logrus.DebugLevel) - db, cleanup := CreateTestDb(t) + db, cleanup := CreateTestDB(t) defer cleanup() store, err := createAndPopulateDB(db) @@ -202,6 +202,7 @@ func TestQuerierForImage(t *testing.T) { EqualBundles(t, *expectedBundle, *etcdBundleByReplaces) etcdChannelEntriesThatProvide, err := store.GetChannelEntriesThatProvide(context.TODO(), "etcd.database.coreos.com", "v1beta2", "EtcdCluster") + require.NoError(t, err) require.ElementsMatch(t, []*registry.ChannelEntry{ {"etcd", "alpha", "etcdoperator.v0.9.0", ""}, {"etcd", "alpha", "etcdoperator.v0.9.2", "etcdoperator.v0.9.1"}, @@ -495,7 +496,7 @@ func TestImageLoading(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { logrus.SetLevel(logrus.DebugLevel) - db, cleanup := CreateTestDb(t) + db, cleanup := CreateTestDB(t) defer cleanup() load, err := sqlite.NewSQLLiteLoader(db) require.NoError(t, err) @@ -539,7 +540,8 @@ func TestImageLoading(t *testing.T) { } func checkAggErr(aggErr, wantErr error) bool { - if a, ok := aggErr.(utilerrors.Aggregate); ok { + var a utilerrors.Aggregate + if errors.As(aggErr, &a) { for _, e := range a.Errors() { if reflect.TypeOf(e).String() == reflect.TypeOf(wantErr).String() { return true @@ -552,7 +554,7 @@ func checkAggErr(aggErr, wantErr error) bool { func TestQuerierForDependencies(t *testing.T) { logrus.SetLevel(logrus.DebugLevel) - db, cleanup := CreateTestDb(t) + db, cleanup := CreateTestDB(t) defer cleanup() store, err := createAndPopulateDB(db) @@ -611,7 +613,7 @@ func TestQuerierForDependencies(t *testing.T) { func TestListBundles(t *testing.T) { logrus.SetLevel(logrus.DebugLevel) - db, cleanup := CreateTestDb(t) + db, cleanup := CreateTestDB(t) defer cleanup() store, err := createAndPopulateDB(db) @@ -662,7 +664,7 @@ func TestListBundles(t *testing.T) { } } } - require.Equal(t, 10, len(bundles)) + require.Len(t, bundles, 10) require.ElementsMatch(t, expectedDependencies, dependencies) } @@ -720,7 +722,7 @@ func CheckBundlesHaveContentsIfNoPath(t *testing.T, db *sql.DB) { } func TestDirectoryPopulator(t *testing.T) { - db, cleanup := CreateTestDb(t) + db, cleanup := CreateTestDB(t) defer cleanup() loader, err := sqlite.NewSQLLiteLoader(db) @@ -746,7 +748,7 @@ func TestDirectoryPopulator(t *testing.T) { } err = populate(add) - require.NotNil(t, err) + require.Error(t, err) require.Contains(t, err.Error(), fmt.Sprintf("Invalid bundle %s, replaces nonexistent bundle %s", "etcdoperator.v0.9.2", "etcdoperator.v0.9.0")) require.Contains(t, err.Error(), fmt.Sprintf("Invalid bundle %s, replaces nonexistent bundle %s", "prometheusoperator.0.22.2", "prometheusoperator.0.15.0")) } @@ -843,7 +845,7 @@ func TestDeprecateBundle(t *testing.T) { }, }, expected: expected{ - err: errors.NewAggregate([]error{fmt.Errorf("error deprecating bundle quay.io/test/prometheus.0.22.2: %s", registry.ErrRemovingDefaultChannelDuringDeprecation)}), + err: utilerrors.NewAggregate([]error{fmt.Errorf("error deprecating bundle quay.io/test/prometheus.0.22.2: %s", registry.ErrRemovingDefaultChannelDuringDeprecation)}), remainingBundles: []string{ "quay.io/test/etcd.0.9.0/alpha", "quay.io/test/etcd.0.9.0/beta", @@ -909,7 +911,7 @@ func TestDeprecateBundle(t *testing.T) { for _, tt := range tests { t.Run(tt.description, func(t *testing.T) { logrus.SetLevel(logrus.DebugLevel) - db, cleanup := CreateTestDb(t) + db, cleanup := CreateTestDB(t) defer cleanup() querier, err := createAndPopulateDB(db) @@ -1121,7 +1123,7 @@ func TestDeprecatePackage(t *testing.T) { for _, tt := range tests { t.Run(tt.description, func(t *testing.T) { logrus.SetLevel(logrus.DebugLevel) - db, cleanup := CreateTestDb(t) + db, cleanup := CreateTestDB(t) defer cleanup() querier, err := createAndPopulateDB(db) @@ -1352,7 +1354,7 @@ func TestAddAfterDeprecate(t *testing.T) { "quay.io/test/prometheus.0.15.0", }, overwrite: map[string][]string{ - "prometheus": []string{ + "prometheus": { "prometheus.0.15.0", "prometheus.0.22.2", }, @@ -1520,7 +1522,7 @@ func TestAddAfterDeprecate(t *testing.T) { "testpkg.v0.3.0-overwrite", }, overwrite: map[string][]string{ - "testpkg": []string{"testpkg.v0.3.0"}, + "testpkg": {"testpkg.v0.3.0"}, }, }, expected: expected{ @@ -1559,7 +1561,7 @@ func TestAddAfterDeprecate(t *testing.T) { "testpkg.v0.3.0-overwrite-replaces-0.2.0", }, overwrite: map[string][]string{ - "testpkg": []string{"testpkg.v0.3.0"}, + "testpkg": {"testpkg.v0.3.0"}, }, }, expected: expected{ @@ -1601,7 +1603,7 @@ func TestAddAfterDeprecate(t *testing.T) { "testpkg.v0.3.1-overwrite", }, overwrite: map[string][]string{ - "testpkg": []string{"testpkg.v0.3.1"}, + "testpkg": {"testpkg.v0.3.1"}, }, }, expected: expected{ @@ -1629,7 +1631,7 @@ func TestAddAfterDeprecate(t *testing.T) { for _, tt := range tests { t.Run(tt.description, func(t *testing.T) { logrus.SetLevel(logrus.DebugLevel) - db, cleanup := CreateTestDb(t) + db, cleanup := CreateTestDB(t) defer cleanup() load, err := sqlite.NewSQLLiteLoader(db, sqlite.WithEnableAlpha(true)) @@ -1653,7 +1655,6 @@ func TestAddAfterDeprecate(t *testing.T) { query, addRefs, overwrite).Populate(registry.ReplacesMode) - } // Initialize index with some bundles require.NoError(t, populate(tt.args.existing, nil)) @@ -1809,7 +1810,7 @@ func TestOverwrite(t *testing.T) { image.SimpleReference("quay.io/test/new-etcd.0.9.2"): "testdata/overwrite/etcd.0.9.2", image.SimpleReference("quay.io/test/prometheus.0.22.2"): "../../bundles/prometheus.0.22.2", }, - overwrites: map[string][]string{"etcd": []string{"etcdoperator.v0.9.2"}}, + overwrites: map[string][]string{"etcd": {"etcdoperator.v0.9.2"}}, }, expected: expected{ errs: nil, @@ -1850,7 +1851,7 @@ func TestOverwrite(t *testing.T) { image.SimpleReference("quay.io/test/etcd.0.9.2"): "../../bundles/etcd.0.9.2", image.SimpleReference("quay.io/test/new-prometheus.0.22.2"): "testdata/overwrite/prometheus.0.22.2", }, - overwrites: map[string][]string{"prometheus": []string{"prometheusoperator.0.22.2"}}, + overwrites: map[string][]string{"prometheus": {"prometheusoperator.0.22.2"}}, }, expected: expected{ errs: nil, @@ -1895,7 +1896,7 @@ func TestOverwrite(t *testing.T) { image.SimpleReference("quay.io/test/etcd.0.9.2"): "../../bundles/etcd.0.9.2", image.SimpleReference("quay.io/test/new-prometheus.0.15.0"): "testdata/overwrite/prometheus.0.15.0", }, - overwrites: map[string][]string{"prometheus": []string{"prometheusoperator.0.15.0"}}, + overwrites: map[string][]string{"prometheus": {"prometheusoperator.0.15.0"}}, }, expected: expected{ errs: nil, @@ -1936,7 +1937,7 @@ func TestOverwrite(t *testing.T) { image.SimpleReference("quay.io/test/etcd.0.9.2"): "../../bundles/etcd.0.9.2", image.SimpleReference("quay.io/test/new-prometheus.0.15.0"): "testdata/overwrite/prometheus.0.15.0", }, - overwrites: map[string][]string{"prometheus": []string{"prometheus.0.14.0"}}, + overwrites: map[string][]string{"prometheus": {"prometheus.0.14.0"}}, }, expected: expected{ errs: []error{registry.OverwriteErr{ErrorString: "Cannot overwrite a bundle that is not at the head of a channel using --overwrite-latest"}}, @@ -1967,8 +1968,8 @@ func TestOverwrite(t *testing.T) { image.SimpleReference("quay.io/test/new-prometheus.0.22.2"): "testdata/overwrite/prometheus.0.22.2", }, overwrites: map[string][]string{ - "prometheus": []string{"prometheusoperator.0.22.2"}, - "etcd": []string{"etcdoperator.v0.9.2"}, + "prometheus": {"prometheusoperator.0.22.2"}, + "etcd": {"etcdoperator.v0.9.2"}, }, }, expected: expected{ @@ -2012,7 +2013,7 @@ func TestOverwrite(t *testing.T) { image.SimpleReference("quay.io/test/new-etcd.0.9.2"): "testdata/overwrite/etcd.0.9.2", image.SimpleReference("quay.io/test/new-new-etcd.0.9.2"): "testdata/overwrite/etcd.0.9.2", }, - overwrites: map[string][]string{"etcd": []string{"etcd.0.9.0"}}, + overwrites: map[string][]string{"etcd": {"etcd.0.9.0"}}, }, expected: expected{ errs: []error{registry.OverwriteErr{ErrorString: "Cannot overwrite more than one bundle at a time for a given package using --overwrite-latest"}}, @@ -2050,7 +2051,7 @@ func TestOverwrite(t *testing.T) { for _, tt := range tests { t.Run(tt.description, func(t *testing.T) { logrus.SetLevel(logrus.DebugLevel) - db, cleanup := CreateTestDb(t) + db, cleanup := CreateTestDB(t) defer cleanup() store, err := sqlite.NewSQLLiteLoader(db) @@ -2876,7 +2877,7 @@ func TestSubstitutesFor(t *testing.T) { for _, tt := range tests { t.Run(tt.description, func(t *testing.T) { logrus.SetLevel(logrus.DebugLevel) - db, cleanup := CreateTestDb(t) + db, cleanup := CreateTestDB(t) defer cleanup() load, err := sqlite.NewSQLLiteLoader(db, sqlite.WithEnableAlpha(true)) @@ -2919,7 +2920,7 @@ func TestSubstitutesFor(t *testing.T) { if bundleThatReplaces != nil { require.Equal(t, tt.expected.whatReplaces[bundle.CsvName][bundle.ChannelName], bundleThatReplaces.CsvName) } else { - require.Equal(t, tt.expected.whatReplaces[bundle.CsvName][bundle.ChannelName], "") + require.Equal(t, "", tt.expected.whatReplaces[bundle.CsvName][bundle.ChannelName]) } substitution, err := getBundleSubstitution(context.Background(), db, bundle.CsvName) require.NoError(t, err) @@ -2992,7 +2993,7 @@ func TestEnableAlpha(t *testing.T) { enableAlpha: false, }, expected: expected{ - err: errors.NewAggregate([]error{fmt.Errorf("SubstitutesFor is an alpha-only feature. You must enable alpha features with the flag --enable-alpha in order to use this feature.")}), + err: utilerrors.NewAggregate([]error{fmt.Errorf("SubstitutesFor is an alpha-only feature. You must enable alpha features with the flag --enable-alpha in order to use this feature.")}), }, }, } @@ -3000,7 +3001,7 @@ func TestEnableAlpha(t *testing.T) { for _, tt := range tests { t.Run(tt.description, func(t *testing.T) { logrus.SetLevel(logrus.DebugLevel) - db, cleanup := CreateTestDb(t) + db, cleanup := CreateTestDB(t) defer cleanup() load, err := sqlite.NewSQLLiteLoader(db, sqlite.WithEnableAlpha(tt.args.enableAlpha)) @@ -3048,10 +3049,10 @@ func newUnpackedTestBundle(root, dir, name string, csvSpec json.RawMessage, anno } rawCSV, err := json.Marshal(registry.ClusterServiceVersion{ - TypeMeta: v1.TypeMeta{ + TypeMeta: metav1.TypeMeta{ Kind: sqlite.ClusterServiceVersionKind, }, - ObjectMeta: v1.ObjectMeta{ + ObjectMeta: metav1.ObjectMeta{ Name: name, }, Spec: csvSpec, @@ -3064,14 +3065,17 @@ func newUnpackedTestBundle(root, dir, name string, csvSpec json.RawMessage, anno if err := json.Unmarshal(rawCSV, &rawObj); err != nil { return bundleDir, cleanup, err } - rawObj.SetCreationTimestamp(v1.Time{}) + rawObj.SetCreationTimestamp(metav1.Time{}) jsonout, err := rawObj.MarshalJSON() + if err != nil { + return bundleDir, cleanup, err + } out, err := yaml.JSONToYAML(jsonout) if err != nil { return bundleDir, cleanup, err } - if err := os.WriteFile(filepath.Join(bundleDir, bundle.ManifestsDir, "csv.yaml"), out, 0666); err != nil { + if err := os.WriteFile(filepath.Join(bundleDir, bundle.ManifestsDir, "csv.yaml"), out, 0600); err != nil { return bundleDir, cleanup, err } @@ -3079,7 +3083,7 @@ func newUnpackedTestBundle(root, dir, name string, csvSpec json.RawMessage, anno if err != nil { return bundleDir, cleanup, err } - if err := os.WriteFile(filepath.Join(bundleDir, bundle.MetadataDir, "annotations.yaml"), out, 0666); err != nil { + if err := os.WriteFile(filepath.Join(bundleDir, bundle.MetadataDir, "annotations.yaml"), out, 0600); err != nil { return bundleDir, cleanup, err } return bundleDir, cleanup, nil @@ -3093,24 +3097,25 @@ func TestValidateEdgeBundlePackage(t *testing.T) { spec := v1alpha1.ClusterServiceVersionSpec{ Replaces: replaces, Skips: skips, - Version: version.OperatorVersion{v}, + Version: version.OperatorVersion{Version: v}, } - specJson, err := json.Marshal(&spec) + specJSON, err := json.Marshal(&spec) require.NoError(t, err) rawCSV, err := json.Marshal(registry.ClusterServiceVersion{ - TypeMeta: v1.TypeMeta{ + TypeMeta: metav1.TypeMeta{ Kind: sqlite.ClusterServiceVersionKind, }, - ObjectMeta: v1.ObjectMeta{ + ObjectMeta: metav1.ObjectMeta{ Name: name, }, - Spec: specJson, + Spec: specJSON, }) + require.NoError(t, err) rawObj := unstructured.Unstructured{} require.NoError(t, json.Unmarshal(rawCSV, &rawObj)) - rawObj.SetCreationTimestamp(v1.Time{}) + rawObj.SetCreationTimestamp(metav1.Time{}) jsonout, err := rawObj.MarshalJSON() require.NoError(t, err) @@ -3121,7 +3126,7 @@ func TestValidateEdgeBundlePackage(t *testing.T) { } logrus.SetLevel(logrus.DebugLevel) - db, cleanup := CreateTestDb(t) + db, cleanup := CreateTestDB(t) defer cleanup() store, err := createAndPopulateDB(db) diff --git a/pkg/registry/registry_to_model.go b/pkg/registry/registry_to_model.go index 0ba64c72d..947814751 100644 --- a/pkg/registry/registry_to_model.go +++ b/pkg/registry/registry_to_model.go @@ -47,7 +47,7 @@ func ObjectsAndPropertiesFromBundle(b *Bundle) ([]string, []property.Property, e if err := json.Unmarshal(p.Value, &v); err != nil { return nil, nil, property.ParseError{Idx: i, Typ: p.Type, Err: err} } - k := property.GVKRequired{Group: v.Group, Kind: v.Kind, Version: v.Version} + k := property.GVKRequired(v) requiredGVKs[k] = struct{}{} case property.TypePackage: var v property.Package @@ -90,6 +90,7 @@ func ObjectsAndPropertiesFromBundle(b *Bundle) ([]string, []property.Property, e } } + // nolint:prealloc var ( props []property.Property objects []string diff --git a/pkg/registry/registry_to_model_test.go b/pkg/registry/registry_to_model_test.go index 41f716cdf..051bdac0c 100644 --- a/pkg/registry/registry_to_model_test.go +++ b/pkg/registry/registry_to_model_test.go @@ -4,10 +4,11 @@ import ( "encoding/json" "testing" - "github.com/operator-framework/api/pkg/operators/v1alpha1" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/operator-framework/api/pkg/operators/v1alpha1" + "github.com/operator-framework/operator-registry/alpha/property" "github.com/operator-framework/operator-registry/pkg/image" ) @@ -53,7 +54,7 @@ func testExpectedProperties(t *testing.T) []property.Property { property.MustBuildGVK("etcd.database.coreos.com", "v1beta2", "EtcdCluster"), property.MustBuildGVK("etcd.database.coreos.com", "v1beta2", "EtcdBackup"), property.MustBuildGVK("etcd.database.coreos.com", "v1beta2", "EtcdRestore"), - property.Property{ + { Type: "olm.constraint", Value: json.RawMessage(`{"cel":{"rule":"properties.exists(p, p.type == \"certified\")"},"failureMessage":"require to have \"certified\""}`), }, diff --git a/pkg/registry/types.go b/pkg/registry/types.go index 3a5ab6293..4105aaa3d 100644 --- a/pkg/registry/types.go +++ b/pkg/registry/types.go @@ -8,6 +8,7 @@ import ( "strings" "github.com/blang/semver/v4" + "github.com/operator-framework/api/pkg/constraints" ) @@ -285,6 +286,7 @@ func (gd *GVKDependency) Validate() []error { func (ld *LabelDependency) Validate() []error { errs := []error{} if *ld == (LabelDependency{}) { + // nolint:stylecheck errs = append(errs, fmt.Errorf("Label information is missing")) } return errs @@ -294,13 +296,16 @@ func (ld *LabelDependency) Validate() []error { func (pd *PackageDependency) Validate() []error { errs := []error{} if pd.PackageName == "" { + // nolint:stylecheck errs = append(errs, fmt.Errorf("Package name is empty")) } if pd.Version == "" { + // nolint:stylecheck errs = append(errs, fmt.Errorf("Package version is empty")) } else { _, err := semver.ParseRange(pd.Version) if err != nil { + // nolint:stylecheck errs = append(errs, fmt.Errorf("Invalid semver format version")) } } @@ -311,15 +316,18 @@ func (pd *PackageDependency) Validate() []error { func (cc *CelConstraint) Validate() []error { errs := []error{} if cc.Cel == nil { + // nolint:stylecheck errs = append(errs, fmt.Errorf("The CEL field is missing")) } else { if cc.Cel.Rule == "" { + // nolint:stylecheck errs = append(errs, fmt.Errorf("The CEL expression is missing")) return errs } validator := constraints.NewCelEnvironment() _, err := validator.Validate(cc.Cel.Rule) if err != nil { + // nolint:stylecheck errs = append(errs, fmt.Errorf("Invalid CEL expression: %s", err.Error())) } } @@ -328,6 +336,7 @@ func (cc *CelConstraint) Validate() []error { // GetDependencies returns the list of dependency func (d *DependenciesFile) GetDependencies() []*Dependency { + // nolint:prealloc var dependencies []*Dependency for _, item := range d.Dependencies { dep := item diff --git a/pkg/registry/types_test.go b/pkg/registry/types_test.go index c74275dde..943f72423 100644 --- a/pkg/registry/types_test.go +++ b/pkg/registry/types_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" ) func TestCelConstraintValidation(t *testing.T) { @@ -52,13 +52,13 @@ func TestCelConstraintValidation(t *testing.T) { t.Run(tt.name, func(t *testing.T) { var dep CelConstraint err := json.Unmarshal([]byte(tt.constraint), &dep) - assert.NoError(t, err) + require.NoError(t, err) errs := dep.Validate() if len(tt.errs) > 0 { - assert.Error(t, errs[0]) - assert.Contains(t, errs[0].Error(), tt.errs[0].Error()) + require.Error(t, errs[0]) + require.Contains(t, errs[0].Error(), tt.errs[0].Error()) } else { - assert.Equal(t, len(errs), 0) + require.Empty(t, errs) } }) } diff --git a/pkg/server/server_test.go b/pkg/server/server_test.go index 1fd4d4745..73f355b1d 100644 --- a/pkg/server/server_test.go +++ b/pkg/server/server_test.go @@ -1,6 +1,7 @@ package server import ( + "errors" "fmt" "io" "io/fs" @@ -146,7 +147,7 @@ func TestMain(m *testing.M) { var wg sync.WaitGroup wg.Add(3) go func() { - lis, err := net.Listen("tcp", dbPort) + lis, err := net.Listen("tcp", fmt.Sprintf("localhost%s", dbPort)) if err != nil { logrus.Fatalf("failed to listen: %v", err) } @@ -156,7 +157,7 @@ func TestMain(m *testing.M) { } }() go func() { - lis, err := net.Listen("tcp", cachePort) + lis, err := net.Listen("tcp", fmt.Sprintf("localhost%s", cachePort)) if err != nil { logrus.Fatalf("failed to listen: %v", err) } @@ -181,6 +182,7 @@ func TestMain(m *testing.M) { } func client(t *testing.T, address string) (api.RegistryClient, *grpc.ClientConn) { + // nolint:staticcheck conn, err := grpc.Dial(address, grpc.WithInsecure()) if err != nil { t.Fatalf("did not connect: %v", err) @@ -216,7 +218,7 @@ func testListPackages(addr string, expected []string) func(*testing.T) { go func(t *testing.T) { for { in, err := stream.Recv() - if err == io.EOF { + if errors.Is(err, io.EOF) { // read done. close(waitc) return @@ -326,8 +328,8 @@ func TestGetBundle(t *testing.T) { }, } ) - t.Run("Sqlite", testGetBundle(dbAddress, etcdoperator_v0_9_2("alpha", false, false, includeManifestsAll))) - t.Run("FBCCache", testGetBundle(cacheAddress, etcdoperator_v0_9_2("alpha", false, true, includeManifestsAll))) + t.Run("Sqlite", testGetBundle(dbAddress, etcdoperatorV0_9_2("alpha", false, false, includeManifestsAll))) + t.Run("FBCCache", testGetBundle(cacheAddress, etcdoperatorV0_9_2("alpha", false, true, includeManifestsAll))) t.Run("FBCCacheWithDeprecations", testGetBundle(deprecationCacheAddress, cockroachBundle)) } @@ -345,13 +347,13 @@ func testGetBundle(addr string, expected *api.Bundle) func(*testing.T) { func TestGetBundleForChannel(t *testing.T) { { - b := etcdoperator_v0_9_2("alpha", false, false, includeManifestsAll) + b := etcdoperatorV0_9_2("alpha", false, false, includeManifestsAll) t.Run("Sqlite", testGetBundleForChannel(dbAddress, &api.Bundle{ CsvName: b.CsvName, CsvJson: b.CsvJson + "\n", })) } - t.Run("FBCCache", testGetBundleForChannel(cacheAddress, etcdoperator_v0_9_2("alpha", false, true, includeManifestsAll))) + t.Run("FBCCache", testGetBundleForChannel(cacheAddress, etcdoperatorV0_9_2("alpha", false, true, includeManifestsAll))) } func testGetBundleForChannel(addr string, expected *api.Bundle) func(*testing.T) { @@ -359,6 +361,7 @@ func testGetBundleForChannel(addr string, expected *api.Bundle) func(*testing.T) c, conn := client(t, addr) defer conn.Close() + // nolint:staticcheck // ignore this, since we still want to test it even if marked deprecated bundle, err := c.GetBundleForChannel(context.TODO(), &api.GetBundleInChannelRequest{PkgName: "etcd", ChannelName: "alpha"}) require.NoError(t, err) EqualBundles(t, *expected, *bundle) @@ -416,7 +419,7 @@ func testGetChannelEntriesThatReplace(addr string, expected []*api.ChannelEntry) go func(t *testing.T) { for { in, err := stream.Recv() - if err == io.EOF { + if errors.Is(err, io.EOF) { // read done. close(waitc) return @@ -455,8 +458,8 @@ func testGetChannelEntriesThatReplace(addr string, expected []*api.ChannelEntry) } func TestGetBundleThatReplaces(t *testing.T) { - t.Run("Sqlite", testGetBundleThatReplaces(dbAddress, etcdoperator_v0_9_2("alpha", false, false, includeManifestsAll))) - t.Run("FBCCache", testGetBundleThatReplaces(cacheAddress, etcdoperator_v0_9_2("alpha", false, true, includeManifestsAll))) + t.Run("Sqlite", testGetBundleThatReplaces(dbAddress, etcdoperatorV0_9_2("alpha", false, false, includeManifestsAll))) + t.Run("FBCCache", testGetBundleThatReplaces(cacheAddress, etcdoperatorV0_9_2("alpha", false, true, includeManifestsAll))) } func testGetBundleThatReplaces(addr string, expected *api.Bundle) func(*testing.T) { @@ -471,8 +474,8 @@ func testGetBundleThatReplaces(addr string, expected *api.Bundle) func(*testing. } func TestGetBundleThatReplacesSynthetic(t *testing.T) { - t.Run("Sqlite", testGetBundleThatReplacesSynthetic(dbAddress, etcdoperator_v0_9_2("alpha", false, false, includeManifestsAll))) - t.Run("FBCCache", testGetBundleThatReplacesSynthetic(cacheAddress, etcdoperator_v0_9_2("alpha", false, true, includeManifestsAll))) + t.Run("Sqlite", testGetBundleThatReplacesSynthetic(dbAddress, etcdoperatorV0_9_2("alpha", false, false, includeManifestsAll))) + t.Run("FBCCache", testGetBundleThatReplacesSynthetic(cacheAddress, etcdoperatorV0_9_2("alpha", false, true, includeManifestsAll))) } func testGetBundleThatReplacesSynthetic(addr string, expected *api.Bundle) func(*testing.T) { @@ -505,7 +508,7 @@ func testGetChannelEntriesThatProvide(addr string) func(t *testing.T) { go func(t *testing.T) { for { in, err := stream.Recv() - if err == io.EOF { + if errors.Is(err, io.EOF) { // read done. close(waitc) return @@ -622,7 +625,7 @@ func testGetLatestChannelEntriesThatProvide(addr string) func(t *testing.T) { go func(t *testing.T) { for { in, err := stream.Recv() - if err == io.EOF { + if errors.Is(err, io.EOF) { // read done. close(waitc) return @@ -681,8 +684,8 @@ func testGetLatestChannelEntriesThatProvide(addr string) func(t *testing.T) { } func TestGetDefaultBundleThatProvides(t *testing.T) { - t.Run("Sqlite", testGetDefaultBundleThatProvides(dbAddress, etcdoperator_v0_9_2("alpha", false, false, includeManifestsAll))) - t.Run("FBCCache", testGetDefaultBundleThatProvides(cacheAddress, etcdoperator_v0_9_2("alpha", false, true, includeManifestsAll))) + t.Run("Sqlite", testGetDefaultBundleThatProvides(dbAddress, etcdoperatorV0_9_2("alpha", false, false, includeManifestsAll))) + t.Run("FBCCache", testGetDefaultBundleThatProvides(cacheAddress, etcdoperatorV0_9_2("alpha", false, true, includeManifestsAll))) } func testGetDefaultBundleThatProvides(addr string, expected *api.Bundle) func(*testing.T) { @@ -698,11 +701,11 @@ func testGetDefaultBundleThatProvides(addr string, expected *api.Bundle) func(*t func TestListBundles(t *testing.T) { t.Run("Sqlite", testListBundles(dbAddress, - etcdoperator_v0_9_2("alpha", true, false, includeManifestsNone), - etcdoperator_v0_9_2("stable", true, false, includeManifestsNone))) + etcdoperatorV0_9_2("alpha", true, false, includeManifestsNone), + etcdoperatorV0_9_2("stable", true, false, includeManifestsNone))) t.Run("FBCCache", testListBundles(cacheAddress, - etcdoperator_v0_9_2("alpha", true, true, includeManifestsNone), - etcdoperator_v0_9_2("stable", true, true, includeManifestsNone))) + etcdoperatorV0_9_2("alpha", true, true, includeManifestsNone), + etcdoperatorV0_9_2("stable", true, true, includeManifestsNone))) } func testListBundles(addr string, etcdAlpha *api.Bundle, etcdStable *api.Bundle) func(*testing.T) { @@ -747,7 +750,7 @@ func testListBundles(addr string, etcdAlpha *api.Bundle, etcdStable *api.Bundle) for { in, err := stream.Recv() - if err == io.EOF { + if errors.Is(err, io.EOF) { // read done. close(waitc) return @@ -826,7 +829,7 @@ const ( includeManifestsCSVOnly includeManifests = "csvOnly" ) -func etcdoperator_v0_9_2(channel string, addSkipsReplaces, addExtraProperties bool, includeManifests includeManifests) *api.Bundle { +func etcdoperatorV0_9_2(channel string, addSkipsReplaces, addExtraProperties bool, includeManifests includeManifests) *api.Bundle { b := &api.Bundle{ CsvName: "etcdoperator.v0.9.2", PackageName: "etcd", diff --git a/pkg/sqlite/configmap.go b/pkg/sqlite/configmap.go index 44e2302cc..a1ce927f8 100644 --- a/pkg/sqlite/configmap.go +++ b/pkg/sqlite/configmap.go @@ -6,7 +6,7 @@ import ( "strings" "github.com/sirupsen/logrus" - v1 "k8s.io/api/core/v1" + corev1 "k8s.io/api/core/v1" "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" @@ -47,7 +47,7 @@ func NewSQLLoaderForConfigMapData(logger *logrus.Entry, store registry.Load, con } } -func NewSQLLoaderForConfigMap(store registry.Load, configMap v1.ConfigMap) *ConfigMapLoader { +func NewSQLLoaderForConfigMap(store registry.Load, configMap corev1.ConfigMap) *ConfigMapLoader { logger := logrus.WithFields(logrus.Fields{"configmap": configMap.GetName(), "ns": configMap.GetNamespace()}) return &ConfigMapLoader{ log: logger, @@ -66,14 +66,14 @@ func (c *ConfigMapLoader) Populate() error { return fmt.Errorf("couldn't find expected key %s in configmap", ConfigMapCRDName) } - crdListJson, err := yaml.YAMLToJSON([]byte(crdListYaml)) + crdListJSON, err := yaml.YAMLToJSON([]byte(crdListYaml)) if err != nil { c.log.WithError(err).Debug("error loading CRD list") return err } var parsedCRDList []v1beta1.CustomResourceDefinition - if err := json.Unmarshal(crdListJson, &parsedCRDList); err != nil { + if err := json.Unmarshal(crdListJSON, &parsedCRDList); err != nil { c.log.WithError(err).Debug("error parsing CRD list") return err } @@ -106,14 +106,14 @@ func (c *ConfigMapLoader) Populate() error { errs = append(errs, fmt.Errorf("couldn't find expected key %s in configmap", ConfigMapCSVName)) return utilerrors.NewAggregate(errs) } - csvListJson, err := yaml.YAMLToJSON([]byte(csvListYaml)) + csvListJSON, err := yaml.YAMLToJSON([]byte(csvListYaml)) if err != nil { errs = append(errs, fmt.Errorf("error loading CSV list: %s", err)) return utilerrors.NewAggregate(errs) } var parsedCSVList []registry.ClusterServiceVersion - err = json.Unmarshal(csvListJson, &parsedCSVList) + err = json.Unmarshal(csvListJSON, &parsedCSVList) if err != nil { errs = append(errs, fmt.Errorf("error parsing CSV list: %s", err)) return utilerrors.NewAggregate(errs) @@ -164,14 +164,14 @@ func (c *ConfigMapLoader) Populate() error { return utilerrors.NewAggregate(errs) } - packageListJson, err := yaml.YAMLToJSON([]byte(packageListYaml)) + packageListJSON, err := yaml.YAMLToJSON([]byte(packageListYaml)) if err != nil { errs = append(errs, fmt.Errorf("error loading package list: %s", err)) return utilerrors.NewAggregate(errs) } var parsedPackageManifests []registry.PackageManifest - err = json.Unmarshal(packageListJson, &parsedPackageManifests) + err = json.Unmarshal(packageListJSON, &parsedPackageManifests) if err != nil { errs = append(errs, fmt.Errorf("error parsing package list: %s", err)) return utilerrors.NewAggregate(errs) diff --git a/pkg/sqlite/configmap_test.go b/pkg/sqlite/configmap_test.go index aba816d3d..a09f22f4d 100644 --- a/pkg/sqlite/configmap_test.go +++ b/pkg/sqlite/configmap_test.go @@ -3,24 +3,28 @@ package sqlite import ( "bytes" "context" + "crypto/rand" "database/sql" "fmt" - "math/rand" + "math" + "math/big" "os" "strings" "testing" "github.com/sirupsen/logrus" "github.com/stretchr/testify/require" - v1 "k8s.io/api/core/v1" + corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/util/yaml" "github.com/operator-framework/operator-registry/pkg/api" "github.com/operator-framework/operator-registry/pkg/registry" ) -func CreateTestDb(t *testing.T) (*sql.DB, func()) { - dbName := fmt.Sprintf("test-%d.db", rand.Int()) +func CreateTestDB(t *testing.T) (*sql.DB, func()) { + r, err := rand.Int(rand.Reader, big.NewInt(math.MaxInt64)) + require.NoError(t, err) + dbName := fmt.Sprintf("test-%d.db", r.Int64()) db, err := Open(dbName) require.NoError(t, err) @@ -40,7 +44,7 @@ func CreateTestDb(t *testing.T) (*sql.DB, func()) { func TestConfigMapLoader(t *testing.T) { logrus.SetLevel(logrus.DebugLevel) - db, cleanup := CreateTestDb(t) + db, cleanup := CreateTestDB(t) defer cleanup() store, err := NewSQLLiteLoader(db) require.NoError(t, err) @@ -52,7 +56,7 @@ func TestConfigMapLoader(t *testing.T) { require.NoError(t, err, "unable to load configmap from file %s", path) decoder := yaml.NewYAMLOrJSONDecoder(fileReader, 30) - manifest := v1.ConfigMap{} + manifest := corev1.ConfigMap{} err = decoder.Decode(&manifest) require.NoError(t, err, "could not decode contents of file %s into configmap", path) @@ -63,7 +67,7 @@ func TestConfigMapLoader(t *testing.T) { func TestReplaceCycle(t *testing.T) { logrus.SetLevel(logrus.DebugLevel) - db, cleanup := CreateTestDb(t) + db, cleanup := CreateTestDB(t) defer cleanup() store, err := NewSQLLiteLoader(db) require.NoError(t, err) @@ -79,7 +83,7 @@ func TestReplaceCycle(t *testing.T) { []byte("replaces: etcdoperator.v0.9.2"), 1))) decoder := yaml.NewYAMLOrJSONDecoder(sReader, 30) - manifest := v1.ConfigMap{} + manifest := corev1.ConfigMap{} err = decoder.Decode(&manifest) require.NoError(t, err, "could not decode contents of file %s into configmap", path) @@ -89,7 +93,7 @@ func TestReplaceCycle(t *testing.T) { } func TestQuerierForConfigmap(t *testing.T) { - db, cleanup := CreateTestDb(t) + db, cleanup := CreateTestDB(t) defer cleanup() load, err := NewSQLLiteLoader(db) require.NoError(t, err) @@ -100,7 +104,7 @@ func TestQuerierForConfigmap(t *testing.T) { require.NoError(t, err, "unable to load configmap from file %s", path) decoder := yaml.NewYAMLOrJSONDecoder(fileReader, 30) - manifest := v1.ConfigMap{} + manifest := corev1.ConfigMap{} err = decoder.Decode(&manifest) require.NoError(t, err, "could not decode contents of file %s into configmap", path) @@ -186,7 +190,7 @@ func TestQuerierForConfigmap(t *testing.T) { etcdChannelEntries, err := store.GetChannelEntriesThatReplace(context.TODO(), "etcdoperator.v0.9.0") require.NoError(t, err) - require.ElementsMatch(t, []*registry.ChannelEntry{{"etcd", "alpha", "etcdoperator.v0.9.2", "etcdoperator.v0.9.0"}}, etcdChannelEntries) + require.ElementsMatch(t, []*registry.ChannelEntry{{PackageName: "etcd", ChannelName: "alpha", BundleName: "etcdoperator.v0.9.2", Replaces: "etcdoperator.v0.9.0"}}, etcdChannelEntries) etcdBundleByReplaces, err := store.GetBundleThatReplaces(context.TODO(), "etcdoperator.v0.9.0", "etcd", "alpha") require.NoError(t, err) @@ -195,17 +199,17 @@ func TestQuerierForConfigmap(t *testing.T) { etcdChannelEntriesThatProvide, err := store.GetChannelEntriesThatProvide(context.TODO(), "etcd.database.coreos.com", "v1beta2", "EtcdCluster") require.NoError(t, err) require.ElementsMatch(t, []*registry.ChannelEntry{ - {"etcd", "alpha", "etcdoperator.v0.6.1", ""}, - {"etcd", "alpha", "etcdoperator.v0.9.0", "etcdoperator.v0.6.1"}, - {"etcd", "alpha", "etcdoperator.v0.9.2", "etcdoperator.v0.9.0"}}, etcdChannelEntriesThatProvide) + {PackageName: "etcd", ChannelName: "alpha", BundleName: "etcdoperator.v0.6.1", Replaces: ""}, + {PackageName: "etcd", ChannelName: "alpha", BundleName: "etcdoperator.v0.9.0", Replaces: "etcdoperator.v0.6.1"}, + {PackageName: "etcd", ChannelName: "alpha", BundleName: "etcdoperator.v0.9.2", Replaces: "etcdoperator.v0.9.0"}}, etcdChannelEntriesThatProvide) etcdChannelEntriesThatProvideAPIServer, err := store.GetChannelEntriesThatProvide(context.TODO(), "etcd.database.coreos.com", "v1beta2", "FakeEtcdObject") require.NoError(t, err) - require.ElementsMatch(t, []*registry.ChannelEntry{{"etcd", "alpha", "etcdoperator.v0.9.0", "etcdoperator.v0.6.1"}}, etcdChannelEntriesThatProvideAPIServer) + require.ElementsMatch(t, []*registry.ChannelEntry{{PackageName: "etcd", ChannelName: "alpha", BundleName: "etcdoperator.v0.9.0", Replaces: "etcdoperator.v0.6.1"}}, etcdChannelEntriesThatProvideAPIServer) etcdLatestChannelEntriesThatProvide, err := store.GetLatestChannelEntriesThatProvide(context.TODO(), "etcd.database.coreos.com", "v1beta2", "EtcdCluster") require.NoError(t, err) - require.ElementsMatch(t, []*registry.ChannelEntry{{"etcd", "alpha", "etcdoperator.v0.9.2", "etcdoperator.v0.9.0"}}, etcdLatestChannelEntriesThatProvide) + require.ElementsMatch(t, []*registry.ChannelEntry{{PackageName: "etcd", ChannelName: "alpha", BundleName: "etcdoperator.v0.9.2", Replaces: "etcdoperator.v0.9.0"}}, etcdLatestChannelEntriesThatProvide) etcdBundleByProvides, err := store.GetBundleThatProvides(context.TODO(), "etcd.database.coreos.com", "v1beta2", "EtcdCluster") require.NoError(t, err) diff --git a/pkg/sqlite/conversion.go b/pkg/sqlite/conversion.go index ff1da4c48..47d2257f7 100644 --- a/pkg/sqlite/conversion.go +++ b/pkg/sqlite/conversion.go @@ -7,9 +7,10 @@ import ( "fmt" "strings" - "github.com/operator-framework/api/pkg/operators/v1alpha1" "github.com/sirupsen/logrus" + "github.com/operator-framework/api/pkg/operators/v1alpha1" + "github.com/operator-framework/operator-registry/alpha/model" "github.com/operator-framework/operator-registry/pkg/api" "github.com/operator-framework/operator-registry/pkg/registry" @@ -39,6 +40,7 @@ func initializeModelPackages(ctx context.Context, q *SQLQuerier) (model.Model, e return nil, err } + // nolint:prealloc var rPkgs []registry.PackageManifest for _, pkgName := range pkgNames { rPkg, err := q.GetPackage(ctx, pkgName) diff --git a/pkg/sqlite/conversion_test.go b/pkg/sqlite/conversion_test.go index 659fce484..077b95c6d 100644 --- a/pkg/sqlite/conversion_test.go +++ b/pkg/sqlite/conversion_test.go @@ -41,27 +41,27 @@ func TestToModel(t *testing.T) { require.NoError(t, err) require.NotNil(t, m) require.NoError(t, m.Validate()) - require.Equal(t, 3, len(m)) + require.Len(t, m, 3) require.Equal(t, "etcd", m["etcd"].Name) require.NotNil(t, m["etcd"].Icon) require.Equal(t, "alpha", m["etcd"].DefaultChannel.Name) - require.Equal(t, 3, len(m["etcd"].Channels)) - require.Equal(t, 3, len(m["etcd"].Channels["alpha"].Bundles)) - require.Equal(t, 2, len(m["etcd"].Channels["beta"].Bundles)) - require.Equal(t, 3, len(m["etcd"].Channels["stable"].Bundles)) + require.Len(t, m["etcd"].Channels, 3) + require.Len(t, m["etcd"].Channels["alpha"].Bundles, 3) + require.Len(t, m["etcd"].Channels["beta"].Bundles, 2) + require.Len(t, m["etcd"].Channels["stable"].Bundles, 3) require.Equal(t, "prometheus", m["prometheus"].Name) require.NotNil(t, m["prometheus"].Icon) require.Equal(t, "preview", m["prometheus"].DefaultChannel.Name) - require.Equal(t, 1, len(m["prometheus"].Channels)) - require.Equal(t, 3, len(m["prometheus"].Channels["preview"].Bundles)) + require.Len(t, m["prometheus"].Channels, 1) + require.Len(t, m["prometheus"].Channels["preview"].Bundles, 3) require.Equal(t, "strimzi-kafka-operator", m["strimzi-kafka-operator"].Name) require.NotNil(t, m["strimzi-kafka-operator"].Icon) require.Equal(t, "stable", m["strimzi-kafka-operator"].DefaultChannel.Name) - require.Equal(t, 3, len(m["strimzi-kafka-operator"].Channels)) - require.Equal(t, 4, len(m["strimzi-kafka-operator"].Channels["alpha"].Bundles)) - require.Equal(t, 3, len(m["strimzi-kafka-operator"].Channels["beta"].Bundles)) - require.Equal(t, 2, len(m["strimzi-kafka-operator"].Channels["stable"].Bundles)) + require.Len(t, m["strimzi-kafka-operator"].Channels, 3) + require.Len(t, m["strimzi-kafka-operator"].Channels["alpha"].Bundles, 4) + require.Len(t, m["strimzi-kafka-operator"].Channels["beta"].Bundles, 3) + require.Len(t, m["strimzi-kafka-operator"].Channels["stable"].Bundles, 2) } diff --git a/pkg/sqlite/db_options.go b/pkg/sqlite/db_options.go index e09bfbc03..5d43615f1 100644 --- a/pkg/sqlite/db_options.go +++ b/pkg/sqlite/db_options.go @@ -4,12 +4,14 @@ import ( "database/sql" ) +// nolint:stylecheck type DbOptions struct { // MigratorBuilder is a function that returns a migrator instance MigratorBuilder func(*sql.DB) (Migrator, error) EnableAlpha bool } +// nolint:stylecheck type DbOption func(*DbOptions) func defaultDBOptions() *DbOptions { diff --git a/pkg/sqlite/deprecate.go b/pkg/sqlite/deprecate.go index 4ac3d61eb..80e11fc91 100644 --- a/pkg/sqlite/deprecate.go +++ b/pkg/sqlite/deprecate.go @@ -72,6 +72,7 @@ func (d *PackageDeprecator) MaybeRemovePackages() error { var errs []error var removedBundlePaths []string + // nolint:prealloc var remainingBundlePaths []string // Iterate over bundles list - see if any bundle is the head of a default channel in a package diff --git a/pkg/sqlite/deprecationmessage.go b/pkg/sqlite/deprecationmessage.go index 20a1389b7..a0b4bc75f 100644 --- a/pkg/sqlite/deprecationmessage.go +++ b/pkg/sqlite/deprecationmessage.go @@ -10,7 +10,7 @@ const noticeColor = "\033[1;33m%s\033[0m" func LogSqliteDeprecation() { log := logrus.New() - log.Warnf(DeprecationMessage) + log.Warn(DeprecationMessage) } var DeprecationMessage = fmt.Sprintf(noticeColor, `DEPRECATION NOTICE: diff --git a/pkg/sqlite/directory.go b/pkg/sqlite/directory.go index 2ed0c595e..a334ff693 100644 --- a/pkg/sqlite/directory.go +++ b/pkg/sqlite/directory.go @@ -54,7 +54,9 @@ func (d *DirectoryLoader) Populate() error { // collectWalkErrs calls the given walk func and appends any non-nil, non skip dir error returned to the given errors slice. func collectWalkErrs(walk filepath.WalkFunc, errs *[]error) filepath.WalkFunc { - return func(path string, f os.FileInfo, err error) (walkErr error) { + return func(path string, f os.FileInfo, err error) error { + var walkErr error + // nolint: errorlint if walkErr = walk(path, f, err); walkErr != nil && walkErr != filepath.SkipDir { *errs = append(*errs, walkErr) return nil @@ -67,7 +69,7 @@ func collectWalkErrs(walk filepath.WalkFunc, errs *[]error) filepath.WalkFunc { // LoadBundleWalkFunc walks the directory. When it sees a `.clusterserviceversion.yaml` file, it // attempts to load the surrounding files in the same directory as a bundle, and stores them in the // db for querying -func (d *DirectoryLoader) LoadBundleWalkFunc(path string, f os.FileInfo, err error) error { +func (d *DirectoryLoader) LoadBundleWalkFunc(path string, f os.FileInfo, _ error) error { if f == nil { return fmt.Errorf("invalid file: %v", f) } @@ -131,7 +133,7 @@ func (d *DirectoryLoader) LoadBundleWalkFunc(path string, f os.FileInfo, err err // LoadPackagesWalkFunc attempts to unmarshal the file at the given path into a PackageManifest resource. // If unmarshaling is successful, the PackageManifest is added to the loader's store. -func (d *DirectoryLoader) LoadPackagesWalkFunc(path string, f os.FileInfo, err error) error { +func (d *DirectoryLoader) LoadPackagesWalkFunc(path string, f os.FileInfo, _ error) error { if f == nil { return fmt.Errorf("invalid file: %v", f) } @@ -163,7 +165,6 @@ func (d *DirectoryLoader) LoadPackagesWalkFunc(path string, f os.FileInfo, err e if err != nil { return fmt.Errorf("could not decode contents of file %s into package: %s", path, err) } - } if manifest.PackageName == "" { return nil diff --git a/pkg/sqlite/directory_test.go b/pkg/sqlite/directory_test.go index 070fe178c..e2320fdc7 100644 --- a/pkg/sqlite/directory_test.go +++ b/pkg/sqlite/directory_test.go @@ -17,7 +17,7 @@ import ( func TestDirectoryLoader(t *testing.T) { logrus.SetLevel(logrus.DebugLevel) - db, cleanup := CreateTestDb(t) + db, cleanup := CreateTestDB(t) defer cleanup() store, err := NewSQLLiteLoader(db) require.NoError(t, err) @@ -30,7 +30,7 @@ func TestDirectoryLoader(t *testing.T) { func TestDirectoryLoaderWithBadPackageData(t *testing.T) { logrus.SetLevel(logrus.DebugLevel) - db, cleanup := CreateTestDb(t) + db, cleanup := CreateTestDB(t) defer cleanup() store, err := NewSQLLiteLoader(db) require.NoError(t, err) @@ -47,7 +47,7 @@ func TestDirectoryLoaderWithBadPackageData(t *testing.T) { pkg := new(registry.PackageManifest) require.NoError(t, yaml.NewDecoder(r).Decode(pkg)) - require.True(t, len(pkg.Channels) > 1) + require.Greater(t, len(pkg.Channels), 1) pkg.Channels[0].CurrentCSVName = "imaginary" // Replace file contents @@ -63,7 +63,7 @@ func TestDirectoryLoaderWithBadPackageData(t *testing.T) { func TestDirectoryLoaderWithBadBundleData(t *testing.T) { logrus.SetLevel(logrus.DebugLevel) - db, cleanup := CreateTestDb(t) + db, cleanup := CreateTestDB(t) defer cleanup() store, err := NewSQLLiteLoader(db) require.NoError(t, err) @@ -77,7 +77,7 @@ func TestDirectoryLoaderWithBadBundleData(t *testing.T) { } func TestQuerierForDirectory(t *testing.T) { - db, cleanup := CreateTestDb(t) + db, cleanup := CreateTestDB(t) defer cleanup() load, err := NewSQLLiteLoader(db) require.NoError(t, err) @@ -192,6 +192,7 @@ func TestQuerierForDirectory(t *testing.T) { EqualBundles(t, *expectedBundle, *etcdBundleByReplaces) etcdChannelEntriesThatProvide, err := store.GetChannelEntriesThatProvide(context.TODO(), "etcd.database.coreos.com", "v1beta2", "EtcdCluster") + require.NoError(t, err) for _, c := range etcdChannelEntriesThatProvide { t.Logf("%#v", c) } diff --git a/pkg/sqlite/graphloader_test.go b/pkg/sqlite/graphloader_test.go index 52901d571..0292a44c8 100644 --- a/pkg/sqlite/graphloader_test.go +++ b/pkg/sqlite/graphloader_test.go @@ -10,8 +10,8 @@ import ( "github.com/operator-framework/operator-registry/pkg/registry" ) -func createLoadedTestDb(t *testing.T) (*sql.DB, func()) { - db, cleanup := CreateTestDb(t) +func createLoadedTestDB(t *testing.T) (*sql.DB, func()) { + db, cleanup := CreateTestDB(t) store, err := NewSQLLiteLoader(db) require.NoError(t, err) require.NoError(t, store.Migrate(context.TODO())) @@ -30,11 +30,11 @@ func TestLoadPackageGraph_Etcd(t *testing.T) { "alpha": { Head: registry.BundleKey{BundlePath: "", Version: "0.9.2", CsvName: "etcdoperator.v0.9.2"}, Nodes: map[registry.BundleKey]map[registry.BundleKey]struct{}{ - registry.BundleKey{BundlePath: "", Version: "0.6.1", CsvName: "etcdoperator.v0.6.1"}: {}, - registry.BundleKey{BundlePath: "", Version: "0.9.0", CsvName: "etcdoperator.v0.9.0"}: { + {BundlePath: "", Version: "0.6.1", CsvName: "etcdoperator.v0.6.1"}: {}, + {BundlePath: "", Version: "0.9.0", CsvName: "etcdoperator.v0.9.0"}: { registry.BundleKey{BundlePath: "", Version: "0.6.1", CsvName: "etcdoperator.v0.6.1"}: struct{}{}, }, - registry.BundleKey{BundlePath: "", Version: "0.9.2", CsvName: "etcdoperator.v0.9.2"}: { + {BundlePath: "", Version: "0.9.2", CsvName: "etcdoperator.v0.9.2"}: { registry.BundleKey{BundlePath: "", Version: "", CsvName: "etcdoperator.v0.9.1"}: struct{}{}, registry.BundleKey{BundlePath: "", Version: "0.9.0", CsvName: "etcdoperator.v0.9.0"}: struct{}{}, }, @@ -43,8 +43,8 @@ func TestLoadPackageGraph_Etcd(t *testing.T) { "beta": { Head: registry.BundleKey{BundlePath: "", Version: "0.9.0", CsvName: "etcdoperator.v0.9.0"}, Nodes: map[registry.BundleKey]map[registry.BundleKey]struct{}{ - registry.BundleKey{BundlePath: "", Version: "0.6.1", CsvName: "etcdoperator.v0.6.1"}: {}, - registry.BundleKey{BundlePath: "", Version: "0.9.0", CsvName: "etcdoperator.v0.9.0"}: { + {BundlePath: "", Version: "0.6.1", CsvName: "etcdoperator.v0.6.1"}: {}, + {BundlePath: "", Version: "0.9.0", CsvName: "etcdoperator.v0.9.0"}: { registry.BundleKey{BundlePath: "", Version: "0.6.1", CsvName: "etcdoperator.v0.6.1"}: struct{}{}, }, }, @@ -52,11 +52,11 @@ func TestLoadPackageGraph_Etcd(t *testing.T) { "stable": { Head: registry.BundleKey{BundlePath: "", Version: "0.9.2", CsvName: "etcdoperator.v0.9.2"}, Nodes: map[registry.BundleKey]map[registry.BundleKey]struct{}{ - registry.BundleKey{BundlePath: "", Version: "0.6.1", CsvName: "etcdoperator.v0.6.1"}: {}, - registry.BundleKey{BundlePath: "", Version: "0.9.0", CsvName: "etcdoperator.v0.9.0"}: { + {BundlePath: "", Version: "0.6.1", CsvName: "etcdoperator.v0.6.1"}: {}, + {BundlePath: "", Version: "0.9.0", CsvName: "etcdoperator.v0.9.0"}: { registry.BundleKey{BundlePath: "", Version: "0.6.1", CsvName: "etcdoperator.v0.6.1"}: struct{}{}, }, - registry.BundleKey{BundlePath: "", Version: "0.9.2", CsvName: "etcdoperator.v0.9.2"}: { + {BundlePath: "", Version: "0.9.2", CsvName: "etcdoperator.v0.9.2"}: { registry.BundleKey{BundlePath: "", Version: "", CsvName: "etcdoperator.v0.9.1"}: struct{}{}, registry.BundleKey{BundlePath: "", Version: "0.9.0", CsvName: "etcdoperator.v0.9.0"}: struct{}{}, }, @@ -65,7 +65,7 @@ func TestLoadPackageGraph_Etcd(t *testing.T) { }, } - db, cleanup := createLoadedTestDb(t) + db, cleanup := createLoadedTestDB(t) defer cleanup() graphLoader, err := NewSQLGraphLoaderFromDB(db) @@ -75,7 +75,7 @@ func TestLoadPackageGraph_Etcd(t *testing.T) { require.NoError(t, err) require.Equal(t, "etcd", result.Name) - require.Equal(t, 3, len(result.Channels)) + require.Len(t, result.Channels, 3) for channelName, channel := range result.Channels { expectedChannel := expectedGraph.Channels[channelName] @@ -85,7 +85,7 @@ func TestLoadPackageGraph_Etcd(t *testing.T) { } func TestLoadPackageGraph_Etcd_NotFound(t *testing.T) { - db, cleanup := createLoadedTestDb(t) + db, cleanup := createLoadedTestDB(t) defer cleanup() graphLoader, err := NewSQLGraphLoaderFromDB(db) diff --git a/pkg/sqlite/load.go b/pkg/sqlite/load.go index f8a5a1350..9592b5f54 100644 --- a/pkg/sqlite/load.go +++ b/pkg/sqlite/load.go @@ -69,7 +69,7 @@ func (s *sqlLoader) AddOperatorBundle(bundle *registry.Bundle) error { return err } defer func() { - tx.Rollback() + _ = tx.Rollback() }() if err := s.addOperatorBundle(tx, bundle); err != nil { @@ -123,6 +123,7 @@ func (s *sqlLoader) addOperatorBundle(tx *sql.Tx, bundle *registry.Bundle) error } if substitutesFor != "" && !s.enableAlpha { + // nolint:stylecheck return fmt.Errorf("SubstitutesFor is an alpha-only feature. You must enable alpha features with the flag --enable-alpha in order to use this feature.") } @@ -162,7 +163,6 @@ func (s *sqlLoader) addOperatorBundle(tx *sql.Tx, bundle *registry.Bundle) error } func (s *sqlLoader) addSubstitutesFor(tx *sql.Tx, bundle *registry.Bundle) error { - updateBundleReplaces, err := tx.Prepare("update operatorbundle set replaces = ? where replaces = ?") if err != nil { return err @@ -205,6 +205,7 @@ func (s *sqlLoader) addSubstitutesFor(tx *sql.Tx, bundle *registry.Bundle) error if err != nil { return fmt.Errorf("failed to obtain substitutes : %s", err) } + // nolint:nestif if substitutesFor != "" { // Update any replaces that reference the substituted-for bundle _, err = updateBundleReplaces.Exec(csvName, substitutesFor) @@ -407,7 +408,7 @@ func (s *sqlLoader) AddPackageChannelsFromGraph(graph *registry.Package) error { return fmt.Errorf("unable to start a transaction: %s", err) } defer func() { - tx.Rollback() + _ = tx.Rollback() }() var errs []error @@ -507,6 +508,7 @@ func (s *sqlLoader) AddPackageChannelsFromGraph(graph *registry.Package) error { // If the number of nodes is 5 and the startDepth is 3, the expected depth is 7 (3, 4, 5, 6, 7) expectedDepth := len(channel.Nodes) + startDepth - 1 if expectedDepth != depth { + // nolint:stylecheck err := fmt.Errorf("Invalid graph: some (non-bottom) nodes defined in the graph were not mentioned as replacements of any node (%d != %d)", expectedDepth, depth) errs = append(errs, err) } @@ -533,7 +535,7 @@ func (s *sqlLoader) AddPackageChannels(manifest registry.PackageManifest) error return fmt.Errorf("unable to start a transaction: %s", err) } defer func() { - tx.Rollback() + _ = tx.Rollback() }() if err := s.rmPackage(tx, manifest.PackageName); err != nil { @@ -591,6 +593,7 @@ func (s *sqlLoader) addPackageChannels(tx *sql.Tx, manifest registry.PackageMani return fmt.Errorf("failed to add package %q: %s", manifest.PackageName, err.Error()) } + // nolint:prealloc var ( errs []error channels []registry.PackageChannel @@ -717,6 +720,7 @@ func (s *sqlLoader) addPackageChannels(tx *sql.Tx, manifest registry.PackageMani // If we find 'replaces' in the circuit list then we've seen it already, break out if _, ok := replaceCycle[replaces]; ok { + // nolint:stylecheck errs = append(errs, fmt.Errorf("Cycle detected, %s replaces %s", channelEntryCSVName, replaces)) break } @@ -732,6 +736,7 @@ func (s *sqlLoader) addPackageChannels(tx *sql.Tx, manifest registry.PackageMani break } if _, _, _, err := s.getBundleSkipsReplacesVersion(tx, replaces); err != nil { + // nolint:stylecheck errs = append(errs, fmt.Errorf("Invalid bundle %s, replaces nonexistent bundle %s", c.CurrentCSVName, replaces)) break } @@ -750,7 +755,7 @@ func (s *sqlLoader) ClearNonHeadBundles() error { return err } defer func() { - tx.Rollback() + _ = tx.Rollback() }() removeNonHeadBundles, err := tx.Prepare(` @@ -773,34 +778,37 @@ func (s *sqlLoader) ClearNonHeadBundles() error { return tx.Commit() } -func (s *sqlLoader) getBundleSkipsReplacesVersion(tx *sql.Tx, bundleName string) (replaces string, skips []string, version string, err error) { +func (s *sqlLoader) getBundleSkipsReplacesVersion(tx *sql.Tx, bundleName string) (string, []string, string, error) { getReplacesSkipsAndVersions, err := tx.Prepare(` SELECT replaces, skips, version FROM operatorbundle WHERE operatorbundle.name=? LIMIT 1`) if err != nil { - return + return "", nil, "", err } defer getReplacesSkipsAndVersions.Close() rows, rerr := getReplacesSkipsAndVersions.Query(bundleName) if err != nil { err = rerr - return + return "", nil, "", err } defer rows.Close() if !rows.Next() { err = fmt.Errorf("no bundle found for bundlename %s", bundleName) - return + return "", nil, "", err } var replacesStringSQL sql.NullString var skipsStringSQL sql.NullString var versionStringSQL sql.NullString if err = rows.Scan(&replacesStringSQL, &skipsStringSQL, &versionStringSQL); err != nil { - return + return "", nil, "", err } + var replaces string + var skips []string + var version string if replacesStringSQL.Valid { replaces = replacesStringSQL.String } @@ -811,40 +819,41 @@ func (s *sqlLoader) getBundleSkipsReplacesVersion(tx *sql.Tx, bundleName string) version = versionStringSQL.String } - return + return replaces, skips, version, nil } -func (s *sqlLoader) getBundlePathIfExists(tx *sql.Tx, bundleName string) (bundlePath string, err error) { +func (s *sqlLoader) getBundlePathIfExists(tx *sql.Tx, bundleName string) (string, error) { getBundlePath, err := tx.Prepare(` SELECT bundlepath FROM operatorbundle WHERE operatorbundle.name=? LIMIT 1`) if err != nil { - return + return "", err } defer getBundlePath.Close() rows, rerr := getBundlePath.Query(bundleName) if err != nil { err = rerr - return + return "", err } defer rows.Close() if !rows.Next() { // no bundlepath set - return + return "", nil } var bundlePathSQL sql.NullString if err = rows.Scan(&bundlePathSQL); err != nil { - return + return "", err } + var bundlePath string if bundlePathSQL.Valid { bundlePath = bundlePathSQL.String } - return + return bundlePath, nil } func (s *sqlLoader) addAPIs(tx *sql.Tx, bundle *registry.Bundle) error { @@ -950,7 +959,7 @@ func (s *sqlLoader) RemovePackage(packageName string) error { return err } defer func() { - tx.Rollback() + _ = tx.Rollback() }() csvNames, err := s.getCSVNames(tx, packageName) @@ -1059,7 +1068,7 @@ func (s *sqlLoader) AddBundlePackageChannels(manifest registry.PackageManifest, return err } defer func() { - tx.Rollback() + _ = tx.Rollback() }() if err := s.addOperatorBundle(tx, bundle); err != nil { @@ -1343,7 +1352,7 @@ type tailBundle struct { replacedBy []string // to handle any chain where a skipped entry may be a part of another channel that should not be truncated } -func getTailFromBundle(tx *sql.Tx, head string) (bundles map[string]tailBundle, err error) { +func getTailFromBundle(tx *sql.Tx, head string) (map[string]tailBundle, error) { // traverse replaces chain and collect channel list for each bundle. // This assumes that replaces chain for a bundle is the same across channels. // only real bundles with entries in the operator_bundle table are returned. @@ -1392,7 +1401,7 @@ func getTailFromBundle(tx *sql.Tx, head string) (bundles map[string]tailBundle, return nil, fmt.Errorf("could not find default channel head for %s", head) } var defaultChannelHead sql.NullString - err = row.Scan(&defaultChannelHead) + err := row.Scan(&defaultChannelHead) if err != nil { return nil, fmt.Errorf("error getting default channel head for %s: %v", head, err) } @@ -1481,7 +1490,7 @@ func (s *sqlLoader) DeprecateBundle(path string) error { return err } defer func() { - tx.Rollback() + _ = tx.Rollback() }() name, version, err := getBundleNameAndVersionForImage(tx, path) @@ -1550,7 +1559,6 @@ deprecate: if err := s.rmBundle(tx, bundle); err != nil { return err } - } // remove links to deprecated/truncated bundles to avoid regenerating these on add/overwrite _, err = tx.Exec(`UPDATE channel_entry SET replaces=NULL WHERE operatorbundle_name=?`, name) @@ -1592,7 +1600,7 @@ func (s *sqlLoader) RemoveStrandedBundles() error { return err } defer func() { - tx.Rollback() + _ = tx.Rollback() }() if err := s.rmStrandedBundles(tx); err != nil { @@ -1742,7 +1750,7 @@ func (d *DeprecationAwareLoader) clearLastDeprecatedInPackage(pkg string) error return err } defer func() { - tx.Rollback() + _ = tx.Rollback() }() // The last deprecated bundles for a package will still have "tombstone" records in channel_entry (among other tables). @@ -1770,7 +1778,7 @@ func (s sqlLoader) RemoveOverwrittenChannelHead(pkg, bundle string) error { return err } defer func() { - tx.Rollback() + _ = tx.Rollback() }() // check if bundle has anything that replaces it getBundlesThatReplaceHeadQuery := `SELECT DISTINCT operatorbundle.name AS replaces, channel_entry.channel_name @@ -1795,6 +1803,7 @@ func (s sqlLoader) RemoveOverwrittenChannelHead(pkg, bundle string) error { return err } // This is not a head bundle for all channels it is a member of. Cannot remove + // nolint: staticcheck return fmt.Errorf("cannot overwrite bundle %s from package %s: replaced by %s on channel %s", bundle, pkg, replaces.String, channel.String) } } diff --git a/pkg/sqlite/load_test.go b/pkg/sqlite/load_test.go index af289ceae..27c17c53f 100644 --- a/pkg/sqlite/load_test.go +++ b/pkg/sqlite/load_test.go @@ -129,7 +129,7 @@ func TestAddPackageChannels(t *testing.T) { for _, tt := range tests { t.Run(tt.description, func(t *testing.T) { - db, cleanup := CreateTestDb(t) + db, cleanup := CreateTestDB(t) defer cleanup() store, err := NewSQLLiteLoader(db) require.NoError(t, err) @@ -138,7 +138,7 @@ func TestAddPackageChannels(t *testing.T) { for _, bundle := range tt.fields.bundles { // Throw away any errors loading bundles (not testing this) - store.AddOperatorBundle(bundle) + _ = store.AddOperatorBundle(bundle) } for i, pkg := range tt.args.pkgs { @@ -157,7 +157,7 @@ func TestAddPackageChannels(t *testing.T) { func TestAddBundleSemver(t *testing.T) { // Create a test DB - db, cleanup := CreateTestDb(t) + db, cleanup := CreateTestDB(t) defer cleanup() store, err := NewSQLLiteLoader(db) require.NoError(t, err) @@ -210,7 +210,7 @@ func TestAddBundleSemver(t *testing.T) { if b.PackageName != "pkg-0" { continue } - require.Len(t, b.Skips, 0, "unexpected skips value(s) for bundle %q", b.CsvName) + require.Empty(t, b.Skips, "unexpected skips value(s) for bundle %q", b.CsvName) replaces[b.CsvName] = b.Replaces } require.Equal(t, map[string]string{ @@ -221,7 +221,7 @@ func TestAddBundleSemver(t *testing.T) { } func TestClearNonHeadBundles(t *testing.T) { - db, cleanup := CreateTestDb(t) + db, cleanup := CreateTestDB(t) defer cleanup() store, err := NewSQLLiteLoader(db) require.NoError(t, err) @@ -307,8 +307,8 @@ func newUnstructuredCSVWithVersion(t *testing.T, name, version string) *unstruct csv := ®istry.ClusterServiceVersion{} csv.TypeMeta.Kind = "ClusterServiceVersion" csv.SetName(name) - versionJson := fmt.Sprintf(`{"version": "%s"}`, version) - csv.Spec = json.RawMessage(versionJson) + versionJSON := fmt.Sprintf(`{"version": "%s"}`, version) + csv.Spec = json.RawMessage(versionJSON) out, err := runtime.DefaultUnstructuredConverter.ToUnstructured(csv) require.NoError(t, err) @@ -329,7 +329,7 @@ func newBundle(t *testing.T, name, pkgName string, channels []string, objs ...*u } func TestRMBundle(t *testing.T) { - db, cleanup := CreateTestDb(t) + db, cleanup := CreateTestDB(t) defer cleanup() store, err := NewSQLLiteLoader(db) require.NoError(t, err) @@ -503,7 +503,7 @@ func TestDeprecationAwareLoader(t *testing.T) { expected: expected{ err: nil, deprecated: map[string]struct{}{ - "csv-aa": struct{}{}, // csv-b remains in the deprecated table since it has been truncated and hasn't been removed + "csv-aa": {}, // csv-b remains in the deprecated table since it has been truncated and hasn't been removed }, nontruncated: map[string]struct{}{ "csv-aa:stable": {}, @@ -600,7 +600,7 @@ func TestDeprecationAwareLoader(t *testing.T) { for _, tt := range tests { t.Run(tt.description, func(t *testing.T) { - db, cleanup := CreateTestDb(t) + db, cleanup := CreateTestDB(t) defer cleanup() store, err := NewDeprecationAwareLoader(db) require.NoError(t, err) @@ -643,12 +643,11 @@ func TestDeprecationAwareLoader(t *testing.T) { delete(bundleMap, bundleName) } - require.Len(t, bundleMap, 0, "not all expected bundles exist in %s table: %v", table, bundleMap) + require.Empty(t, bundleMap, "not all expected bundles exist in %s table: %v", table, bundleMap) } checkForBundles(`SELECT operatorbundle_name FROM deprecated`, "deprecated", tt.expected.deprecated) // operatorbundle_name:<channel list> checkForBundles(`SELECT name||":"|| coalesce(group_concat(distinct channel_name), "") FROM (SELECT name, channel_name from operatorbundle left outer join channel_entry on name=operatorbundle_name order by channel_name) group by name`, "operatorbundle", tt.expected.nontruncated) - }) } } @@ -869,7 +868,7 @@ func TestGetTailFromBundle(t *testing.T) { for _, tt := range tests { t.Run(tt.description, func(t *testing.T) { - db, cleanup := CreateTestDb(t) + db, cleanup := CreateTestDB(t) defer cleanup() store, err := NewSQLLiteLoader(db) require.NoError(t, err) @@ -993,7 +992,7 @@ func TestAddBundlePropertiesFromAnnotations(t *testing.T) { }, } { t.Run(tt.description, func(t *testing.T) { - db, cleanup := CreateTestDb(t) + db, cleanup := CreateTestDB(t) defer cleanup() s, err := NewSQLLiteLoader(db) @@ -1211,7 +1210,7 @@ func TestRemoveOverwrittenChannelHead(t *testing.T) { } for _, tt := range tests { t.Run(tt.description, func(t *testing.T) { - db, cleanup := CreateTestDb(t) + db, cleanup := CreateTestDB(t) defer cleanup() store, err := NewSQLLiteLoader(db) require.NoError(t, err) @@ -1220,12 +1219,12 @@ func TestRemoveOverwrittenChannelHead(t *testing.T) { for _, bundle := range tt.fields.bundles { // Throw away any errors loading bundles (not testing this) - store.AddOperatorBundle(bundle) + _ = store.AddOperatorBundle(bundle) } for _, pkg := range tt.fields.pkgs { // Throw away any errors loading packages (not testing this) - store.AddPackageChannels(pkg) + _ = store.AddPackageChannels(pkg) } getDefaultChannel := func(pkg string) sql.NullString { diff --git a/pkg/sqlite/loadprocs.go b/pkg/sqlite/loadprocs.go index 0196064d6..218f2cda1 100644 --- a/pkg/sqlite/loadprocs.go +++ b/pkg/sqlite/loadprocs.go @@ -41,6 +41,7 @@ func addReplaces(tx *sql.Tx, replacesID, entryID int64) error { return nil } +// nolint:unused func addPackage(tx *sql.Tx, packageName string) error { addPackage, err := tx.Prepare("insert into package(name) values(?)") if err != nil { @@ -71,6 +72,7 @@ func addPackageIfNotExists(tx *sql.Tx, packageName string) error { return nil } +// nolint:unused func addChannel(tx *sql.Tx, channelName, packageName, headCsvName string) error { addChannel, err := tx.Prepare("insert into channel(name, package_name, head_operatorbundle_name) values(?, ?, ?)") if err != nil { @@ -86,6 +88,7 @@ func addChannel(tx *sql.Tx, channelName, packageName, headCsvName string) error return nil } +// nolint:unused func updateChannel(tx *sql.Tx, channelName, packageName, headCsvName string) error { updateChannel, err := tx.Prepare("update channel set head_operatorbundle_name = ? where name = ? and package_name = ?") if err != nil { @@ -96,7 +99,6 @@ func updateChannel(tx *sql.Tx, channelName, packageName, headCsvName string) err _, err = updateChannel.Exec(channelName, packageName, headCsvName) if err != nil { return fmt.Errorf("failed to update channel (%s) for package (%s) with head (%s) : %s", channelName, packageName, headCsvName, err) - } return nil diff --git a/pkg/sqlite/migrations/001_related_images.go b/pkg/sqlite/migrations/001_related_images.go index 3b3c8c36b..e4511bfb2 100644 --- a/pkg/sqlite/migrations/001_related_images.go +++ b/pkg/sqlite/migrations/001_related_images.go @@ -45,25 +45,25 @@ func getCSV(ctx context.Context, tx *sql.Tx, name string) (*registry.ClusterServ return nil, err } - var csvJson sql.NullString + var csvJSON sql.NullString if !rows.Next() { return nil, fmt.Errorf("bundle %s not found", name) } - if err := rows.Scan(&csvJson); err != nil { + if err := rows.Scan(&csvJSON); err != nil { return nil, err } - if !csvJson.Valid { + if !csvJSON.Valid { return nil, fmt.Errorf("bad value for csv") } csv := ®istry.ClusterServiceVersion{} - if err := json.Unmarshal([]byte(csvJson.String), csv); err != nil { + if err := json.Unmarshal([]byte(csvJSON.String), csv); err != nil { return nil, err } return csv, nil } func extractRelatedImages(ctx context.Context, tx *sql.Tx, name string) error { - addSql := `insert into related_image(image, operatorbundle_name) values(?,?)` + addSQL := `insert into related_image(image, operatorbundle_name) values(?,?)` csv, err := getCSV(ctx, tx, name) if err != nil { logrus.Warnf("error backfilling related images: %v", err) @@ -83,7 +83,7 @@ func extractRelatedImages(ctx context.Context, tx *sql.Tx, name string) error { images[k] = struct{}{} } for img := range images { - if _, err := tx.ExecContext(ctx, addSql, img, name); err != nil { + if _, err := tx.ExecContext(ctx, addSQL, img, name); err != nil { logrus.Warnf("error backfilling related images: %v", err) continue } @@ -101,7 +101,7 @@ var relatedImagesMigration = &Migration{ FOREIGN KEY(operatorbundle_name) REFERENCES operatorbundle(name) ); ` - _, err := tx.ExecContext(ctx, sql) + _, _ = tx.ExecContext(ctx, sql) bundles, err := listBundles(ctx, tx) if err != nil { diff --git a/pkg/sqlite/migrations/001_related_images_test.go b/pkg/sqlite/migrations/001_related_images_test.go index 495c7b46f..c9336cf9b 100644 --- a/pkg/sqlite/migrations/001_related_images_test.go +++ b/pkg/sqlite/migrations/001_related_images_test.go @@ -2,12 +2,13 @@ package migrations_test import ( "context" + "crypto/rand" "database/sql" "fmt" - "math/rand" + "math" + "math/big" "os" "testing" - "time" "github.com/sirupsen/logrus" "github.com/stretchr/testify/require" @@ -16,12 +17,11 @@ import ( "github.com/operator-framework/operator-registry/pkg/sqlite/migrations" ) -func init() { - rand.Seed(time.Now().UTC().UnixNano()) -} +func CreateTestDBAt(t *testing.T, key int) (*sql.DB, sqlite.Migrator, func()) { + r, err := rand.Int(rand.Reader, big.NewInt(math.MaxInt64)) + require.NoError(t, err) -func CreateTestDbAt(t *testing.T, key int) (*sql.DB, sqlite.Migrator, func()) { - dbName := fmt.Sprintf("%d.db", rand.Int()) + dbName := fmt.Sprintf("%d.db", r) logrus.SetLevel(logrus.DebugLevel) db, err := sqlite.Open(dbName) @@ -48,7 +48,7 @@ func CreateTestDbAt(t *testing.T, key int) (*sql.DB, sqlite.Migrator, func()) { func TestRelatedImagesUp(t *testing.T) { // migrate up to, but not including, this migration - db, migrator, cleanup := CreateTestDbAt(t, migrations.RelatedImagesMigrationKey-1) + db, migrator, cleanup := CreateTestDBAt(t, migrations.RelatedImagesMigrationKey-1) defer cleanup() // Add a test bundle without extracting related_images @@ -78,7 +78,7 @@ func TestRelatedImagesUp(t *testing.T) { } func TestRelatedImagesDown(t *testing.T) { - db, migrator, cleanup := CreateTestDbAt(t, migrations.RelatedImagesMigrationKey) + db, migrator, cleanup := CreateTestDBAt(t, migrations.RelatedImagesMigrationKey) defer cleanup() // Add a test bundle that has related images diff --git a/pkg/sqlite/migrations/002_bundle_path_test.go b/pkg/sqlite/migrations/002_bundle_path_test.go index cd63c0298..cf081a86a 100644 --- a/pkg/sqlite/migrations/002_bundle_path_test.go +++ b/pkg/sqlite/migrations/002_bundle_path_test.go @@ -4,13 +4,14 @@ import ( "context" "testing" + "github.com/stretchr/testify/require" + "github.com/operator-framework/operator-registry/pkg/sqlite" "github.com/operator-framework/operator-registry/pkg/sqlite/migrations" - "github.com/stretchr/testify/require" ) func TestBundlePathUp(t *testing.T) { - db, migrator, cleanup := CreateTestDbAt(t, migrations.BundlePathMigrationKey-1) + db, migrator, cleanup := CreateTestDBAt(t, migrations.BundlePathMigrationKey-1) defer cleanup() err := migrator.Up(context.TODO(), migrations.Only(migrations.BundlePathMigrationKey)) @@ -18,27 +19,29 @@ func TestBundlePathUp(t *testing.T) { // Adding row with bundlepath colum should not fail after migrating up tx, err := db.Begin() + require.NoError(t, err) stmt, err := tx.Prepare("insert into operatorbundle(name, csv, bundle, bundlepath) values(?, ?, ?, ?)") require.NoError(t, err) defer stmt.Close() _, err = stmt.Exec("testName", "testCSV", "testBundle", "quay.io/test") require.NoError(t, err) - } func TestBundlePathDown(t *testing.T) { - db, migrator, cleanup := CreateTestDbAt(t, migrations.BundlePathMigrationKey) + db, migrator, cleanup := CreateTestDBAt(t, migrations.BundlePathMigrationKey) defer cleanup() querier := sqlite.NewSQLLiteQuerierFromDb(db) imagesBeforeMigration, err := querier.GetImagesForBundle(context.TODO(), "etcdoperator.v0.6.1") + require.NoError(t, err) err = migrator.Down(context.TODO(), migrations.Only(migrations.BundlePathMigrationKey)) require.NoError(t, err) imagesAfterMigration, err := querier.GetImagesForBundle(context.TODO(), "etcdoperator.v0.6.1") + require.NoError(t, err) - // Migrating down entails sensitive operations. Ensure data is preserved accross down migration + // Migrating down entails sensitive operations. Ensure data is preserved across down migration require.Equal(t, len(imagesBeforeMigration), len(imagesAfterMigration)) } diff --git a/pkg/sqlite/migrations/003_required_apis.go b/pkg/sqlite/migrations/003_required_apis.go index 0253c5119..f25d285ab 100644 --- a/pkg/sqlite/migrations/003_required_apis.go +++ b/pkg/sqlite/migrations/003_required_apis.go @@ -9,14 +9,15 @@ import ( "github.com/sirupsen/logrus" ) +// nolint:stylecheck const RequiredApiMigrationKey = 3 // Register this migration func init() { - registerMigration(RequiredApiMigrationKey, requiredApiMigration) + registerMigration(RequiredApiMigrationKey, requiredAPIMigration) } -var requiredApiMigration = &Migration{ +var requiredAPIMigration = &Migration{ Id: RequiredApiMigrationKey, Up: func(ctx context.Context, tx *sql.Tx) error { sql := ` @@ -37,8 +38,8 @@ var requiredApiMigration = &Migration{ if err != nil { return err } - for entryId, bundle := range bundles { - if err := extractRequiredApis(ctx, tx, entryId, bundle); err != nil { + for entryID, bundle := range bundles { + if err := extractRequiredApis(ctx, tx, entryID, bundle); err != nil { logrus.Warnf("error backfilling required apis: %v", err) continue } @@ -67,20 +68,20 @@ func getChannelEntryBundles(ctx context.Context, tx *sql.Tx) (map[int64]string, entries := map[int64]string{} for rows.Next() { - var entryId sql.NullInt64 + var entryID sql.NullInt64 var name sql.NullString - if err = rows.Scan(&entryId, &name); err != nil { + if err = rows.Scan(&entryID, &name); err != nil { return nil, err } - if !entryId.Valid || !name.Valid { + if !entryID.Valid || !name.Valid { continue } - entries[entryId.Int64] = name.String + entries[entryID.Int64] = name.String } return entries, nil } -func extractRequiredApis(ctx context.Context, tx *sql.Tx, entryId int64, name string) error { +func extractRequiredApis(ctx context.Context, tx *sql.Tx, entryID int64, name string) error { addAPI, err := tx.Prepare("insert or replace into api(group_name, version, kind, plural) values(?, ?, ?, ?)") if err != nil { return err @@ -91,12 +92,12 @@ func extractRequiredApis(ctx context.Context, tx *sql.Tx, entryId int64, name st } }() - addApiRequirer, err := tx.Prepare("insert into api_requirer(group_name, version, kind, channel_entry_id) values(?, ?, ?, ?)") + addAPIRequirer, err := tx.Prepare("insert into api_requirer(group_name, version, kind, channel_entry_id) values(?, ?, ?, ?)") if err != nil { return err } defer func() { - if err := addApiRequirer.Close(); err != nil { + if err := addAPIRequirer.Close(); err != nil { logrus.WithError(err).Warningf("error closing prepared statement") } }() @@ -107,7 +108,7 @@ func extractRequiredApis(ctx context.Context, tx *sql.Tx, entryId int64, name st return err } - _, requiredCRDs, err := csv.GetCustomResourceDefintions() + _, requiredCRDs, _ := csv.GetCustomResourceDefintions() for _, crd := range requiredCRDs { plural, group, err := SplitCRDName(crd.Name) if err != nil { @@ -116,17 +117,17 @@ func extractRequiredApis(ctx context.Context, tx *sql.Tx, entryId int64, name st if _, err := addAPI.Exec(group, crd.Version, crd.Kind, plural); err != nil { return err } - if _, err := addApiRequirer.Exec(group, crd.Version, crd.Kind, entryId); err != nil { + if _, err := addAPIRequirer.Exec(group, crd.Version, crd.Kind, entryID); err != nil { return err } } - _, requiredAPIs, err := csv.GetApiServiceDefinitions() + _, requiredAPIs, _ := csv.GetApiServiceDefinitions() for _, api := range requiredAPIs { if _, err := addAPI.Exec(api.Group, api.Version, api.Kind, api.Name); err != nil { return err } - if _, err := addApiRequirer.Exec(api.Group, api.Version, api.Kind, entryId); err != nil { + if _, err := addAPIRequirer.Exec(api.Group, api.Version, api.Kind, entryID); err != nil { return err } } @@ -134,14 +135,13 @@ func extractRequiredApis(ctx context.Context, tx *sql.Tx, entryId int64, name st return nil } -func SplitCRDName(crdName string) (plural, group string, err error) { +func SplitCRDName(crdName string) (string, string, error) { + var err error pluralGroup := strings.SplitN(crdName, ".", 2) if len(pluralGroup) != 2 { err = fmt.Errorf("can't split bad CRD name %s", crdName) - return + return "", "", err } - plural = pluralGroup[0] - group = pluralGroup[1] - return + return pluralGroup[0], pluralGroup[1], nil } diff --git a/pkg/sqlite/migrations/003_required_apis_test.go b/pkg/sqlite/migrations/003_required_apis_test.go index 6d464160f..415315160 100644 --- a/pkg/sqlite/migrations/003_required_apis_test.go +++ b/pkg/sqlite/migrations/003_required_apis_test.go @@ -12,7 +12,7 @@ import ( func TestRequiredApisUp(t *testing.T) { // migrate up to, but not including, this migration - db, migrator, cleanup := CreateTestDbAt(t, migrations.RequiredApiMigrationKey-1) + db, migrator, cleanup := CreateTestDBAt(t, migrations.RequiredApiMigrationKey-1) defer cleanup() _, err := db.Exec(`PRAGMA foreign_keys = 0`) @@ -54,15 +54,15 @@ func TestRequiredApisUp(t *testing.T) { var plural sql.NullString rows.Next() require.NoError(t, rows.Scan(&group, &version, &kind, &plural)) - require.Equal(t, group.String, "etcd.database.coreos.com") - require.Equal(t, version.String, "v1beta2") - require.Equal(t, kind.String, "EtcdCluster") - require.Equal(t, plural.String, "etcdclusters") + require.Equal(t, "etcd.database.coreos.com", group.String) + require.Equal(t, "v1beta2", version.String) + require.Equal(t, "EtcdCluster", kind.String) + require.Equal(t, "etcdclusters", plural.String) require.NoError(t, rows.Close()) } func TestRequiredApisDown(t *testing.T) { - db, migrator, cleanup := CreateTestDbAt(t, migrations.RequiredApiMigrationKey) + db, migrator, cleanup := CreateTestDBAt(t, migrations.RequiredApiMigrationKey) defer cleanup() // Add a required api @@ -86,10 +86,10 @@ func TestRequiredApisDown(t *testing.T) { var plural sql.NullString rows.Next() require.NoError(t, rows.Scan(&group, &version, &kind, &plural)) - require.Equal(t, group.String, "etcd.database.coreos.com") - require.Equal(t, version.String, "v1beta2") - require.Equal(t, kind.String, "EtcdCluster") - require.Equal(t, plural.String, "etcdclusters") + require.Equal(t, "etcd.database.coreos.com", group.String) + require.Equal(t, "v1beta2", version.String) + require.Equal(t, "EtcdCluster", kind.String) + require.Equal(t, "etcdclusters", plural.String) require.NoError(t, rows.Close()) // run down migration diff --git a/pkg/sqlite/migrations/004_cascade_delete_test.go b/pkg/sqlite/migrations/004_cascade_delete_test.go index 7193568a0..bc2bb7398 100644 --- a/pkg/sqlite/migrations/004_cascade_delete_test.go +++ b/pkg/sqlite/migrations/004_cascade_delete_test.go @@ -13,19 +13,18 @@ import ( func TestBeforeCascadeDeleteUp(t *testing.T) { // migrate up to, but not including, this migration - db, _, cleanup := CreateTestDbAt(t, migrations.CascadeDeleteMigrationKey-1) + db, _, cleanup := CreateTestDBAt(t, migrations.CascadeDeleteMigrationKey-1) defer cleanup() tx, err := db.Begin() require.NoError(t, err) - err = checkMigrationInPreviousState(t, tx) - require.NoError(t, err) + checkMigrationInPreviousState(t, tx) } func TestAfterCascadeDeleteUp(t *testing.T) { // migrate up to, but not including, this migration - db, migrator, cleanup := CreateTestDbAt(t, migrations.CascadeDeleteMigrationKey-1) + db, migrator, cleanup := CreateTestDBAt(t, migrations.CascadeDeleteMigrationKey-1) defer cleanup() // run up migration @@ -35,23 +34,21 @@ func TestAfterCascadeDeleteUp(t *testing.T) { tx, err := db.Begin() require.NoError(t, err) - err = checkMigrationInNextState(t, tx) - require.NoError(t, err) + checkMigrationInNextState(t, tx) } func TestBeforeCascadeDeleteDown(t *testing.T) { - db, _, cleanup := CreateTestDbAt(t, migrations.CascadeDeleteMigrationKey) + db, _, cleanup := CreateTestDBAt(t, migrations.CascadeDeleteMigrationKey) defer cleanup() tx, err := db.Begin() require.NoError(t, err) - err = checkMigrationInNextState(t, tx) - require.NoError(t, err) + checkMigrationInNextState(t, tx) } func TestAferCascadeDeleteDown(t *testing.T) { - db, migrator, cleanup := CreateTestDbAt(t, migrations.CascadeDeleteMigrationKey) + db, migrator, cleanup := CreateTestDBAt(t, migrations.CascadeDeleteMigrationKey) defer cleanup() // run down migration @@ -61,8 +58,7 @@ func TestAferCascadeDeleteDown(t *testing.T) { tx, err := db.Begin() require.NoError(t, err) - err = checkMigrationInPreviousState(t, tx) - require.NoError(t, err) + checkMigrationInPreviousState(t, tx) } func removeWhiteSpaces(s string) string { @@ -73,7 +69,7 @@ func removeWhiteSpaces(s string) string { return s } -func checkMigrationInPreviousState(t *testing.T, tx *sql.Tx) error { +func checkMigrationInPreviousState(t *testing.T, tx *sql.Tx) { getCreateTableStatement := func(table string) string { return `SELECT sql FROM sqlite_master where name="` + table + `"` } @@ -130,6 +126,7 @@ func checkMigrationInPreviousState(t *testing.T, tx *sql.Tx) error { var createStatement string table, err := tx.Query(getCreateTableStatement("operatorbundle")) + require.NoError(t, err) hasRows := table.Next() require.True(t, hasRows) err = table.Scan(&createStatement) @@ -139,6 +136,7 @@ func checkMigrationInPreviousState(t *testing.T, tx *sql.Tx) error { require.NoError(t, err) table, err = tx.Query(getCreateTableStatement("package")) + require.NoError(t, err) hasRows = table.Next() require.True(t, hasRows) err = table.Scan(&createStatement) @@ -148,6 +146,7 @@ func checkMigrationInPreviousState(t *testing.T, tx *sql.Tx) error { require.NoError(t, err) table, err = tx.Query(getCreateTableStatement("channel")) + require.NoError(t, err) hasRows = table.Next() require.True(t, hasRows) err = table.Scan(&createStatement) @@ -157,6 +156,7 @@ func checkMigrationInPreviousState(t *testing.T, tx *sql.Tx) error { require.NoError(t, err) table, err = tx.Query(getCreateTableStatement("channel_entry")) + require.NoError(t, err) hasRows = table.Next() require.True(t, hasRows) err = table.Scan(&createStatement) @@ -166,6 +166,7 @@ func checkMigrationInPreviousState(t *testing.T, tx *sql.Tx) error { require.NoError(t, err) table, err = tx.Query(getCreateTableStatement("api_requirer")) + require.NoError(t, err) hasRows = table.Next() require.True(t, hasRows) err = table.Scan(&createStatement) @@ -175,6 +176,7 @@ func checkMigrationInPreviousState(t *testing.T, tx *sql.Tx) error { require.NoError(t, err) table, err = tx.Query(getCreateTableStatement("api_provider")) + require.NoError(t, err) hasRows = table.Next() require.True(t, hasRows) err = table.Scan(&createStatement) @@ -184,6 +186,7 @@ func checkMigrationInPreviousState(t *testing.T, tx *sql.Tx) error { require.NoError(t, err) table, err = tx.Query(getCreateTableStatement("related_image")) + require.NoError(t, err) hasRows = table.Next() require.True(t, hasRows) err = table.Scan(&createStatement) @@ -191,11 +194,9 @@ func checkMigrationInPreviousState(t *testing.T, tx *sql.Tx) error { require.Equal(t, removeWhiteSpaces(createNewRelatedImageTable), removeWhiteSpaces(createStatement)) err = table.Close() require.NoError(t, err) - - return nil } -func checkMigrationInNextState(t *testing.T, tx *sql.Tx) error { +func checkMigrationInNextState(t *testing.T, tx *sql.Tx) { getCreateTableStatement := func(table string) string { return `SELECT sql FROM sqlite_master where name="` + table + `"` } @@ -252,6 +253,7 @@ func checkMigrationInNextState(t *testing.T, tx *sql.Tx) error { var createStatement string table, err := tx.Query(getCreateTableStatement("operatorbundle")) + require.NoError(t, err) hasRows := table.Next() require.True(t, hasRows) err = table.Scan(&createStatement) @@ -261,6 +263,7 @@ func checkMigrationInNextState(t *testing.T, tx *sql.Tx) error { require.NoError(t, err) table, err = tx.Query(getCreateTableStatement("package")) + require.NoError(t, err) hasRows = table.Next() require.True(t, hasRows) err = table.Scan(&createStatement) @@ -270,6 +273,7 @@ func checkMigrationInNextState(t *testing.T, tx *sql.Tx) error { require.NoError(t, err) table, err = tx.Query(getCreateTableStatement("channel")) + require.NoError(t, err) hasRows = table.Next() require.True(t, hasRows) err = table.Scan(&createStatement) @@ -279,6 +283,7 @@ func checkMigrationInNextState(t *testing.T, tx *sql.Tx) error { require.NoError(t, err) table, err = tx.Query(getCreateTableStatement("channel_entry")) + require.NoError(t, err) hasRows = table.Next() require.True(t, hasRows) err = table.Scan(&createStatement) @@ -288,6 +293,7 @@ func checkMigrationInNextState(t *testing.T, tx *sql.Tx) error { require.NoError(t, err) table, err = tx.Query(getCreateTableStatement("api_requirer")) + require.NoError(t, err) hasRows = table.Next() require.True(t, hasRows) err = table.Scan(&createStatement) @@ -297,6 +303,7 @@ func checkMigrationInNextState(t *testing.T, tx *sql.Tx) error { require.NoError(t, err) table, err = tx.Query(getCreateTableStatement("api_provider")) + require.NoError(t, err) hasRows = table.Next() require.True(t, hasRows) err = table.Scan(&createStatement) @@ -306,6 +313,7 @@ func checkMigrationInNextState(t *testing.T, tx *sql.Tx) error { require.NoError(t, err) table, err = tx.Query(getCreateTableStatement("related_image")) + require.NoError(t, err) hasRows = table.Next() require.True(t, hasRows) err = table.Scan(&createStatement) @@ -313,6 +321,4 @@ func checkMigrationInNextState(t *testing.T, tx *sql.Tx) error { require.Equal(t, removeWhiteSpaces(createNewRelatedImageTable), removeWhiteSpaces(createStatement)) err = table.Close() require.NoError(t, err) - - return nil } diff --git a/pkg/sqlite/migrations/005_version_skiprange.go b/pkg/sqlite/migrations/005_version_skiprange.go index 60b3c87ad..6a825debc 100644 --- a/pkg/sqlite/migrations/005_version_skiprange.go +++ b/pkg/sqlite/migrations/005_version_skiprange.go @@ -75,7 +75,7 @@ var versionSkipRangeMigration = &Migration{ } func extractVersioning(ctx context.Context, tx *sql.Tx, name string) error { - addSql := `insert into operatorbundle(version, skiprange) values(?,?)` + addSQL := `insert into operatorbundle(version, skiprange) values(?,?)` csv, err := getCSV(ctx, tx, name) if err != nil { logrus.Warnf("error backfilling versioning: %v", err) @@ -89,6 +89,6 @@ func extractVersioning(ctx context.Context, tx *sql.Tx, name string) error { if err != nil { version = "" } - _, err = tx.ExecContext(ctx, addSql, version, skiprange) + _, err = tx.ExecContext(ctx, addSQL, version, skiprange) return err } diff --git a/pkg/sqlite/migrations/005_version_skiprange_test.go b/pkg/sqlite/migrations/005_version_skiprange_test.go index 6e4bf1423..01e168497 100644 --- a/pkg/sqlite/migrations/005_version_skiprange_test.go +++ b/pkg/sqlite/migrations/005_version_skiprange_test.go @@ -11,7 +11,7 @@ import ( ) func TestVersioningUp(t *testing.T) { - db, migrator, cleanup := CreateTestDbAt(t, migrations.VersionSkipRangeMigrationKey-1) + db, migrator, cleanup := CreateTestDBAt(t, migrations.VersionSkipRangeMigrationKey-1) defer cleanup() err := migrator.Up(context.TODO(), migrations.Only(migrations.VersionSkipRangeMigrationKey)) @@ -29,7 +29,7 @@ func TestVersioningUp(t *testing.T) { } func TestVersioningDown(t *testing.T) { - db, migrator, cleanup := CreateTestDbAt(t, migrations.VersionSkipRangeMigrationKey) + db, migrator, cleanup := CreateTestDBAt(t, migrations.VersionSkipRangeMigrationKey) defer cleanup() // Add a bundle without extracting required_apis @@ -57,11 +57,11 @@ func TestVersioningDown(t *testing.T) { var skipRange sql.NullString rows.Next() require.NoError(t, rows.Scan(&name, &csv, &bundle, &version, &skipRange)) - require.Equal(t, name.String, "etcdoperator.v0.6.1") + require.Equal(t, "etcdoperator.v0.6.1", name.String) require.Equal(t, csv.String, testCSV) require.Equal(t, bundle.String, testBundle) - require.Equal(t, version.String, "0.6.1") - require.Equal(t, skipRange.String, ">0.5.0 <0.6.1") + require.Equal(t, "0.6.1", version.String) + require.Equal(t, ">0.5.0 <0.6.1", skipRange.String) require.NoError(t, rows.Close()) // run down migration @@ -73,7 +73,7 @@ func TestVersioningDown(t *testing.T) { require.NoError(t, err) rows.Next() require.NoError(t, rows.Scan(&name, &csv, &bundle)) - require.Equal(t, name.String, "etcdoperator.v0.6.1") + require.Equal(t, "etcdoperator.v0.6.1", name.String) require.Equal(t, csv.String, testCSV) require.Equal(t, bundle.String, testBundle) require.NoError(t, rows.Close()) diff --git a/pkg/sqlite/migrations/006_associate_apis_with_bundle.go b/pkg/sqlite/migrations/006_associate_apis_with_bundle.go index f70436f1d..0e57e67fc 100644 --- a/pkg/sqlite/migrations/006_associate_apis_with_bundle.go +++ b/pkg/sqlite/migrations/006_associate_apis_with_bundle.go @@ -11,7 +11,7 @@ const AssociateApisWithBundleMigrationKey = 6 // Register this migration func init() { - registerMigration(AssociateApisWithBundleMigrationKey, bundleApiMigration) + registerMigration(AssociateApisWithBundleMigrationKey, bundleAPIMigration) } // This migration moves the link between the provided and required apis table from the channel_entry to the @@ -24,7 +24,7 @@ func init() { // api_provider: FOREIGN KEY(operatorbundle_name, operatorbundle_version, operatorbundle_path) REFERENCES operatorbundle(name, version, bundlepath), // api_requirer: FOREIGN KEY(operatorbundle_name, operatorbundle_version, operatorbundle_path) REFERENCES operatorbundle(name, version, bundlepath), -var bundleApiMigration = &Migration{ +var bundleAPIMigration = &Migration{ Id: AssociateApisWithBundleMigrationKey, Up: func(ctx context.Context, tx *sql.Tx) error { createNew := ` diff --git a/pkg/sqlite/migrations/006_associate_apis_with_bundle_test.go b/pkg/sqlite/migrations/006_associate_apis_with_bundle_test.go index 977009597..bd815ad1a 100644 --- a/pkg/sqlite/migrations/006_associate_apis_with_bundle_test.go +++ b/pkg/sqlite/migrations/006_associate_apis_with_bundle_test.go @@ -6,15 +6,14 @@ import ( "fmt" "testing" - "github.com/operator-framework/operator-registry/pkg/registry" - "github.com/stretchr/testify/require" + "github.com/operator-framework/operator-registry/pkg/registry" "github.com/operator-framework/operator-registry/pkg/sqlite/migrations" ) func TestAssociateApisWithBundleUp(t *testing.T) { - db, migrator, cleanup := CreateTestDbAt(t, migrations.AssociateApisWithBundleMigrationKey-1) + db, migrator, cleanup := CreateTestDBAt(t, migrations.AssociateApisWithBundleMigrationKey-1) defer cleanup() _, err := db.Exec(`PRAGMA foreign_keys = 0`) @@ -33,7 +32,7 @@ func TestAssociateApisWithBundleUp(t *testing.T) { require.NoError(t, err) result, err := tx.Exec("insert into channel_entry(channel_name, package_name, operatorbundle_name, depth) values(?, ?, ?, ?)", "alpha", "etcd", "etcdoperator.v0.6.1", 0) require.NoError(t, err) - entry_id, err := result.LastInsertId() + entryID, err := result.LastInsertId() require.NoError(t, err) _, err = tx.Exec("insert into api(group_name, version, kind, plural) values(?, ?, ?, ?)", "etcd.database.coreos.com", "v1alpha1", "EtcdClusters", "etcdclusters") require.NoError(t, err) @@ -41,11 +40,11 @@ func TestAssociateApisWithBundleUp(t *testing.T) { require.NoError(t, err) _, err = tx.Exec("insert into api(group_name, version, kind, plural) values(?, ?, ?, ?)", "etcd.database.coreos.com", "v1alpha1", "EtcdRestores", "etcdrestores") require.NoError(t, err) - _, err = tx.Exec("insert into api_provider(group_name, version, kind, channel_entry_id) values(?, ?, ?, ?)", "etcd.database.coreos.com", "v1alpha1", "EtcdClusters", entry_id) + _, err = tx.Exec("insert into api_provider(group_name, version, kind, channel_entry_id) values(?, ?, ?, ?)", "etcd.database.coreos.com", "v1alpha1", "EtcdClusters", entryID) require.NoError(t, err) - _, err = tx.Exec("insert into api_provider(group_name, version, kind, channel_entry_id) values(?, ?, ?, ?)", "etcd.database.coreos.com", "v1alpha1", "EtcdBackups", entry_id) + _, err = tx.Exec("insert into api_provider(group_name, version, kind, channel_entry_id) values(?, ?, ?, ?)", "etcd.database.coreos.com", "v1alpha1", "EtcdBackups", entryID) require.NoError(t, err) - _, err = tx.Exec("insert into api_provider(group_name, version, kind, channel_entry_id) values(?, ?, ?, ?)", "etcd.database.coreos.com", "v1alpha1", "EtcdRestores", entry_id) + _, err = tx.Exec("insert into api_provider(group_name, version, kind, channel_entry_id) values(?, ?, ?, ?)", "etcd.database.coreos.com", "v1alpha1", "EtcdRestores", entryID) require.NoError(t, err) require.NoError(t, tx.Commit()) _, err = db.Exec(`PRAGMA foreign_keys = 1`) @@ -71,7 +70,7 @@ func TestAssociateApisWithBundleUp(t *testing.T) { } func TestAssociateApisWithBundleDown(t *testing.T) { - db, migrator, cleanup := CreateTestDbAt(t, migrations.AssociateApisWithBundleMigrationKey) + db, migrator, cleanup := CreateTestDBAt(t, migrations.AssociateApisWithBundleMigrationKey) defer cleanup() _, err := db.Exec(`PRAGMA foreign_keys = 0`) @@ -107,6 +106,7 @@ func TestAssociateApisWithBundleDown(t *testing.T) { require.NoError(t, err) entriesBeforeMigration, err := newGetChannelEntriesThatProvide(db, "etcd.database.coreos.com", "v1alpha1", "EtcdRestores") + require.NoError(t, err) err = migrator.Down(context.TODO(), migrations.Only(migrations.AssociateApisWithBundleMigrationKey)) require.NoError(t, err) @@ -114,11 +114,11 @@ func TestAssociateApisWithBundleDown(t *testing.T) { entriesAfterMigration, err := oldGetChannelEntriesThatProvide(db, "etcd.database.coreos.com", "v1alpha1", "EtcdRestores") require.NoError(t, err) - // Migrating down entails sensitive operations. Ensure data is preserved accross down migration + // Migrating down entails sensitive operations. Ensure data is preserved across down migration require.EqualValues(t, entriesBeforeMigration, entriesAfterMigration) } -func oldGetChannelEntriesThatProvide(db *sql.DB, group, version, kind string) (entries []*registry.ChannelEntry, err error) { +func oldGetChannelEntriesThatProvide(db *sql.DB, group, version, kind string) ([]*registry.ChannelEntry, error) { query := `SELECT DISTINCT channel_entry.package_name, channel_entry.channel_name, channel_entry.operatorbundle_name, replaces.operatorbundle_name FROM channel_entry INNER JOIN api_provider ON channel_entry.entry_id = api_provider.channel_entry_id @@ -127,11 +127,11 @@ func oldGetChannelEntriesThatProvide(db *sql.DB, group, version, kind string) (e rows, err := db.Query(query, group, version, kind) if err != nil { - return + return nil, err } defer rows.Close() - entries = []*registry.ChannelEntry{} + var entries = []*registry.ChannelEntry{} for rows.Next() { var pkgNameSQL sql.NullString @@ -139,7 +139,7 @@ func oldGetChannelEntriesThatProvide(db *sql.DB, group, version, kind string) (e var bundleNameSQL sql.NullString var replacesSQL sql.NullString if err = rows.Scan(&pkgNameSQL, &channelNameSQL, &bundleNameSQL, &replacesSQL); err != nil { - return + return nil, err } entries = append(entries, ®istry.ChannelEntry{ @@ -151,12 +151,12 @@ func oldGetChannelEntriesThatProvide(db *sql.DB, group, version, kind string) (e } if len(entries) == 0 { err = fmt.Errorf("no channel entries found that provide %s %s %s", group, version, kind) - return + return nil, err } - return + return entries, nil } -func newGetChannelEntriesThatProvide(db *sql.DB, group, version, kind string) (entries []*registry.ChannelEntry, err error) { +func newGetChannelEntriesThatProvide(db *sql.DB, group, version, kind string) ([]*registry.ChannelEntry, error) { query := `SELECT DISTINCT channel_entry.package_name, channel_entry.channel_name, channel_entry.operatorbundle_name, replaces.operatorbundle_name FROM channel_entry INNER JOIN api_provider ON channel_entry.operatorbundle_name = api_provider.operatorbundle_name @@ -165,11 +165,11 @@ func newGetChannelEntriesThatProvide(db *sql.DB, group, version, kind string) (e rows, err := db.Query(query, group, version, kind) if err != nil { - return + return nil, err } defer rows.Close() - entries = []*registry.ChannelEntry{} + var entries = []*registry.ChannelEntry{} for rows.Next() { var pkgNameSQL sql.NullString @@ -177,7 +177,7 @@ func newGetChannelEntriesThatProvide(db *sql.DB, group, version, kind string) (e var bundleNameSQL sql.NullString var replacesSQL sql.NullString if err = rows.Scan(&pkgNameSQL, &channelNameSQL, &bundleNameSQL, &replacesSQL); err != nil { - return + return nil, err } entries = append(entries, ®istry.ChannelEntry{ @@ -189,7 +189,7 @@ func newGetChannelEntriesThatProvide(db *sql.DB, group, version, kind string) (e } if len(entries) == 0 { err = fmt.Errorf("no channel entries found that provide %s %s %s", group, version, kind) - return + return nil, err } - return + return entries, nil } diff --git a/pkg/sqlite/migrations/007_replaces_skips.go b/pkg/sqlite/migrations/007_replaces_skips.go index 7825e89fe..2340634be 100644 --- a/pkg/sqlite/migrations/007_replaces_skips.go +++ b/pkg/sqlite/migrations/007_replaces_skips.go @@ -97,12 +97,12 @@ func extractReplaces(ctx context.Context, tx *sql.Tx, name string) error { if err != nil { return err } - updateSql := `update operatorbundle SET replaces = ?, skips = ? WHERE name = ?;` - _, err = tx.ExecContext(ctx, updateSql, replaces, strings.Join(skips, ","), name) + updateSQL := `update operatorbundle SET replaces = ?, skips = ? WHERE name = ?;` + _, err = tx.ExecContext(ctx, updateSQL, replaces, strings.Join(skips, ","), name) return err } -func getReplacesAndSkips(ctx context.Context, tx *sql.Tx, name string) (replaces string, skips []string, err error) { +func getReplacesAndSkips(ctx context.Context, tx *sql.Tx, name string) (string, []string, error) { getReplacees := ` SELECT DISTINCT replaces.operatorbundle_name FROM channel_entry @@ -117,26 +117,28 @@ func getReplacesAndSkips(ctx context.Context, tx *sql.Tx, name string) (replaces } defer rows.Close() + var replaces string if rows.Next() { var replaceeName sql.NullString if err = rows.Scan(&replaceeName); err != nil { - return + return "", nil, err } if replaceeName.Valid { replaces = replaceeName.String } } + var skips []string skips = []string{} for rows.Next() { var skipName sql.NullString if err = rows.Scan(&skipName); err != nil { - return + return "", nil, err } if !skipName.Valid { continue } skips = append(skips, skipName.String) } - return + return replaces, skips, nil } diff --git a/pkg/sqlite/migrations/007_replaces_skips_test.go b/pkg/sqlite/migrations/007_replaces_skips_test.go index 422850dca..1b64b737d 100644 --- a/pkg/sqlite/migrations/007_replaces_skips_test.go +++ b/pkg/sqlite/migrations/007_replaces_skips_test.go @@ -11,7 +11,7 @@ import ( ) func TestReplacesSkipsUp(t *testing.T) { - db, migrator, cleanup := CreateTestDbAt(t, migrations.ReplacesSkipsMigrationKey-1) + db, migrator, cleanup := CreateTestDBAt(t, migrations.ReplacesSkipsMigrationKey-1) defer cleanup() _, err := db.Exec(`PRAGMA foreign_keys = 0`) @@ -45,7 +45,7 @@ func TestReplacesSkipsUp(t *testing.T) { _, err = tx.Exec("insert into channel(name, package_name, head_operatorbundle_name) values(?,?,?)", "stable", "etcd", "etcdoperator.v0.9.2") require.NoError(t, err) - channel_entries := ` + channelEntries := ` INSERT INTO "main"."channel_entry" ("entry_id", "channel_name", "package_name", "operatorbundle_name", "replaces", "depth") VALUES ('1', 'alpha', 'etcd', 'etcdoperator.v0.9.2', '4', '0'); INSERT INTO "main"."channel_entry" ("entry_id", "channel_name", "package_name", "operatorbundle_name", "replaces", "depth") VALUES ('2', 'alpha', 'etcd', 'etcdoperator.v0.9.1', '', '1'); INSERT INTO "main"."channel_entry" ("entry_id", "channel_name", "package_name", "operatorbundle_name", "replaces", "depth") VALUES ('3', 'alpha', 'etcd', 'etcdoperator.v0.9.2', '2', '1'); @@ -76,7 +76,7 @@ func TestReplacesSkipsUp(t *testing.T) { INSERT INTO "main"."channel_entry" ("entry_id", "channel_name", "package_name", "operatorbundle_name", "replaces", "depth") VALUES ('28', 'stable', 'etcd', 'etcdoperator.v0.6.1', '27', '5'); INSERT INTO "main"."channel_entry" ("entry_id", "channel_name", "package_name", "operatorbundle_name", "replaces", "depth") VALUES ('29', 'stable', 'etcd', 'etcdoperator.v0.3.2-a', '', '6'); INSERT INTO "main"."channel_entry" ("entry_id", "channel_name", "package_name", "operatorbundle_name", "replaces", "depth") VALUES ('30', 'stable', 'etcd', 'etcdoperator.v0.6.1', '29', '6'); ` - _, err = tx.Exec(channel_entries) + _, err = tx.Exec(channelEntries) require.NoError(t, err) require.NoError(t, tx.Commit()) @@ -125,19 +125,19 @@ func TestReplacesSkipsUp(t *testing.T) { rows, err := db.QueryContext(context.TODO(), getBundle, tt.name) require.NoError(t, err) require.True(t, rows.Next()) - var replacesSql sql.NullString - var skipsSql sql.NullString - require.NoError(t, rows.Scan(&replacesSql, &skipsSql)) + var replacesSQL sql.NullString + var skipsSQL sql.NullString + require.NoError(t, rows.Scan(&replacesSQL, &skipsSQL)) require.False(t, rows.Next()) require.NoError(t, rows.Close()) - require.Equal(t, tt.replaces, replacesSql.String) - require.Equal(t, tt.skips, skipsSql.String) + require.Equal(t, tt.replaces, replacesSQL.String) + require.Equal(t, tt.skips, skipsSQL.String) }) } } func TestReplacesSkipsDown(t *testing.T) { - db, migrator, cleanup := CreateTestDbAt(t, migrations.ReplacesSkipsMigrationKey) + db, migrator, cleanup := CreateTestDBAt(t, migrations.ReplacesSkipsMigrationKey) defer cleanup() // Add a bundle @@ -159,7 +159,7 @@ func TestReplacesSkipsDown(t *testing.T) { require.NoError(t, err) rows.Next() require.NoError(t, rows.Scan(&name, &csv, &bundle)) - require.Equal(t, name.String, "etcdoperator.v0.6.1") + require.Equal(t, "etcdoperator.v0.6.1", name.String) require.Equal(t, csv.String, testCSV) require.Equal(t, bundle.String, testBundle) require.NoError(t, rows.Close()) diff --git a/pkg/sqlite/migrations/008_dependencies_test.go b/pkg/sqlite/migrations/008_dependencies_test.go index ef1e2abd9..684341ef4 100644 --- a/pkg/sqlite/migrations/008_dependencies_test.go +++ b/pkg/sqlite/migrations/008_dependencies_test.go @@ -5,12 +5,13 @@ import ( "database/sql" "testing" - "github.com/operator-framework/operator-registry/pkg/sqlite/migrations" "github.com/stretchr/testify/require" + + "github.com/operator-framework/operator-registry/pkg/sqlite/migrations" ) func TestDependenciesUp(t *testing.T) { - db, migrator, cleanup := CreateTestDbAt(t, migrations.DependenciesMigrationKey-1) + db, migrator, cleanup := CreateTestDBAt(t, migrations.DependenciesMigrationKey-1) defer cleanup() _, err := db.Exec(`PRAGMA foreign_keys = 0`) @@ -41,13 +42,13 @@ func TestDependenciesUp(t *testing.T) { var typeName sql.NullString var value sql.NullString require.NoError(t, rows.Scan(&typeName, &value)) - require.Equal(t, typeName.String, "olm.gvk") - require.Equal(t, value.String, `{"group":"test.coreos.com","kind":"testapi","type":"olm.gvk","version":"v1"}`) + require.Equal(t, "olm.gvk", typeName.String) + require.JSONEq(t, `{"group":"test.coreos.com","kind":"testapi","type":"olm.gvk","version":"v1"}`, value.String) require.NoError(t, rows.Close()) } func TestDependenciesDown(t *testing.T) { - db, migrator, cleanup := CreateTestDbAt(t, migrations.DependenciesMigrationKey) + db, migrator, cleanup := CreateTestDBAt(t, migrations.DependenciesMigrationKey) defer cleanup() _, err := db.Exec(`PRAGMA foreign_keys = 0`) @@ -76,7 +77,7 @@ func TestDependenciesDown(t *testing.T) { var typeName sql.NullString var value sql.NullString require.NoError(t, rows.Scan(&typeName, &value)) - require.Equal(t, typeName.String, "olm.package") + require.Equal(t, "olm.package", typeName.String) require.Equal(t, value.String, valueStr) require.NoError(t, rows.Close()) diff --git a/pkg/sqlite/migrations/009_properties.go b/pkg/sqlite/migrations/009_properties.go index 046675611..252ad99ec 100644 --- a/pkg/sqlite/migrations/009_properties.go +++ b/pkg/sqlite/migrations/009_properties.go @@ -75,12 +75,12 @@ var propertiesMigration = &Migration{ } // update the serialized value to omit the dependency type - updateDependencySql := ` + updateDependencySQL := ` UPDATE dependencies SET value = (SELECT json_remove(value, "$.type") FROM dependencies WHERE operatorbundle_name=dependencies.operatorbundle_name)` - _, err = tx.ExecContext(ctx, updateDependencySql) + _, err = tx.ExecContext(ctx, updateDependencySQL) if err != nil { return err } @@ -111,6 +111,7 @@ func getPackageForBundle(ctx context.Context, name string, tx *sql.Tx) (string, if !pkg.Valid { return "", err } + // nolint: staticcheck return pkg.String, nil } return "", err diff --git a/pkg/sqlite/migrations/009_properties_test.go b/pkg/sqlite/migrations/009_properties_test.go index dff780c1b..b47cad5a0 100644 --- a/pkg/sqlite/migrations/009_properties_test.go +++ b/pkg/sqlite/migrations/009_properties_test.go @@ -5,12 +5,13 @@ import ( "database/sql" "testing" - "github.com/operator-framework/operator-registry/pkg/sqlite/migrations" "github.com/stretchr/testify/require" + + "github.com/operator-framework/operator-registry/pkg/sqlite/migrations" ) func TestPropertiesUp(t *testing.T) { - db, migrator, cleanup := CreateTestDbAt(t, migrations.PropertiesMigrationKey-1) + db, migrator, cleanup := CreateTestDBAt(t, migrations.PropertiesMigrationKey-1) defer cleanup() _, err := db.Exec(`PRAGMA foreign_keys = 0`) @@ -27,8 +28,8 @@ func TestPropertiesUp(t *testing.T) { require.NoError(t, err) _, err = tx.Exec("insert into api_provider(group_name, version, kind, operatorbundle_name, operatorbundle_version, operatorbundle_path) values(?, ?, ?, ?, ?, ?)", "test.coreos.com", "v1", "testapi", "etcdoperator.v0.6.1", "0.6.1", "quay.io/image") require.NoError(t, err) - channel_entries := `INSERT INTO channel_entry("entry_id", "channel_name", "package_name", "operatorbundle_name", "replaces", "depth") VALUES ('1', 'alpha', 'etcd', 'etcdoperator.v0.6.1', '', '0');` - _, err = tx.Exec(channel_entries) + channelEntries := `INSERT INTO channel_entry("entry_id", "channel_name", "package_name", "operatorbundle_name", "replaces", "depth") VALUES ('1', 'alpha', 'etcd', 'etcdoperator.v0.6.1', '', '0');` + _, err = tx.Exec(channelEntries) require.NoError(t, err) valueStr := `{"packageName":"etcd","type":"olm.package","version":">0.6.0"}` _, err = tx.Exec("insert into dependencies(type, value, operatorbundle_name, operatorbundle_version, operatorbundle_path) VALUES (?, ?, ?, ?, ?)", "olm.package", valueStr, "etcdoperator.v0.6.1", "0.6.1", "quay.io/image") @@ -104,7 +105,7 @@ func TestPropertiesUp(t *testing.T) { } func TestPropertiesDown(t *testing.T) { - db, migrator, cleanup := CreateTestDbAt(t, migrations.PropertiesMigrationKey) + db, migrator, cleanup := CreateTestDBAt(t, migrations.PropertiesMigrationKey) defer cleanup() _, err := db.Exec(`PRAGMA foreign_keys = 0`) @@ -133,7 +134,7 @@ func TestPropertiesDown(t *testing.T) { var typeName sql.NullString var value sql.NullString require.NoError(t, rows.Scan(&typeName, &value)) - require.Equal(t, typeName.String, "olm.package") + require.Equal(t, "olm.package", typeName.String) require.Equal(t, value.String, valueStr) require.NoError(t, rows.Close()) diff --git a/pkg/sqlite/migrations/010_set_bundlepath_pkg_property.go b/pkg/sqlite/migrations/010_set_bundlepath_pkg_property.go index bee961621..d488775b0 100644 --- a/pkg/sqlite/migrations/010_set_bundlepath_pkg_property.go +++ b/pkg/sqlite/migrations/010_set_bundlepath_pkg_property.go @@ -15,12 +15,12 @@ func init() { var bundlePathPkgPropertyMigration = &Migration{ Id: BundlePathPkgMigrationKey, Up: func(ctx context.Context, tx *sql.Tx) error { - updatePropertiesSql := ` + updatePropertiesSQL := ` UPDATE properties SET operatorbundle_path = (SELECT bundlepath FROM operatorbundle WHERE operatorbundle_name = operatorbundle.name AND operatorbundle_version = operatorbundle.version)` - _, err := tx.ExecContext(ctx, updatePropertiesSql) + _, err := tx.ExecContext(ctx, updatePropertiesSQL) if err != nil { return err } @@ -28,11 +28,11 @@ var bundlePathPkgPropertyMigration = &Migration{ return nil }, Down: func(ctx context.Context, tx *sql.Tx) error { - updatePropertiesSql := ` + updatePropertiesSQL := ` UPDATE properties SET operatorbundle_path = null WHERE type = "olm.package"` - _, err := tx.ExecContext(ctx, updatePropertiesSql) + _, err := tx.ExecContext(ctx, updatePropertiesSQL) if err != nil { return err } diff --git a/pkg/sqlite/migrations/010_set_bundlepath_pkg_property_test.go b/pkg/sqlite/migrations/010_set_bundlepath_pkg_property_test.go index 2ad4bf960..e1465d146 100644 --- a/pkg/sqlite/migrations/010_set_bundlepath_pkg_property_test.go +++ b/pkg/sqlite/migrations/010_set_bundlepath_pkg_property_test.go @@ -5,12 +5,13 @@ import ( "database/sql" "testing" - "github.com/operator-framework/operator-registry/pkg/sqlite/migrations" "github.com/stretchr/testify/require" + + "github.com/operator-framework/operator-registry/pkg/sqlite/migrations" ) func TestBundlePathPropertyUp(t *testing.T) { - db, migrator, cleanup := CreateTestDbAt(t, migrations.BundlePathPkgMigrationKey-1) + db, migrator, cleanup := CreateTestDBAt(t, migrations.BundlePathPkgMigrationKey-1) defer cleanup() _, err := db.Exec(`PRAGMA foreign_keys = 0`) @@ -47,7 +48,7 @@ func TestBundlePathPropertyUp(t *testing.T) { } func TestBundlePathPropertyDown(t *testing.T) { - db, migrator, cleanup := CreateTestDbAt(t, migrations.BundlePathPkgMigrationKey) + db, migrator, cleanup := CreateTestDBAt(t, migrations.BundlePathPkgMigrationKey) defer cleanup() _, err := db.Exec(`PRAGMA foreign_keys = 0`) diff --git a/pkg/sqlite/migrations/011_substitutes_for_test.go b/pkg/sqlite/migrations/011_substitutes_for_test.go index f92e0608b..555894a45 100644 --- a/pkg/sqlite/migrations/011_substitutes_for_test.go +++ b/pkg/sqlite/migrations/011_substitutes_for_test.go @@ -11,7 +11,7 @@ import ( ) func TestSubstitutesForUp(t *testing.T) { - db, migrator, cleanup := CreateTestDbAt(t, migrations.SubstitutesForMigrationKey-1) + db, migrator, cleanup := CreateTestDBAt(t, migrations.SubstitutesForMigrationKey-1) defer cleanup() _, err := db.Exec(`PRAGMA foreign_keys = 0`) @@ -44,7 +44,7 @@ func TestSubstitutesForUp(t *testing.T) { } func TestSubstitutesForDown(t *testing.T) { - db, migrator, cleanup := CreateTestDbAt(t, migrations.SubstitutesForMigrationKey) + db, migrator, cleanup := CreateTestDBAt(t, migrations.SubstitutesForMigrationKey) defer cleanup() _, err := db.Exec(`PRAGMA foreign_keys = 0`) diff --git a/pkg/sqlite/migrations/012_deprecated.go b/pkg/sqlite/migrations/012_deprecated.go index 760b381ff..e99480d58 100644 --- a/pkg/sqlite/migrations/012_deprecated.go +++ b/pkg/sqlite/migrations/012_deprecated.go @@ -29,6 +29,7 @@ var deprecatedMigration = &Migration{ return err } + // nolint: gosec initDeprecated := fmt.Sprintf(`INSERT OR REPLACE INTO deprecated(operatorbundle_name) SELECT operatorbundle_name FROM properties WHERE properties.type='%s'`, registry.DeprecatedType) _, err := tx.ExecContext(ctx, initDeprecated) diff --git a/pkg/sqlite/migrations/012_deprecated_test.go b/pkg/sqlite/migrations/012_deprecated_test.go index 06e3b4ca9..0d57de955 100644 --- a/pkg/sqlite/migrations/012_deprecated_test.go +++ b/pkg/sqlite/migrations/012_deprecated_test.go @@ -12,7 +12,7 @@ import ( ) func TestDeprecated(t *testing.T) { - db, migrator, cleanup := CreateTestDbAt(t, migrations.DeprecatedMigrationKey-1) + db, migrator, cleanup := CreateTestDBAt(t, migrations.DeprecatedMigrationKey-1) defer cleanup() // Insert fixture bundles to satisfy foreign key constraint in properties table diff --git a/pkg/sqlite/migrations/013_rm_truncated_deprecations_test.go b/pkg/sqlite/migrations/013_rm_truncated_deprecations_test.go index 8977d73ca..5ed881515 100644 --- a/pkg/sqlite/migrations/013_rm_truncated_deprecations_test.go +++ b/pkg/sqlite/migrations/013_rm_truncated_deprecations_test.go @@ -11,7 +11,7 @@ import ( ) func TestRmTruncatedDeprecations(t *testing.T) { - db, migrator, cleanup := CreateTestDbAt(t, migrations.RmTruncatedDeprecationsMigrationKey-1) + db, migrator, cleanup := CreateTestDBAt(t, migrations.RmTruncatedDeprecationsMigrationKey-1) defer cleanup() // Insert fixtures to satisfy foreign key constraints @@ -32,6 +32,7 @@ func TestRmTruncatedDeprecations(t *testing.T) { // Add a truncated bundle; i.e. doesn't exist in the channel_entry table _, err = db.Exec(insertDeprecated, "operator.v1.0.0-pre") + require.NoError(t, err) // This migration should delete all bundles that are not referenced by the channel_entry table require.NoError(t, migrator.Up(context.Background(), migrations.Only(migrations.RmTruncatedDeprecationsMigrationKey))) diff --git a/pkg/sqlite/migrations/migrations.go b/pkg/sqlite/migrations/migrations.go index b9bb60fba..475bb7cd6 100644 --- a/pkg/sqlite/migrations/migrations.go +++ b/pkg/sqlite/migrations/migrations.go @@ -8,6 +8,7 @@ import ( ) type Migration struct { + // nolint:stylecheck Id int Up func(context.Context, *sql.Tx) error Down func(context.Context, *sql.Tx) error diff --git a/pkg/sqlite/migrator.go b/pkg/sqlite/migrator.go index 82bacc834..9f1438ab5 100644 --- a/pkg/sqlite/migrator.go +++ b/pkg/sqlite/migrator.go @@ -3,6 +3,7 @@ package sqlite import ( "context" "database/sql" + "errors" "fmt" "strings" @@ -86,12 +87,12 @@ func (m *SQLLiteMigrator) Up(ctx context.Context, migrations migrations.Migratio } for _, migration := range migrations { - current_version, err := m.version(ctx, tx) + currentVersion, err := m.version(ctx, tx) if err != nil { return err } - if migration.Id != current_version+1 { + if migration.Id != currentVersion+1 { return fmt.Errorf("migration applied out of order") } @@ -127,12 +128,12 @@ func (m *SQLLiteMigrator) Down(ctx context.Context, migrations migrations.Migrat } for _, migration := range migrations { - current_version, err := m.version(ctx, tx) + currentVersion, err := m.version(ctx, tx) if err != nil { return err } - if migration.Id != current_version { + if migration.Id != currentVersion { return fmt.Errorf("migration applied out of order") } @@ -175,7 +176,7 @@ func (m *SQLLiteMigrator) tableExists(tx *sql.Tx, table string) (bool, error) { return exists, nil } -func (m *SQLLiteMigrator) version(ctx context.Context, tx *sql.Tx) (version int, err error) { +func (m *SQLLiteMigrator) version(ctx context.Context, tx *sql.Tx) (int, error) { tableExists, err := m.tableExists(tx, m.migrationsTable) if err != nil { return NilVersion, err @@ -185,9 +186,10 @@ func (m *SQLLiteMigrator) version(ctx context.Context, tx *sql.Tx) (version int, } query := `SELECT version FROM ` + m.migrationsTable + ` LIMIT 1` + var version int err = tx.QueryRowContext(ctx, query).Scan(&version) switch { - case err == sql.ErrNoRows: + case errors.Is(err, sql.ErrNoRows): return NilVersion, nil case err != nil: return NilVersion, err @@ -200,10 +202,12 @@ func (m *SQLLiteMigrator) setVersion(ctx context.Context, tx *sql.Tx, version in if err := m.ensureMigrationTable(ctx, tx); err != nil { return err } + // nolint: gosec _, err := tx.ExecContext(ctx, "DELETE FROM "+m.migrationsTable) if err != nil { return err } + // nolint: gosec _, err = tx.ExecContext(ctx, "INSERT INTO "+m.migrationsTable+"(version) values(?)", version) return err } diff --git a/pkg/sqlite/migrator_test.go b/pkg/sqlite/migrator_test.go index 192238b5b..8fd1aee2e 100644 --- a/pkg/sqlite/migrator_test.go +++ b/pkg/sqlite/migrator_test.go @@ -122,7 +122,7 @@ func TestSQLLiteMigrator_Down(t *testing.T) { t.Run(tt.name, func(t *testing.T) { up = false down = false - db, cleanup := CreateTestDb(t) + db, cleanup := CreateTestDB(t) defer cleanup() m := &SQLLiteMigrator{ db: db, @@ -134,7 +134,11 @@ func TestSQLLiteMigrator_Down(t *testing.T) { require.NoError(t, m.setVersion(context.TODO(), tx, 0)) require.NoError(t, err) require.NoError(t, tx.Commit()) - tx.Rollback() + // TODO: this shouldn't be unconditionally rolled back + // run_test_migration, run_migration_out_of_order, and run_error_migration each have at least one scenario + // where rollback is no longer possible (committed or rolled back already) + // In the interest of retaining function and a good lint bright line, we'll just ignore the error here + _ = tx.Rollback() } if err := m.Down(tt.args.ctx, tt.args.migrations); (err != nil) != tt.wantErr { t.Errorf("Down() error = %v, wantErr %v", err, tt.wantErr) @@ -150,7 +154,7 @@ func TestSQLLiteMigrator_Down(t *testing.T) { version, err = m.version(context.TODO(), tx) require.NoError(t, err) require.NoError(t, tx.Commit()) - tx.Rollback() + _ = tx.Rollback() } require.Equal(t, tt.wantVersion, version) }) @@ -280,7 +284,7 @@ func TestSQLLiteMigrator_Up(t *testing.T) { t.Run(tt.name, func(t *testing.T) { up = 0 down = false - db, cleanup := CreateTestDb(t) + db, cleanup := CreateTestDB(t) defer cleanup() m := &SQLLiteMigrator{ db: db, @@ -292,7 +296,7 @@ func TestSQLLiteMigrator_Up(t *testing.T) { require.NoError(t, m.setVersion(context.TODO(), tx, -1)) require.NoError(t, err) require.NoError(t, tx.Commit()) - tx.Rollback() + _ = tx.Rollback() } if err := m.Up(tt.args.ctx, tt.args.migrations); (err != nil) != tt.wantErr { t.Errorf("Up() error = %v, wantErr %v", err, tt.wantErr) @@ -308,7 +312,7 @@ func TestSQLLiteMigrator_Up(t *testing.T) { version, err = m.version(context.TODO(), tx) require.NoError(t, err) require.NoError(t, tx.Commit()) - tx.Rollback() + _ = tx.Rollback() } require.Equal(t, tt.wantVersion, version) @@ -326,7 +330,7 @@ func TestSQLLiteMigrator_Up(t *testing.T) { version, err = m.version(context.TODO(), tx) require.NoError(t, err) require.NoError(t, tx.Commit()) - tx.Rollback() + _ = tx.Rollback() } require.Equal(t, NilVersion, version) }) @@ -396,7 +400,7 @@ func TestSQLLiteMigrator_Migrate(t *testing.T) { t.Run(tt.name, func(t *testing.T) { up = 0 down = 0 - db, cleanup := CreateTestDb(t) + db, cleanup := CreateTestDB(t) defer cleanup() m := &SQLLiteMigrator{ db: db, @@ -409,7 +413,7 @@ func TestSQLLiteMigrator_Migrate(t *testing.T) { require.NoError(t, m.setVersion(context.TODO(), tx, tt.startVersion)) require.NoError(t, err) require.NoError(t, tx.Commit()) - tx.Rollback() + _ = tx.Rollback() } if err := m.Migrate(context.TODO()); (err != nil) != tt.wantErr { t.Errorf("Migrate() error = %v, wantErr %v", err, tt.wantErr) @@ -425,7 +429,7 @@ func TestSQLLiteMigrator_Migrate(t *testing.T) { version, err = m.version(context.TODO(), tx) require.NoError(t, err) require.NoError(t, tx.Commit()) - tx.Rollback() + _ = tx.Rollback() } require.Equal(t, tt.wantVersion, version) }) diff --git a/pkg/sqlite/query.go b/pkg/sqlite/query.go index 24880f1fc..7a42981f4 100644 --- a/pkg/sqlite/query.go +++ b/pkg/sqlite/query.go @@ -63,6 +63,7 @@ func NewSQLLiteQuerier(dbFilename string, opts ...SQLiteQuerierOption) (*SQLQuer return NewSQLLiteQuerierFromDb(db, opts...), nil } +// nolint:stylecheck func NewSQLLiteQuerierFromDb(db *sql.DB, opts ...SQLiteQuerierOption) *SQLQuerier { return NewSQLLiteQuerierFromDBQuerier(dbQuerierAdapter{db}, opts...) } @@ -241,13 +242,13 @@ func (s *SQLQuerier) GetBundle(ctx context.Context, pkgName, channelName, csvNam if !rows.Next() { return nil, fmt.Errorf("no entry found for %s %s %s", pkgName, channelName, csvName) } - var entryId sql.NullInt64 + var entryID sql.NullInt64 var name sql.NullString var bundle sql.NullString var bundlePath sql.NullString var version sql.NullString var skipRange sql.NullString - if err := rows.Scan(&entryId, &name, &bundle, &bundlePath, &version, &skipRange); err != nil { + if err := rows.Scan(&entryID, &name, &bundle, &bundlePath, &version, &skipRange); err != nil { return nil, err } @@ -265,7 +266,7 @@ func (s *SQLQuerier) GetBundle(ctx context.Context, pkgName, channelName, csvNam out.Version = version.String out.SkipRange = skipRange.String - provided, required, err := s.GetApisForEntry(ctx, entryId.Int64) + provided, required, err := s.GetApisForEntry(ctx, entryID.Int64) if err != nil { return nil, err } @@ -315,18 +316,18 @@ WHERE channel.name = :channel AND channel.package_name = :package` }, nil } -func (s *SQLQuerier) GetChannelEntriesThatReplace(ctx context.Context, name string) (entries []*registry.ChannelEntry, err error) { +func (s *SQLQuerier) GetChannelEntriesThatReplace(ctx context.Context, name string) ([]*registry.ChannelEntry, error) { query := `SELECT DISTINCT channel_entry.package_name, channel_entry.channel_name, channel_entry.operatorbundle_name FROM channel_entry LEFT OUTER JOIN channel_entry replaces ON channel_entry.replaces = replaces.entry_id WHERE replaces.operatorbundle_name = ?` rows, err := s.db.QueryContext(ctx, query, name) if err != nil { - return + return nil, err } defer rows.Close() - entries = []*registry.ChannelEntry{} + var entries []*registry.ChannelEntry for rows.Next() { var pkgNameSQL sql.NullString @@ -334,7 +335,7 @@ func (s *SQLQuerier) GetChannelEntriesThatReplace(ctx context.Context, name stri var bundleNameSQL sql.NullString if err = rows.Scan(&pkgNameSQL, &channelNameSQL, &bundleNameSQL); err != nil { - return + return nil, err } entries = append(entries, ®istry.ChannelEntry{ PackageName: pkgNameSQL.String, @@ -345,9 +346,9 @@ func (s *SQLQuerier) GetChannelEntriesThatReplace(ctx context.Context, name stri } if len(entries) == 0 { err = fmt.Errorf("no channel entries found that replace %s", name) - return + return nil, err } - return + return entries, nil } func (s *SQLQuerier) GetBundleThatReplaces(ctx context.Context, name, pkgName, channelName string) (*api.Bundle, error) { @@ -365,13 +366,13 @@ func (s *SQLQuerier) GetBundleThatReplaces(ctx context.Context, name, pkgName, c if !rows.Next() { return nil, fmt.Errorf("no entry found for %s %s", pkgName, channelName) } - var entryId sql.NullInt64 + var entryID sql.NullInt64 var outName sql.NullString var bundle sql.NullString var bundlePath sql.NullString var version sql.NullString var skipRange sql.NullString - if err := rows.Scan(&entryId, &outName, &bundle, &bundlePath, &version, &skipRange); err != nil { + if err := rows.Scan(&entryID, &outName, &bundle, &bundlePath, &version, &skipRange); err != nil { return nil, err } @@ -389,7 +390,7 @@ func (s *SQLQuerier) GetBundleThatReplaces(ctx context.Context, name, pkgName, c out.Version = version.String out.SkipRange = skipRange.String - provided, required, err := s.GetApisForEntry(ctx, entryId.Int64) + provided, required, err := s.GetApisForEntry(ctx, entryID.Int64) if err != nil { return nil, err } @@ -411,7 +412,7 @@ func (s *SQLQuerier) GetBundleThatReplaces(ctx context.Context, name, pkgName, c return out, nil } -func (s *SQLQuerier) GetChannelEntriesThatProvide(ctx context.Context, group, version, kind string) (entries []*registry.ChannelEntry, err error) { +func (s *SQLQuerier) GetChannelEntriesThatProvide(ctx context.Context, group, version, kind string) ([]*registry.ChannelEntry, error) { // TODO: join on full fk, not just operatorbundlename query := `SELECT DISTINCT channel_entry.package_name, channel_entry.channel_name, channel_entry.operatorbundle_name, replaces.operatorbundle_name FROM channel_entry @@ -433,7 +434,7 @@ func (s *SQLQuerier) GetChannelEntriesThatProvide(ctx context.Context, group, ve } defer rows.Close() - entries = []*registry.ChannelEntry{} + var entries []*registry.ChannelEntry for rows.Next() { var pkgNameSQL sql.NullString @@ -441,7 +442,7 @@ func (s *SQLQuerier) GetChannelEntriesThatProvide(ctx context.Context, group, ve var bundleNameSQL sql.NullString var replacesSQL sql.NullString if err = rows.Scan(&pkgNameSQL, &channelNameSQL, &bundleNameSQL, &replacesSQL); err != nil { - return + return nil, err } entries = append(entries, ®istry.ChannelEntry{ @@ -453,13 +454,13 @@ func (s *SQLQuerier) GetChannelEntriesThatProvide(ctx context.Context, group, ve } if len(entries) == 0 { err = fmt.Errorf("no channel entries found that provide %s %s %s", group, version, kind) - return + return nil, err } - return + return entries, nil } // Get latest channel entries that provide an api -func (s *SQLQuerier) GetLatestChannelEntriesThatProvide(ctx context.Context, group, version, kind string) (entries []*registry.ChannelEntry, err error) { +func (s *SQLQuerier) GetLatestChannelEntriesThatProvide(ctx context.Context, group, version, kind string) ([]*registry.ChannelEntry, error) { query := `SELECT DISTINCT channel_entry.package_name, channel_entry.channel_name, channel_entry.operatorbundle_name, replaces.operatorbundle_name, MIN(channel_entry.depth) FROM channel_entry INNER JOIN properties ON channel_entry.operatorbundle_name = properties.operatorbundle_name @@ -482,15 +483,15 @@ func (s *SQLQuerier) GetLatestChannelEntriesThatProvide(ctx context.Context, gro } defer rows.Close() - entries = []*registry.ChannelEntry{} + var entries []*registry.ChannelEntry for rows.Next() { var pkgNameSQL sql.NullString var channelNameSQL sql.NullString var bundleNameSQL sql.NullString var replacesSQL sql.NullString - var min_depth sql.NullInt64 - if err = rows.Scan(&pkgNameSQL, &channelNameSQL, &bundleNameSQL, &replacesSQL, &min_depth); err != nil { + var minDepth sql.NullInt64 + if err = rows.Scan(&pkgNameSQL, &channelNameSQL, &bundleNameSQL, &replacesSQL, &minDepth); err != nil { return nil, err } @@ -518,7 +519,7 @@ func (s *SQLQuerier) GetBundleThatProvides(ctx context.Context, group, apiVersio WHERE properties.type = ? AND properties.value = ? AND package.default_channel = channel_entry.channel_name GROUP BY channel_entry.package_name, channel_entry.channel_name` - value, err := json.Marshal(map[string]string{ + value, _ := json.Marshal(map[string]string{ "group": group, "version": apiVersion, "kind": kind, @@ -532,17 +533,17 @@ func (s *SQLQuerier) GetBundleThatProvides(ctx context.Context, group, apiVersio if !rows.Next() { return nil, fmt.Errorf("no entry found that provides %s %s %s", group, apiVersion, kind) } - var entryId sql.NullInt64 + var entryID sql.NullInt64 var bundle sql.NullString var bundlePath sql.NullString - var min_depth sql.NullInt64 + var minDepth sql.NullInt64 var bundleName sql.NullString var pkgName sql.NullString var channelName sql.NullString var replaces sql.NullString var version sql.NullString var skipRange sql.NullString - if err := rows.Scan(&entryId, &bundle, &bundlePath, &min_depth, &bundleName, &pkgName, &channelName, &replaces, &version, &skipRange); err != nil { + if err := rows.Scan(&entryID, &bundle, &bundlePath, &minDepth, &bundleName, &pkgName, &channelName, &replaces, &version, &skipRange); err != nil { return nil, err } @@ -564,7 +565,7 @@ func (s *SQLQuerier) GetBundleThatProvides(ctx context.Context, group, apiVersio out.Version = version.String out.SkipRange = skipRange.String - provided, required, err := s.GetApisForEntry(ctx, entryId.Int64) + provided, required, err := s.GetApisForEntry(ctx, entryID.Int64) if err != nil { return nil, err } @@ -627,7 +628,7 @@ func (s *SQLQuerier) GetImagesForBundle(ctx context.Context, csvName string) ([] return images, nil } -func (s *SQLQuerier) GetApisForEntry(ctx context.Context, entryID int64) (provided []*api.GroupVersionKind, required []*api.GroupVersionKind, err error) { +func (s *SQLQuerier) GetApisForEntry(ctx context.Context, entryID int64) ([]*api.GroupVersionKind, []*api.GroupVersionKind, error) { groups := map[string]struct{}{} kinds := map[string]struct{}{} versions := map[string]struct{}{} @@ -642,7 +643,7 @@ func (s *SQLQuerier) GetApisForEntry(ctx context.Context, entryID int64) (provid } defer providedRows.Close() - provided = []*api.GroupVersionKind{} + var provided []*api.GroupVersionKind for providedRows.Next() { var value sql.NullString @@ -678,7 +679,7 @@ func (s *SQLQuerier) GetApisForEntry(ctx context.Context, entryID int64) (provid } defer requiredRows.Close() - required = []*api.GroupVersionKind{} + var required []*api.GroupVersionKind for requiredRows.Next() { var value sql.NullString @@ -770,7 +771,7 @@ func (s *SQLQuerier) GetApisForEntry(ctx context.Context, entryID int64) (provid } required[i].Plural = plural } - return + return provided, required, nil } func (s *SQLQuerier) GetBundleVersion(ctx context.Context, image string) (string, error) { @@ -809,6 +810,7 @@ func (s *SQLQuerier) GetBundlePathsForPackage(ctx context.Context, pkgName strin return nil, err } if imgName.Valid && imgName.String == "" { + // nolint: stylecheck return nil, fmt.Errorf("Index malformed: cannot find paths to bundle images") } images = append(images, imgName.String) @@ -844,6 +846,7 @@ func (s *SQLQuerier) GetBundlesForPackage(ctx context.Context, pkgName string) ( key.Version = version.String } if key.IsEmpty() { + // nolint: stylecheck return nil, fmt.Errorf("Index malformed: cannot find identifier for bundle in package %s", pkgName) } bundles[key] = struct{}{} @@ -1047,7 +1050,7 @@ func (s *SQLQuerier) SendBundles(ctx context.Context, stream registry.BundleSend return err } } - buildLegacyRequiredAPIs(out.Dependencies, &out.RequiredApis) + _ = buildLegacyRequiredAPIs(out.Dependencies, &out.RequiredApis) out.Dependencies = uniqueDeps(out.Dependencies) if props.Valid { @@ -1055,7 +1058,7 @@ func (s *SQLQuerier) SendBundles(ctx context.Context, stream registry.BundleSend return err } } - buildLegacyProvidedAPIs(out.Properties, &out.ProvidedApis) + _ = buildLegacyProvidedAPIs(out.Properties, &out.ProvidedApis) out.Properties = uniqueProps(out.Properties) if err := stream.Send(out); err != nil { return err @@ -1079,7 +1082,6 @@ func (s *SQLQuerier) ListBundles(ctx context.Context) ([]*api.Bundle, error) { return nil, err } return bundleSender, nil - } func buildLegacyRequiredAPIs(src []*api.Dependency, dst *[]*api.GroupVersionKind) error { @@ -1150,7 +1152,7 @@ func uniqueProps(props []*api.Property) []*api.Property { return list } -func (s *SQLQuerier) GetDependenciesForBundle(ctx context.Context, name, version, path string) (dependencies []*api.Dependency, err error) { +func (s *SQLQuerier) GetDependenciesForBundle(ctx context.Context, name, version, path string) ([]*api.Dependency, error) { depQuery := `SELECT DISTINCT type, value FROM dependencies WHERE operatorbundle_name=? AND (operatorbundle_version=? OR operatorbundle_version is NULL) @@ -1162,7 +1164,7 @@ func (s *SQLQuerier) GetDependenciesForBundle(ctx context.Context, name, version } defer rows.Close() - dependencies = []*api.Dependency{} + var dependencies []*api.Dependency for rows.Next() { var typeName sql.NullString var value sql.NullString @@ -1179,10 +1181,10 @@ func (s *SQLQuerier) GetDependenciesForBundle(ctx context.Context, name, version }) } - return + return dependencies, nil } -func (s *SQLQuerier) GetPropertiesForBundle(ctx context.Context, name, version, path string) (properties []*api.Property, err error) { +func (s *SQLQuerier) GetPropertiesForBundle(ctx context.Context, name, version, path string) ([]*api.Property, error) { propQuery := `SELECT DISTINCT type, value FROM properties WHERE operatorbundle_name=? AND (operatorbundle_version=? OR operatorbundle_version is NULL) @@ -1194,7 +1196,7 @@ func (s *SQLQuerier) GetPropertiesForBundle(ctx context.Context, name, version, } defer rows.Close() - properties = []*api.Property{} + var properties []*api.Property for rows.Next() { var typeName sql.NullString var value sql.NullString @@ -1211,10 +1213,10 @@ func (s *SQLQuerier) GetPropertiesForBundle(ctx context.Context, name, version, }) } - return + return properties, nil } -func (s *SQLQuerier) GetBundlePathIfExists(ctx context.Context, bundleName string) (bundlePath string, err error) { +func (s *SQLQuerier) GetBundlePathIfExists(ctx context.Context, bundleName string) (string, error) { getBundlePathQuery := ` SELECT bundlepath FROM operatorbundle @@ -1222,26 +1224,27 @@ func (s *SQLQuerier) GetBundlePathIfExists(ctx context.Context, bundleName strin rows, err := s.db.QueryContext(ctx, getBundlePathQuery, bundleName) if err != nil { - return + return "", err } defer rows.Close() if !rows.Next() { // no bundlepath set err = registry.ErrBundleImageNotInDatabase - return + return "", err } var bundlePathSQL sql.NullString if err = rows.Scan(&bundlePathSQL); err != nil { - return + return "", err } + var bundlePath string if bundlePathSQL.Valid { bundlePath = bundlePathSQL.String } - return + return bundlePath, nil } // ListRegistryBundles returns a set of registry bundles. diff --git a/pkg/sqlite/query_sql_test.go b/pkg/sqlite/query_sql_test.go index ff33a91a9..224b98297 100644 --- a/pkg/sqlite/query_sql_test.go +++ b/pkg/sqlite/query_sql_test.go @@ -6,7 +6,6 @@ import ( "testing" _ "github.com/mattn/go-sqlite3" - "github.com/stretchr/testify/require" ) @@ -31,7 +30,6 @@ func TestListBundlesQuery(t *testing.T) { t.Fatalf("unexpected error executing setup statements: %v", err) } } - }, Expect: func(t *testing.T, rows *sql.Rows) { replacements := map[sql.NullString]sql.NullString{ @@ -78,7 +76,6 @@ func TestListBundlesQuery(t *testing.T) { t.Fatalf("unexpected error executing setup statements: %v", err) } } - }, Expect: func(t *testing.T, rows *sql.Rows) { type result struct { @@ -141,7 +138,6 @@ func TestListBundlesQuery(t *testing.T) { t.Fatalf("unexpected error executing setup statements: %v", err) } } - }, Expect: func(t *testing.T, rows *sql.Rows) { require := require.New(t) @@ -171,7 +167,6 @@ func TestListBundlesQuery(t *testing.T) { t.Fatalf("unexpected error executing setup statements: %v", err) } } - }, Expect: func(t *testing.T, rows *sql.Rows) { require := require.New(t) @@ -200,7 +195,6 @@ func TestListBundlesQuery(t *testing.T) { t.Fatalf("unexpected error executing setup statements: %v", err) } } - }, Expect: func(t *testing.T, rows *sql.Rows) { require := require.New(t) @@ -218,7 +212,7 @@ func TestListBundlesQuery(t *testing.T) { t.Run(tt.Name, func(t *testing.T) { ctx := context.Background() - db, cleanup := CreateTestDb(t) + db, cleanup := CreateTestDB(t) defer cleanup() store, err := NewSQLLiteLoader(db) require.NoError(t, err) diff --git a/pkg/sqlite/query_test.go b/pkg/sqlite/query_test.go index 110c4e14e..d354c40c4 100644 --- a/pkg/sqlite/query_test.go +++ b/pkg/sqlite/query_test.go @@ -7,10 +7,11 @@ import ( "reflect" "testing" + "github.com/stretchr/testify/assert" + "github.com/operator-framework/operator-registry/pkg/api" "github.com/operator-framework/operator-registry/pkg/sqlite" "github.com/operator-framework/operator-registry/pkg/sqlite/sqlitefakes" - "github.com/stretchr/testify/assert" ) func TestListBundles(t *testing.T) { diff --git a/pkg/sqlite/remove_test.go b/pkg/sqlite/remove_test.go index 18b22924f..782b1bf5e 100644 --- a/pkg/sqlite/remove_test.go +++ b/pkg/sqlite/remove_test.go @@ -4,18 +4,17 @@ import ( "context" "testing" + "github.com/sirupsen/logrus" + "github.com/stretchr/testify/require" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "github.com/operator-framework/operator-registry/pkg/image" "github.com/operator-framework/operator-registry/pkg/registry" - - "github.com/sirupsen/logrus" - "github.com/stretchr/testify/require" ) func TestRemover(t *testing.T) { logrus.SetLevel(logrus.DebugLevel) - db, cleanup := CreateTestDb(t) + db, cleanup := CreateTestDB(t) defer cleanup() store, err := NewSQLLiteLoader(db) require.NoError(t, err) diff --git a/pkg/sqlite/stranded_test.go b/pkg/sqlite/stranded_test.go index 509d3502a..c39081867 100644 --- a/pkg/sqlite/stranded_test.go +++ b/pkg/sqlite/stranded_test.go @@ -5,16 +5,16 @@ import ( "database/sql" "testing" - "github.com/operator-framework/operator-registry/pkg/image" - "github.com/operator-framework/operator-registry/pkg/registry" - "github.com/sirupsen/logrus" "github.com/stretchr/testify/require" + + "github.com/operator-framework/operator-registry/pkg/image" + "github.com/operator-framework/operator-registry/pkg/registry" ) func TestStrandedBundleRemover(t *testing.T) { logrus.SetLevel(logrus.DebugLevel) - db, cleanup := CreateTestDb(t) + db, cleanup := CreateTestDB(t) defer cleanup() store, err := NewSQLLiteLoader(db) require.NoError(t, err) @@ -43,7 +43,7 @@ func TestStrandedBundleRemover(t *testing.T) { querier := NewSQLLiteQuerierFromDb(db) packageBundles, err := querier.GetBundlesForPackage(context.TODO(), "prometheus") require.NoError(t, err) - require.Equal(t, 1, len(packageBundles)) + require.Len(t, packageBundles, 1) rows, err := db.QueryContext(context.TODO(), "select * from operatorbundle") require.NoError(t, err) @@ -63,7 +63,7 @@ func TestStrandedBundleRemover(t *testing.T) { // other bundles in the package still exist, but the bundle is removed packageBundles, err = querier.GetBundlesForPackage(context.TODO(), "prometheus") require.NoError(t, err) - require.Equal(t, 1, len(packageBundles)) + require.Len(t, packageBundles, 1) rows, err = db.QueryContext(context.TODO(), "select * from operatorbundle") require.NoError(t, err) @@ -75,7 +75,6 @@ func TestStrandedBundleRemover(t *testing.T) { require.NoError(t, err) require.False(t, rows.Next()) require.NoError(t, rows.Close()) - } func rowCount(rows *sql.Rows) int { diff --git a/registry.Dockerfile b/registry.Dockerfile index 0f3c729ec..5267a85aa 100644 --- a/registry.Dockerfile +++ b/registry.Dockerfile @@ -1,11 +1,11 @@ -FROM golang:1.23-alpine as builder +FROM golang:1.23-alpine AS builder RUN apk update && apk add sqlite build-base git mercurial bash WORKDIR /build COPY . . RUN make static -RUN GRPC_HEALTH_PROBE_VERSION=v0.4.28 && \ +RUN GRPC_HEALTH_PROBE_VERSION=$(go list -m github.com/grpc-ecosystem/grpc-health-probe| awk '{print $2}') && \ wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-$(go env GOARCH) && \ chmod +x /bin/grpc_health_probe diff --git a/release/goreleaser.opm.Dockerfile b/release/goreleaser.opm.Dockerfile index 10b2cffab..96c70d6d2 100644 --- a/release/goreleaser.opm.Dockerfile +++ b/release/goreleaser.opm.Dockerfile @@ -2,7 +2,7 @@ # build opm images. See the configurations in .goreleaser.yaml # and .github/workflows/release.yaml. -FROM ghcr.io/grpc-ecosystem/grpc-health-probe:v0.4.29 as grpc_health_probe +FROM ghcr.io/grpc-ecosystem/grpc-health-probe:v0.4.37 AS grpc_health_probe FROM gcr.io/distroless/static:debug COPY --from=grpc_health_probe /ko-app/grpc-health-probe /bin/grpc_health_probe COPY ["nsswitch.conf", "/etc/nsswitch.conf"] diff --git a/test/e2e/bundle_image_test.go b/test/e2e/bundle_image_test.go index cf48dd35e..3bc52350b 100644 --- a/test/e2e/bundle_image_test.go +++ b/test/e2e/bundle_image_test.go @@ -276,7 +276,7 @@ func pushLoadImages(client *kubernetes.Clientset, w io.Writer, images ...string) } } else { for _, image := range images { - pushWith("docker", image) + err := pushWith("docker", image) if err != nil { return err } diff --git a/test/e2e/ctx/ctx.go b/test/e2e/ctx/ctx.go index abea31506..ca54c7426 100644 --- a/test/e2e/ctx/ctx.go +++ b/test/e2e/ctx/ctx.go @@ -4,14 +4,17 @@ import ( "fmt" "strings" + // nolint: stylecheck . "github.com/onsi/ginkgo/v2" - operatorsv1 "github.com/operator-framework/api/pkg/operators/v1" - operatorsv1alpha1 "github.com/operator-framework/api/pkg/operators/v1alpha1" + apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" "k8s.io/apimachinery/pkg/runtime" kscheme "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/rest" k8scontrollerclient "sigs.k8s.io/controller-runtime/pkg/client" + + operatorsv1 "github.com/operator-framework/api/pkg/operators/v1" + operatorsv1alpha1 "github.com/operator-framework/api/pkg/operators/v1alpha1" ) var ctx TestContext diff --git a/test/e2e/ctx/provisioner_kubeconfig.go b/test/e2e/ctx/provisioner_kubeconfig.go index 1ce1980d7..05a16f10f 100644 --- a/test/e2e/ctx/provisioner_kubeconfig.go +++ b/test/e2e/ctx/provisioner_kubeconfig.go @@ -26,6 +26,7 @@ func Provision(ctx *TestContext) (func(), error) { } f, err := os.Open(path) + // nolint:nestif if os.IsNotExist(err) { // try in-cluster config // see https://github.com/coreos/etcd-operator/issues/731#issuecomment-283804819 diff --git a/test/e2e/e2e_suite_test.go b/test/e2e/e2e_suite_test.go index 366c364b0..4785e60df 100644 --- a/test/e2e/e2e_suite_test.go +++ b/test/e2e/e2e_suite_test.go @@ -9,6 +9,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" + "github.com/spf13/cobra" opmroot "github.com/operator-framework/operator-registry/cmd/opm/root" diff --git a/test/e2e/opm_bundle_test.go b/test/e2e/opm_bundle_test.go index 18464b9bb..b1161fea6 100644 --- a/test/e2e/opm_bundle_test.go +++ b/test/e2e/opm_bundle_test.go @@ -9,6 +9,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" + "golang.org/x/mod/sumdb/dirhash" libimage "github.com/operator-framework/operator-registry/pkg/lib/image" diff --git a/test/e2e/opm_test.go b/test/e2e/opm_test.go index b9bd16e30..e2cc8af90 100644 --- a/test/e2e/opm_test.go +++ b/test/e2e/opm_test.go @@ -11,6 +11,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" + "github.com/otiai10/copy" "github.com/sirupsen/logrus" "k8s.io/apimachinery/pkg/util/rand" @@ -228,7 +229,6 @@ func exportPackageWith(containerTool string) error { } func exportIndexImageWith(containerTool string) error { - logger := logrus.NewEntry(logrus.New()) indexExporter := indexer.NewIndexExporter(containertools.NewContainerTool(containerTool, containertools.NoneTool), logger) diff --git a/upstream-builder.Dockerfile b/upstream-builder.Dockerfile index 1e1c122ae..3dd263fc7 100644 --- a/upstream-builder.Dockerfile +++ b/upstream-builder.Dockerfile @@ -1,11 +1,11 @@ -FROM golang:1.23-alpine as builder +FROM golang:1.23-alpine AS builder RUN apk update && apk add sqlite build-base git mercurial bash linux-headers WORKDIR /build COPY . . RUN make static -RUN GRPC_HEALTH_PROBE_VERSION=v0.4.28 && \ +RUN GRPC_HEALTH_PROBE_VERSION=$(go list -m github.com/grpc-ecosystem/grpc-health-probe| awk '{print $2}') && \ wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-$(go env GOARCH) && \ chmod +x /bin/grpc_health_probe diff --git a/upstream-opm-builder.Dockerfile b/upstream-opm-builder.Dockerfile index f8c0d0755..c2e37ae3d 100644 --- a/upstream-opm-builder.Dockerfile +++ b/upstream-opm-builder.Dockerfile @@ -14,7 +14,7 @@ WORKDIR /build COPY . . RUN make static -RUN GRPC_HEALTH_PROBE_VERSION=v0.4.28 && \ +RUN GRPC_HEALTH_PROBE_VERSION=$(go list -m github.com/grpc-ecosystem/grpc-health-probe| awk '{print $2}') && \ wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-$(go env GOARCH) && \ chmod +x /bin/grpc_health_probe