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

VEX support #180

Closed
wants to merge 2 commits into from
Closed
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
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -200,3 +200,5 @@ require (
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.3.0 // indirect
)

replace github.com/kubescape/storage => github.com/kubescape/storage v0.0.0-20231016192125-da13f3622eee
12 changes: 12 additions & 0 deletions watcher/watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"github.com/kubescape/k8s-interface/workloadinterface"
"github.com/kubescape/operator/config"
"github.com/kubescape/operator/utils"
spdxv1beta1 "github.com/kubescape/storage/pkg/apis/softwarecomposition/v1beta1"

Check failure on line 21 in watcher/watcher.go

View workflow job for this annotation

GitHub Actions / pr-created / test / Create cross-platform build

missing go.sum entry for module providing package github.com/kubescape/storage/pkg/apis/softwarecomposition/v1beta1 (imported by github.com/kubescape/operator/watcher); to add:
kssc "github.com/kubescape/storage/pkg/generated/clientset/versioned"
"github.com/panjf2000/ants/v2"

Expand Down Expand Up @@ -282,6 +282,18 @@
continue
}

if !slices.Contains(wh.managedInstanceIDSlugs, hashedInstanceID) {
wh.storageClient.SpdxV1beta1().OpenVulnerabilityExchangeContainers(obj.ObjectMeta.Namespace).Delete(context.TODO(), obj.ObjectMeta.Name, v1.DeleteOptions{})
dwertent marked this conversation as resolved.
Show resolved Hide resolved
logger.L().Ctx(context.TODO()).Info(
fmt.Sprintf(
`unrecognized instance ID "%s". Known: "%v", no triggering`,
hashedInstanceID,
wh.managedInstanceIDSlugs,
),
)
continue
}

wlid, ok := obj.ObjectMeta.Annotations[instanceidhandlerv1.WlidMetadataKey]
if !ok {
logger.L().Ctx(context.TODO()).Error(
Expand Down
Loading