agent

package
v17.4.1 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2024 License: MIT Imports: 35 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// ErrImagePullBackOff - Container image pull failed, kubelet is backing off image pull
	ErrImagePullBackOff = "ImagePullBackOff"
	// ErrImageInspect - Unable to inspect imag
	ErrImageInspect = "ImageInspectError"
	// ErrImagePull - General image pull error
	ErrImagePull = "ErrImagePull"
	// ErrImageNeverPull - Required Image is absent on host and PullPolicy is NeverPullImage
	ErrImageNeverPull = "ErrImageNeverPull"
	// ErrInvalidImageName - Unable to parse the image name.
	ErrInvalidImageName = "InvalidImageName"
)

Variables

View Source
var TrivyScanner = report.ScannerDetails{
	ID:   "starboard_trivy",
	Name: "Trivy (via Starboard Operator)",
	Vendor: report.Vendor{
		Name: "GitLab",
	},
}

Functions

This section is empty.

Types

type CronScheduler

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

CronScheduler can run tasks on a cron schedule, with cancellation.

func NewCronScheduler

func NewCronScheduler() *CronScheduler

func (*CronScheduler) Run

func (s *CronScheduler) Run(ctx context.Context)

func (*CronScheduler) Schedule

func (s *CronScheduler) Schedule(ctx context.Context, schedule cron.Schedule, job Job)

type Factory

type Factory struct{}

func (*Factory) IsProducingLeaderModules

func (f *Factory) IsProducingLeaderModules() bool

func (*Factory) Name

func (f *Factory) Name() string

func (*Factory) New

func (f *Factory) New(cfg *modagent.Config) (modagent.Module, error)

type Job

type Job interface {
	// Run executes the cron task. It should cancel whatever it
	// is doing upon receiving a signal from ctx.Done.
	Run(context.Context)
}

type Payload

type Payload struct {
	Vulnerability *report.Vulnerability `json:"vulnerability"`
	Scanner       report.ScannerDetails `json:"scanner"`
}

Payload resembles the create-starboard-vulnerability payload of the KAS API https://docs.gitlab.com/ee/development/internal_api/#create-starboard-vulnerability

type Reporter

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

func NewReporter

func NewReporter(log *slog.Logger, api modagent.API) *Reporter

func (*Reporter) ResolveVulnerabilities

func (r *Reporter) ResolveVulnerabilities(ctx context.Context, uuids []string) (retError error)

func (*Reporter) Transmit

func (r *Reporter) Transmit(ctx context.Context, payloads []*Payload) ([]string, error)

type SecurityPolicyConfiguration

type SecurityPolicyConfiguration struct {
	Cadence    string    `json:"cadence"`
	Namespaces []string  `json:"namespaces"`
	UpdatedAt  time.Time `json:"updated_at"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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