v1.7.8 Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Dec 4, 2020 License: Apache-2.0 Imports: 9 Imported by: 120




This section is empty.


This section is empty.


func ParseClairSev

func ParseClairSev(clairSev string) models.Severity

ParseClairSev parse the severity of clair to Harbor's Severity type if the string is not recognized the value will be set to unknown.

func TransformVuln added in v1.5.0

func TransformVuln(clairVuln *models.ClairLayerEnvelope) (*models.ComponentsOverview, models.Severity)

TransformVuln is for running scanning job in both job service V1 and V2.

func UpdateScanOverview

func UpdateScanOverview(digest, layerName string, clairEndpoint string, l ...*log.Logger) error

UpdateScanOverview qeuries the vulnerability based on the layerName and update the record in img_scan_overview table based on digest.


type Client

type Client struct {
	// contains filtered or unexported fields

Client communicates with clair endpoint to scan image and get detailed scan result

func NewClient

func NewClient(endpoint string, logger *log.Logger) *Client

NewClient creates a new instance of client, set the logger as the job's logger if it's used in a job handler.

func (*Client) DeleteNotification

func (c *Client) DeleteNotification(id string) error

DeleteNotification deletes a notification record from Clair

func (*Client) GetNotification

func (c *Client) GetNotification(id string) (*models.ClairNotification, error)

GetNotification calls Clair's API to get details of notification

func (*Client) GetResult

func (c *Client) GetResult(layerName string) (*models.ClairLayerEnvelope, error)

GetResult calls Clair's API to get layers with detailed vulnerability list

func (*Client) ListNamespaces

func (c *Client) ListNamespaces() ([]string, error)

ListNamespaces list the namespaces in Clair

func (*Client) ScanLayer

func (c *Client) ScanLayer(l models.ClairLayer) error

ScanLayer calls Clair's API to scan a layer.


Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL