Documentation
¶
Index ¶
- func CoreContainerToAPIContainer(coreContainer Container) *api.Container
- func CoreModelToAPIModel(model *Model) *api.CoreModel
- func CorePodToAPIPod(corePod Pod) *api.Pod
- func IsLegalTransition(from ScanStatus, to ScanStatus) bool
- func ScanResults(model *Model) (api.ScanResults, error)
- type Action
- type AddImage
- type AddPod
- type AllImages
- type AllPods
- type Container
- type DeletePod
- type DidFetchScanResults
- type DockerImageSha
- type FinishScanClient
- type GetImages
- type GetMetrics
- type GetModel
- type GetNextImage
- type GetScanResults
- type HubImageScan
- type Image
- type ImageInfo
- func (imageInfo *ImageInfo) AddRepoTag(repoTag *RepoTag)
- func (imageInfo *ImageInfo) FirstRepoTag() *RepoTag
- func (imageInfo *ImageInfo) Image() Image
- func (imageInfo *ImageInfo) SetPriority(priority int)
- func (imageInfo *ImageInfo) SetScanResults(results *hub.ScanResults)
- func (imageInfo *ImageInfo) TimeInCurrentScanStatus() time.Duration
- type ImageTransition
- type Metrics
- type Model
- func (model *Model) AddImage(image Image)
- func (model *Model) AddPod(pod Pod)
- func (model *Model) DeletePod(podName string)
- func (model *Model) FinishScanJob(image *Image, err error)
- func (model *Model) GetImages(status ScanStatus) []DockerImageSha
- func (model *Model) GetMetrics() *Metrics
- func (model *Model) GetModel() *api.CoreModel
- func (model *Model) GetNextImage() *Image
- func (model *Model) GetScanResults() api.ScanResults
- func (model *Model) ScanDidFinish(sha DockerImageSha, scanResults *hub.ScanResults)
- func (model *Model) SetImages(images []Image)
- func (model *Model) SetPods(pods []Pod)
- func (model *Model) StartScanClient(sha DockerImageSha) error
- func (model *Model) UpdatePod(pod Pod)
- type Pod
- type PruneOrphanedImages
- type RepoTag
- type Scan
- type ScanStatus
- type StartScanClient
- type UpdatePod
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CoreContainerToAPIContainer ¶
CoreContainerToAPIContainer .....
func CoreModelToAPIModel ¶
CoreModelToAPIModel .....
func IsLegalTransition ¶ added in v0.0.15
func IsLegalTransition(from ScanStatus, to ScanStatus) bool
IsLegalTransition .....
Types ¶
type DidFetchScanResults ¶
type DidFetchScanResults struct {
Sha DockerImageSha
ScanResults *hub.ScanResults
}
DidFetchScanResults .....
func (*DidFetchScanResults) Apply ¶
func (d *DidFetchScanResults) Apply(model *Model) error
Apply .....
type DockerImageSha ¶
type DockerImageSha string
DockerImageSha .....
func NewDockerImageSha ¶
func NewDockerImageSha(sha string) (DockerImageSha, error)
NewDockerImageSha ensures that the sha is 64 characters.
type FinishScanClient ¶
FinishScanClient .....
type GetImages ¶
type GetImages struct {
Status ScanStatus
Done chan []DockerImageSha
}
GetImages .....
type HubImageScan ¶
type HubImageScan struct {
Sha DockerImageSha
Scan *hub.ScanResults
Err error
}
HubImageScan .....
type Image ¶
type Image struct {
Repository string
Tag string
Sha DockerImageSha
Priority int
}
Image .....
func NewImage ¶
func NewImage(repository string, tag string, sha DockerImageSha, priority int) *Image
NewImage .....
func (Image) HubProjectVersionName ¶
HubProjectVersionName .....
type ImageInfo ¶
type ImageInfo struct {
ScanStatus ScanStatus
TimeOfLastStatusChange time.Time
TimeOfLastRefresh time.Time
ScanResults *hub.ScanResults
ImageSha DockerImageSha
RepoTags []*RepoTag
Priority int
}
ImageInfo .....
func NewImageInfo ¶
func NewImageInfo(sha DockerImageSha, repoTag *RepoTag, priority int) *ImageInfo
NewImageInfo .....
func (*ImageInfo) AddRepoTag ¶
AddRepoTag .....
func (*ImageInfo) FirstRepoTag ¶
FirstRepoTag .....
func (*ImageInfo) SetPriority ¶
SetPriority ...
func (*ImageInfo) SetScanResults ¶
func (imageInfo *ImageInfo) SetScanResults(results *hub.ScanResults)
SetScanResults .....
func (*ImageInfo) TimeInCurrentScanStatus ¶
TimeInCurrentScanStatus .....
type ImageTransition ¶
type ImageTransition struct {
Sha DockerImageSha
From string
To ScanStatus
Err error
Time time.Time
}
ImageTransition .....
func NewImageTransition ¶
func NewImageTransition(sha DockerImageSha, from string, to ScanStatus, err error) *ImageTransition
NewImageTransition .....
type Metrics ¶
type Metrics struct {
ScanStatusCounts map[ScanStatus]int
NumberOfPods int
NumberOfImages int
ContainerCounts map[int]int
ImageCountHistogram map[int]int
PodStatus map[string]int
ImageStatus map[string]int
PodPolicyViolations map[int]int
ImagePolicyViolations map[int]int
PodVulnerabilities map[int]int
ImageVulnerabilities map[int]int
}
Metrics .....
type Model ¶
type Model struct {
// Pods is a map of qualified name ("<namespace>/<name>") to pod
Pods map[string]Pod
Images map[DockerImageSha]*ImageInfo
ImageScanQueue *util.PriorityQueue
ImageTransitions []*ImageTransition
// contains filtered or unexported fields
}
Model is the root of the core model
func (*Model) FinishScanJob ¶
FinishScanJob should be called when the scan client has finished.
func (*Model) GetImages ¶
func (model *Model) GetImages(status ScanStatus) []DockerImageSha
GetImages returns images in that status
func (*Model) GetMetrics ¶
GetMetrics calculates useful metrics for observing the progress of the model over time.
func (*Model) GetScanResults ¶
func (model *Model) GetScanResults() api.ScanResults
GetScanResults ...
func (*Model) ScanDidFinish ¶
func (model *Model) ScanDidFinish(sha DockerImageSha, scanResults *hub.ScanResults)
ScanDidFinish should be called when: - the Hub scan finishes - upon startup, when scan results are first fetched
func (*Model) StartScanClient ¶
func (model *Model) StartScanClient(sha DockerImageSha) error
StartScanClient ...
type PruneOrphanedImages ¶
type PruneOrphanedImages struct {
CompletedImageShas chan []string
}
PruneOrphanedImages .....
type Scan ¶
type Scan struct {
OverallStatus hub.PolicyStatusType
PolicyViolations int
Vulnerabilities int
}
Scan .....
type ScanStatus ¶
type ScanStatus int
ScanStatus describes the state of an image in perceptor
const ( ScanStatusUnknown ScanStatus = iota ScanStatusInQueue ScanStatus = iota ScanStatusRunningScanClient ScanStatus = iota ScanStatusRunningHubScan ScanStatus = iota ScanStatusComplete ScanStatus = iota )
.....
func (ScanStatus) MarshalJSON ¶
func (status ScanStatus) MarshalJSON() ([]byte, error)
MarshalJSON .....
func (ScanStatus) MarshalText ¶
func (status ScanStatus) MarshalText() (text []byte, err error)
MarshalText .....
type StartScanClient ¶
type StartScanClient struct {
Sha DockerImageSha
Error chan error
}
StartScanClient .....
func NewStartScanClient ¶
func NewStartScanClient(sha DockerImageSha) *StartScanClient
NewStartScanClient ...
Source Files
¶
- action.go
- addimage.go
- addpod.go
- allimages.go
- allpods.go
- container.go
- deletepod.go
- didfetchscanresults.go
- dockerimagesha.go
- finishscanclient.go
- getimages.go
- getmetrics.go
- getmodel.go
- getnextimage.go
- getscanresults.go
- hubimagescan.go
- image.go
- imageinfo.go
- imagetransition.go
- metrics.go
- model.go
- modelmetrics.go
- pod.go
- pruneorphanedimages.go
- repotag.go
- scan.go
- scanstatus.go
- startscanclient.go
- updatepod.go
- util.go