diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ef2ab48065..50c2cc8b04 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -87,7 +87,7 @@ jobs: - name: golangci-lint uses: golangci/golangci-lint-action@537aa1903e5d359d0b27dbc19ddd22c5087f3fbc # v3 with: - version: v1.48 + version: v1.49 args: --build-tags integration,containers_image_storage_stub --timeout 300s prepare: diff --git a/.golangci.yml b/.golangci.yml index d713722264..b9ec49c24b 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -15,28 +15,15 @@ linters-settings: linters: disable-all: true enable: - - deadcode - gci - goimports - gosimple - govet - ineffassign - staticcheck - - structcheck - typecheck - unused - - varcheck - misspell service: - golangci-lint-version: 1.48.x # use the fixed version to not introduce new linters unexpectedly - -issues: - exclude-rules: - # These are needed because it thinks that FromUnparsedImage can't return nil, however if you go JUST 2 levels down, then you will find several cases when it can be nil - - path: src/controllers/dynakube/version/version_image.go - linters: - - staticcheck - - linters: - - staticcheck - text: "github.com/containers/image/v5/image.FromUnparsedImage never returns a nil interface value" + golangci-lint-version: 1.49.x # use the fixed version to not introduce new linters unexpectedly diff --git a/src/controllers/dynakube/version/version_image.go b/src/controllers/dynakube/version/version_image.go index a1c882be25..4644f01888 100644 --- a/src/controllers/dynakube/version/version_image.go +++ b/src/controllers/dynakube/version/version_image.go @@ -57,8 +57,6 @@ func GetImageVersion(imageName string, dockerConfig *dockerconfig.DockerConfig) sourceImage, err := image.FromUnparsedImage(context.TODO(), systemContext, image.UnparsedInstance(imageSource, nil)) if err != nil { return ImageVersion{}, err - } else if sourceImage == nil { - return ImageVersion{}, fmt.Errorf("could not find image: '%s'", transportImageName) } inspectedImage, err := sourceImage.Inspect(context.TODO())