annotations

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2018 License: Apache-2.0 Imports: 5 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BDImageAnnotationPrefix = "quality.image.openshift.io"

BDImageAnnotationPrefix is the prefix used for BlackDuckAnnotations in image annotations

View Source
var BDPodAnnotationPrefix = "quality.pod.openshift.io"

BDPodAnnotationPrefix is the prefix used for BlackDuckAnnotations in pod annotations

Functions

func CompareBlackDuckAnnotationJSON

func CompareBlackDuckAnnotationJSON(old string, new string) bool

CompareBlackDuckAnnotationJSON takes 2 strings that are marshaled BlackDuckAnnotations and compares them. Returns true if the unmarshaling is successful and the values are the same.

func CreateImageAnnotations

func CreateImageAnnotations(imageAnnotations *BlackDuckImageAnnotation, name string, count int) map[string]string

CreateImageAnnotations returns a map of annotations from a BlackDuckImageAnnotation object

func CreateImageLabels

func CreateImageLabels(imageAnnotations *BlackDuckImageAnnotation, name string, count int) map[string]string

CreateImageLabels returns a map of labels from a BlackDuckImageAnnotation object

func CreatePodAnnotations

func CreatePodAnnotations(podAnnotations *BlackDuckPodAnnotation) map[string]string

CreatePodAnnotations returns a map of annotations from a BlackDuckPodAnnotation object

func CreatePodLabels

func CreatePodLabels(podAnnotations *BlackDuckPodAnnotation) map[string]string

CreatePodLabels returns a map of labels from a BlackDuckPodAnnotation object

func MapContainsBlackDuckEntries

func MapContainsBlackDuckEntries(origMap map[string]string, newMap map[string]string) bool

MapContainsBlackDuckEntries returns true if the origMap contains all the important blackduck entries from the newMap

func StringMapContains

func StringMapContains(bigMap map[string]string, subset map[string]string) bool

StringMapContains will return true all the key/value pairs in subset exist and are the same in bigMap

Types

type BlackDuckAnnotation

type BlackDuckAnnotation struct {
	Name        string         `json:"name"`
	Description string         `json:"description"`
	Timestamp   int64          `json:"timestamp"`
	Reference   string         `json:"reference"`
	Compliant   bool           `json:"compliant"`
	Summary     []summaryEntry `json:"summary"`
}

BlackDuckAnnotation create annotations that correspong to the Openshift Containr Security guide (https://people.redhat.com/aweiteka/docs/preview/20170510/security/container_content.html)

func CreateBlackDuckPolicyAnnotation

func CreateBlackDuckPolicyAnnotation(hasPolicyViolations bool, url string, policyCount int) *BlackDuckAnnotation

CreateBlackDuckPolicyAnnotation returns an annotation containing policy violations

func CreateBlackDuckVulnerabilityAnnotation

func CreateBlackDuckVulnerabilityAnnotation(hasVulns bool, url string, vulnCount int) *BlackDuckAnnotation

CreateBlackDuckVulnerabilityAnnotation returns an annotation containing vulnerabilities

func NewBlackDuckAnnotationFromJSON

func NewBlackDuckAnnotationFromJSON(data string) (*BlackDuckAnnotation, error)

NewBlackDuckAnnotationFromJSON takes a string that is a marshaled BlackDuckAnnotation struct and returns a BlackDuckAnnotation

func (*BlackDuckAnnotation) AsString

func (bda *BlackDuckAnnotation) AsString() string

AsString makes a map corresponding to the Openshift Container Security guide (https://people.redhat.com/aweiteka/docs/preview/20170510/security/container_content.html)

func (*BlackDuckAnnotation) Compare

func (bda *BlackDuckAnnotation) Compare(newBda *BlackDuckAnnotation) bool

Compare checks if the passed in BlackDuckAnnotation contains the same values while ignoring fields that will be different (like timestamp). Returns true if the values are the same, false otherwise

type BlackDuckImageAnnotation

type BlackDuckImageAnnotation struct {
	// contains filtered or unexported fields
}

BlackDuckImageAnnotation describes the data model for image annotation

func NewBlackDuckImageAnnotation

func NewBlackDuckImageAnnotation(policyViolationCount int, vulnerabilityCount int, overallStatus string, url string, hubVersion string, scVersion string) *BlackDuckImageAnnotation

NewBlackDuckImageAnnotation creates a new BlackDuckImageAnnotation object

func (*BlackDuckImageAnnotation) GetComponentsURL

func (bdia *BlackDuckImageAnnotation) GetComponentsURL() string

GetComponentsURL returns the image componenets URL

func (*BlackDuckImageAnnotation) GetHubVersion

func (bdia *BlackDuckImageAnnotation) GetHubVersion() string

GetHubVersion returns the version of the hub that provided the information

func (*BlackDuckImageAnnotation) GetOverallStatus

func (bdia *BlackDuckImageAnnotation) GetOverallStatus() string

GetOverallStatus returns the image overall status

func (*BlackDuckImageAnnotation) GetPolicyViolationCount

func (bdia *BlackDuckImageAnnotation) GetPolicyViolationCount() int

GetPolicyViolationCount returns the number of image policy violations

func (*BlackDuckImageAnnotation) GetScanClientVersion

func (bdia *BlackDuckImageAnnotation) GetScanClientVersion() string

GetScanClientVersion returns the version of the scan client used to scan the image

func (*BlackDuckImageAnnotation) GetVulnerabilityCount

func (bdia *BlackDuckImageAnnotation) GetVulnerabilityCount() int

GetVulnerabilityCount returns the number of image vulnerabilities

func (*BlackDuckImageAnnotation) HasPolicyViolations

func (bdia *BlackDuckImageAnnotation) HasPolicyViolations() bool

HasPolicyViolations returns true if the image has any policy violations

func (*BlackDuckImageAnnotation) HasVulnerabilities

func (bdia *BlackDuckImageAnnotation) HasVulnerabilities() bool

HasVulnerabilities returns true if the image has any vulnerabilities

type BlackDuckPodAnnotation

type BlackDuckPodAnnotation struct {
	// contains filtered or unexported fields
}

BlackDuckPodAnnotation describes the data model for pod annotation

func NewBlackDuckPodAnnotation

func NewBlackDuckPodAnnotation(policyViolationCount int, vulnerabilityCount int, overallStatus string, hubVersion string, scVersion string) *BlackDuckPodAnnotation

NewBlackDuckPodAnnotation creates a new BlackDuckPodAnnotation object

func (*BlackDuckPodAnnotation) GetHubVersion

func (bdpa *BlackDuckPodAnnotation) GetHubVersion() string

GetHubVersion returns the version of the hub that provided the information

func (*BlackDuckPodAnnotation) GetOverallStatus

func (bdpa *BlackDuckPodAnnotation) GetOverallStatus() string

GetOverallStatus returns the pod overall status

func (*BlackDuckPodAnnotation) GetPolicyViolationCount

func (bdpa *BlackDuckPodAnnotation) GetPolicyViolationCount() int

GetPolicyViolationCount returns the number of pod policy violations

func (*BlackDuckPodAnnotation) GetScanClientVersion

func (bdpa *BlackDuckPodAnnotation) GetScanClientVersion() string

GetScanClientVersion returns the version of the scan client used to scan the images

func (*BlackDuckPodAnnotation) GetVulnerabilityCount

func (bdpa *BlackDuckPodAnnotation) GetVulnerabilityCount() int

GetVulnerabilityCount returns the number of pod vulnerabilities

func (*BlackDuckPodAnnotation) HasPolicyViolations

func (bdpa *BlackDuckPodAnnotation) HasPolicyViolations() bool

HasPolicyViolations returns true if the pod has any policy violations

func (*BlackDuckPodAnnotation) HasVulnerabilities

func (bdpa *BlackDuckPodAnnotation) HasVulnerabilities() bool

HasVulnerabilities returns true if the pod has any vulnerabilities

Jump to

Keyboard shortcuts

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