forked from ckotzbauer/sbom-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtarget.go
More file actions
26 lines (22 loc) · 717 Bytes
/
target.go
File metadata and controls
26 lines (22 loc) · 717 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package main
import (
libk8s "github.com/ckotzbauer/libk8soci/pkg/kubernetes"
"github.com/ckotzbauer/libk8soci/pkg/oci"
"github.com/l3montree-dev/devguard-operator/kubernetes"
)
type TargetContext struct {
Image *oci.RegistryImage
Container *libk8s.ContainerInfo
Pod *libk8s.PodInfo
Sbom string
}
type Target interface {
Initialize() error
ValidateConfig() error
ProcessSbom(ctx *TargetContext) error
LoadImages() ([]kubernetes.ImageInNamespace, error)
Remove(images []kubernetes.ImageInNamespace) error
}
func NewContext(sbom string, image *oci.RegistryImage, container *libk8s.ContainerInfo, pod *libk8s.PodInfo) *TargetContext {
return &TargetContext{image, container, pod, sbom}
}