v1beta1

package
v0.0.0-...-dd22938 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

+k8s:deepcopy-gen=package +k8s:defaulter-gen=TypeMeta +groupName=shipwright.io

Index

Constants

This section is empty.

Variables

View Source
var (
	// SchemeBuilder collects functions that add things to a scheme. It's to allow
	// code to compile without explicitly referencing generated types. You should
	// declare one in each package that will have generated deep copy or conversion
	SchemeBuilder runtime.SchemeBuilder

	// AddToScheme applies all the stored functions to the scheme. A non-nil error
	// indicates that one function failed and the attempt was abandoned.
	AddToScheme = localSchemeBuilder.AddToScheme
)
View Source
var (
	// MaxScanAttempts holds how many times we gonna try to scan an ImageImport object
	// before giving up.
	MaxScanAttempts = 10
)
View Source
var SchemeGroupVersion = schema.GroupVersion{
	Group:   "shipwright.io",
	Version: "v1beta1",
}

SchemeGroupVersion is the group/version for Image resources.

Functions

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

Types

type Failure

type Failure struct {
	When  metav1.Time `json:"when"`
	Error string      `json:"error"`
}

Failure represents a failure during a scan attempt. It is a very generic struct that serves the purpose of just keeping a list of errors found during image scan attempts.

func (*Failure) DeepCopy

func (in *Failure) DeepCopy() *Failure

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Failure.

func (*Failure) DeepCopyInto

func (in *Failure) DeepCopyInto(out *Failure)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ImageReference

type ImageReference struct {
	Name      string    `json:"name"`
	Namespace string    `json:"namespace"`
	UID       types.UID `json:"uid"`
}

ImageReference holds a reference to a single Shipwright Image object.

type ImageScan

type ImageScan struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Status            ImageScanStatus `json:"status"`
}

ImageScan holds the result of an Image vulnerability scan. ImageScans scope is global, we do not keep them per namespace. All ImageScans are named after the image layer hash.

func (*ImageScan) AssureReference

func (s *ImageScan) AssureReference(img *imgv1b1.Image)

AssureReference makes sure that the ImageScan has a reference to provided Image in its status.

func (*ImageScan) DeepCopy

func (in *ImageScan) DeepCopy() *ImageScan

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageScan.

func (*ImageScan) DeepCopyInto

func (in *ImageScan) DeepCopyInto(out *ImageScan)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ImageScan) DeepCopyObject

func (in *ImageScan) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*ImageScan) DeleteReference

func (s *ImageScan) DeleteReference(delref ImageReference)

DeleteReference deletes an Image reference from the list of references.

func (*ImageScan) Executed

func (s *ImageScan) Executed() bool

Executed returns true if the scan has already been executed in the past.

func (*ImageScan) HasFailed

func (s *ImageScan) HasFailed() bool

HasFailed returns if we still have attempts to be executed. i.e. if we have failed more than MaxScanAttempts attempts.

func (*ImageScan) HasReference

func (s *ImageScan) HasReference(img *imgv1b1.Image) bool

HasReference returns if the ImageScan has a reference to provided Image.

func (*ImageScan) HasReferences

func (s *ImageScan) HasReferences() bool

HasReferences returns true if the ImageScan contains one or more Image references in its status

func (*ImageScan) PrependFailure

func (s *ImageScan) PrependFailure(err error)

PrependFailure prepends a failure to the scan list of failures. Keep at max MaxScanAttempts failures before rotating them.

type ImageScanList

type ImageScanList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
	Items           []ImageScan `json:"items" protobuf:"bytes,2,rep,name=items"`
}

ImageScanList holds a list of ImageScan objects.

func (*ImageScanList) DeepCopy

func (in *ImageScanList) DeepCopy() *ImageScanList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageScanList.

func (*ImageScanList) DeepCopyInto

func (in *ImageScanList) DeepCopyInto(out *ImageScanList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ImageScanList) DeepCopyObject

func (in *ImageScanList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ImageScanStatus

type ImageScanStatus struct {
	Failures        []Failure        `json:"failures,omitempty"`
	FinishedAt      *metav1.Time     `json:"finishedAt,omitempty"`
	Vulnerabilities []Vulnerability  `json:"vulnerabilities,omitempty"`
	References      []ImageReference `json:"references,omitempty"`
}

ImageScanStatus hold the status for the last image scan this operator ran.

func (*ImageScanStatus) DeepCopy

func (in *ImageScanStatus) DeepCopy() *ImageScanStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageScanStatus.

func (*ImageScanStatus) DeepCopyInto

func (in *ImageScanStatus) DeepCopyInto(out *ImageScanStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Vulnerability

type Vulnerability struct {
	ID          string `json:"id"`
	Severity    string `json:"severity"`
	Description string `json:"description"`
}

Vulnerability describes a vulnerability found in an image. ID points to a CVE while severity is scanner dependant.

func (*Vulnerability) DeepCopy

func (in *Vulnerability) DeepCopy() *Vulnerability

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Vulnerability.

func (*Vulnerability) DeepCopyInto

func (in *Vulnerability) DeepCopyInto(out *Vulnerability)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Directories

Path Synopsis
generated
clientset/versioned
This package has the automatically generated clientset.
This package has the automatically generated clientset.
clientset/versioned/fake
This package has the automatically generated fake clientset.
This package has the automatically generated fake clientset.
clientset/versioned/scheme
This package contains the scheme of the automatically generated clientset.
This package contains the scheme of the automatically generated clientset.
clientset/versioned/typed/scans/v1beta1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
clientset/versioned/typed/scans/v1beta1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.

Jump to

Keyboard shortcuts

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