Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding hotfix to syft version #222

Merged
merged 1 commit into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions adapters/v1/syft.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
Loading