Documentation ¶
Index ¶
- func BuildConnectURL(projectID string) string
- func BuildOverviewURL(projectID string) string
- func BuildScanResultsURL(projectID string, imageID string) string
- func GetContainerPolicyExceptions(ctx context.Context, pc PyxisClient) (policy.Policy, error)
- type ContainerCertificationSubmitter
- type NoopSubmitter
- type PyxisClient
- type ResultSubmitter
- type ResultWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildConnectURL ¶
func BuildOverviewURL ¶
func BuildScanResultsURL ¶
func GetContainerPolicyExceptions ¶
GetContainerPolicyExceptions will query Pyxis to determine if a given project has a certification excemptions, such as root or scratch. This will then return the corresponding policy.
If no policy exception flags are found on the project, the standard container policy is returned.
Types ¶
type ContainerCertificationSubmitter ¶
type ContainerCertificationSubmitter struct { CertificationProjectID string Pyxis PyxisClient DockerConfig string PreflightLogFile string }
ContainerCertificationSubmitter submits container results to Pyxis, and implements a ResultSubmitter.
type NoopSubmitter ¶
type NoopSubmitter struct {
// contains filtered or unexported fields
}
NoopSubmitter is a no-op ResultSubmitter that optionally logs a message and a reason as to why results were not submitted.
func NewNoopSubmitter ¶
func NewNoopSubmitter(emitLog bool, log *logr.Logger) *NoopSubmitter
func (*NoopSubmitter) SetEmitLog ¶
func (s *NoopSubmitter) SetEmitLog(emitLog bool)
func (*NoopSubmitter) SetReason ¶
func (s *NoopSubmitter) SetReason(reason string)
type PyxisClient ¶
type PyxisClient interface { FindImagesByDigest(ctx context.Context, digests []string) ([]pyxis.CertImage, error) GetProject(context.Context) (*pyxis.CertProject, error) SubmitResults(context.Context, *pyxis.CertificationInput) (*pyxis.CertificationResults, error) }
PyxisClient defines pyxis API interactions that are relevant to check executions in cmd.
func NewPyxisClient ¶
func NewPyxisClient(ctx context.Context, projectID, token, host string) PyxisClient
NewPyxisClient initializes a pyxisClient with relevant information from cfg. If the the CertificationProjectID, PyxisAPIToken, or PyxisHost are empty, then nil is returned. Callers should treat a nil pyxis client as an indicator that pyxis calls should not be made.
type ResultSubmitter ¶
ResultSubmitter defines methods associated with submitting results to Red HAt.
func ResolveSubmitter ¶
func ResolveSubmitter(pc PyxisClient, projectID, dockerconfig, logfile string) ResultSubmitter
ResolveSubmitter will build out a ResultSubmitter if the provided pyxisClient, pc, is not nil. The pyxisClient is a required component of the submitter. If pc is nil, then a noop submitter is returned instead, which does nothing.
type ResultWriter ¶
type ResultWriter interface { OpenFile(name string) (io.WriteCloser, error) io.WriteCloser }
ResultWriter defines methods associated with writing check results.