chore: fix dependabot alerts (#3070)

* chore: fix dependabot alerts

Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>

* ci: fix linter config

* fix: linter fixes

Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>

---------

Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>
This commit is contained in:
Ramkumar Chinchani
2025-04-04 00:31:02 -07:00
committed by GitHub
parent cb9b82823a
commit fd761c0254
20 changed files with 310 additions and 285 deletions
+1 -1
View File
@@ -1108,7 +1108,7 @@ func (gen *mockUUIDGenerator) NewV4() (
type errReader int
func (errReader) Read(p []byte) (int, error) {
return 0, errors.New("test error") //nolint:goerr113
return 0, errors.New("test error") //nolint:err113
}
type badDirInfo struct {
+2 -2
View File
@@ -661,7 +661,7 @@ func (service searchService) getImagesByDigest(ctx context.Context, config Searc
if common.IsContextDone(ctx) {
return
}
rch <- stringResult{"", errors.New(errBuilder.String())} //nolint: goerr113
rch <- stringResult{"", errors.New(errBuilder.String())} //nolint: err113
return
}
@@ -723,7 +723,7 @@ func checkResultGraphQLQuery(ctx context.Context, err error, resultErrors []comm
return nil
}
//nolint: goerr113
//nolint: err113
return errors.New(errBuilder.String())
}
+1 -1
View File
@@ -15,7 +15,7 @@ import (
"time"
glob "github.com/bmatcuk/doublestar/v4"
"github.com/mitchellh/mapstructure"
"github.com/go-viper/mapstructure/v2"
distspec "github.com/opencontainers/distribution-spec/specs-go"
"github.com/rs/zerolog/log"
"github.com/spf13/cobra"
+1 -1
View File
@@ -4,7 +4,7 @@
package cli
import (
"github.com/mitchellh/mapstructure"
"github.com/go-viper/mapstructure/v2"
"github.com/rs/zerolog/log"
"github.com/spf13/cobra"
"github.com/spf13/viper"
+1 -1
View File
@@ -44,7 +44,7 @@ import (
type errReader int
func (errReader) Read(p []byte) (int, error) {
return 0, errors.New("test error") //nolint:goerr113
return 0, errors.New("test error") //nolint:err113
}
func TestSignatureHandlers(t *testing.T) {
+1 -1
View File
@@ -448,7 +448,7 @@ func (ms *metricServer) HistogramObserve(hv *HistogramValue) {
}
}
//nolint:goerr113
//nolint:err113
func sanityChecks(name string, knownLabels []string, found bool, labelNames, labelValues []string) error {
if !found {
return fmt.Errorf("metric %s: not found", name)
+1 -1
View File
@@ -1,11 +1,11 @@
package model
import (
"slices"
"strings"
"time"
godigest "github.com/opencontainers/go-digest"
"golang.org/x/exp/slices"
)
type ImageCVESummary struct {
+1 -1
View File
@@ -572,6 +572,6 @@ func TestScanGeneratorWithRealData(t *testing.T) {
So(err, ShouldBeNil)
So(cveSummary.Count, ShouldBeGreaterThanOrEqualTo, 5)
// As of September 22 the max severity is MEDIUM, but new CVEs could appear in the future
So([]string{"MEDIUM", "HIGH", "CRITICAL"}, ShouldContain, cveSummary.MaxSeverity)
So([]string{"MEDIUM", "HIGH", "CRITICAL", "UNKNOWN"}, ShouldContain, cveSummary.MaxSeverity)
})
}
+1 -1
View File
@@ -209,7 +209,7 @@ func (httpClient *Client) MakeGetRequest(ctx context.Context, resultPtr interfac
}
if resp.StatusCode != http.StatusOK {
return nil, nil, resp.StatusCode, errors.New(string(body)) //nolint:goerr113
return nil, nil, resp.StatusCode, errors.New(string(body)) //nolint:err113
}
// read blob
+2 -2
View File
@@ -1113,7 +1113,7 @@ func TestMandatoryAnnotations(t *testing.T) {
imgStore = imagestore.NewImageStore(testDir, cacheDir, false, false, log, metrics,
&mocks.MockedLint{
LintFn: func(repo string, manifestDigest godigest.Digest, imageStore storageTypes.ImageStore) (bool, error) {
//nolint: goerr113
//nolint: err113
return false, errors.New("linter error")
},
}, store, nil, nil)
@@ -1124,7 +1124,7 @@ func TestMandatoryAnnotations(t *testing.T) {
imgStore = imagestore.NewImageStore(cacheDir, cacheDir, true, true, log, metrics,
&mocks.MockedLint{
LintFn: func(repo string, manifestDigest godigest.Digest, imageStore storageTypes.ImageStore) (bool, error) {
//nolint: goerr113
//nolint: err113
return false, errors.New("linter error")
},
}, store, cacheDriver, nil)
+1 -1
View File
@@ -154,7 +154,7 @@ func GetSecureBaseURL(port string) string {
func CustomRedirectPolicy(noOfRedirect int) resty.RedirectPolicy {
return resty.RedirectPolicyFunc(func(req *http.Request, via []*http.Request) error {
if len(via) >= noOfRedirect {
return fmt.Errorf("stopped after %d redirects", noOfRedirect) //nolint: goerr113
return fmt.Errorf("stopped after %d redirects", noOfRedirect) //nolint: err113
}
for key, val := range via[len(via)-1].Header {