issuewriter

package
v0.25.1 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GithubIssueWriter

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

GithubIssueWriter is responsible for creating Github issues to track vulnerabilities that have been discovered in images within a release. It is configured with a Predicate that filters which releases to write issues for, and which to skip

func (*GithubIssueWriter) Write

func (g *GithubIssueWriter) Write(
	ctx context.Context,
	release *github.RepositoryRelease,
	vulnerabilityMarkdown string,
) error

Creates/Updates a Github Issue per release The github issue will have the markdown table report of the image's vulnerabilities example: https://github.com/solo-io/solo-projects/issues/2458

type GithubRepo

type GithubRepo struct {
	RepoName string
	Owner    string
}

func (GithubRepo) Address

func (r GithubRepo) Address() string

type IssueWriter

type IssueWriter interface {
	// Write writes `contents`, the results of a scan of the images in `release`, to a location
	// designated by the implementation.
	Write(ctx context.Context, release *github.RepositoryRelease, contents string) error
}

IssueWriter writes the generated contents of a scan to a location, either a file on the local filesystem or a GitHub issue.

func NewGithubIssueWriter

func NewGithubIssueWriter(repo GithubRepo, client *github.Client, issuePredicate githubutils.RepositoryReleasePredicate) IssueWriter

func NewLocalIssueWriter

func NewLocalIssueWriter(outputDir string) (IssueWriter, error)

func NewNoopWriter

func NewNoopWriter() IssueWriter

type LocalIssueWriter

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

LocalIssueWriter writes the scan results to a file on the local file system.

func (*LocalIssueWriter) Write

func (l *LocalIssueWriter) Write(_ context.Context, release *github.RepositoryRelease, contents string) error

type NoopWriter

type NoopWriter struct{}

NoopWriter provides a no-op implementation of the IssueWriter interface, used when the specified scan action is `none`.

func (*NoopWriter) Write

Jump to

Keyboard shortcuts

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