diff --git a/adapters/v1/syft.go b/adapters/v1/syft.go index 6037cbc..4f51ee5 100644 --- a/adapters/v1/syft.go +++ b/adapters/v1/syft.go @@ -4,12 +4,13 @@ import ( "context" "errors" "fmt" - "github.com/google/go-containerregistry/pkg/name" - "github.com/opencontainers/go-digest" "runtime" "strings" "time" + "github.com/google/go-containerregistry/pkg/name" + "github.com/opencontainers/go-digest" + helpersv1 "github.com/kubescape/k8s-interface/instanceidhandler/v1/helpers" "github.com/anchore/clio" @@ -260,5 +261,11 @@ func detectSource(userInput string, opts *packagesOptions, registryOptions *imag // Version returns Syft's version which is used to tag SBOMs func (s *SyftAdapter) Version() string { - return tools.PackageVersion("github.com/anchore/syft") + v := tools.PackageVersion("github.com/anchore/syft") + if v == "unknown" || v == "" { + return v + } + // we added a hotfix in the storage, so we need to append it to the version so the SBOM will be re-created + // remove the hotfix suffix next upgrade of the syft version + return v + "-hotfix" } diff --git a/go.mod b/go.mod index dd34a70..8679927 100644 --- a/go.mod +++ b/go.mod @@ -26,7 +26,7 @@ require ( github.com/kubescape/backend v0.0.18-0.20231228073313-741ad2d0a7ad github.com/kubescape/go-logger v0.0.22 github.com/kubescape/k8s-interface v0.0.162 - github.com/kubescape/storage v0.0.74 + github.com/kubescape/storage v0.0.79 github.com/opencontainers/go-digest v1.0.0 github.com/openvex/go-vex v0.2.5 github.com/spf13/viper v1.17.0 diff --git a/go.sum b/go.sum index 55daee2..5472b50 100644 --- a/go.sum +++ b/go.sum @@ -880,8 +880,8 @@ github.com/kubescape/opa-utils v0.0.268 h1:mIsAbpIW0aIk8xr0ECuf8q9gUntGQqJQIJACt github.com/kubescape/opa-utils v0.0.268/go.mod h1:95JkuIOfClgLc+DyGb2mDvefRW0STkZe4L2z6AaZJlQ= github.com/kubescape/rbac-utils v0.0.20 h1:1MMxsCsCZ3ntDi8f9ZYYcY+K7bv50bDW5ZvnGnhMhJw= github.com/kubescape/rbac-utils v0.0.20/go.mod h1:t57AhSrjuNGQ+mpZWQM/hBzrCOeKBDHegFoVo4tbikQ= -github.com/kubescape/storage v0.0.74 h1:Fdogm2799K6koPKezmcbimDa3+X9rm92BuLvOiJkKP8= -github.com/kubescape/storage v0.0.74/go.mod h1:ttwWSuxDyckuB014uPHBs23zSdFZx6TMD0MZHlwuw+0= +github.com/kubescape/storage v0.0.79 h1:APvBd00/OYjNMvMgOhdiiIFSUzy/wUyLzb92xjcmuqw= +github.com/kubescape/storage v0.0.79/go.mod h1:ttwWSuxDyckuB014uPHBs23zSdFZx6TMD0MZHlwuw+0= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q=