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)
- func PreflightCheck(ctx context.Context, cfg *runtime.Config, pc PyxisClient, ...) error
- type CheckContainerRunner
- type CheckOperatorRunner
- 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.
func PreflightCheck ¶
func PreflightCheck( ctx context.Context, cfg *runtime.Config, pc PyxisClient, eng engine.CheckEngine, formatter formatters.ResponseFormatter, rw ResultWriter, rs ResultSubmitter, ) error
PreflightCheck executes checks, interacts with pyxis, format output, writes, and submits results.
Types ¶
type CheckContainerRunner ¶
type CheckContainerRunner struct {
Cfg *runtime.Config
Pc PyxisClient
Eng engine.CheckEngine
Formatter formatters.ResponseFormatter
Rw ResultWriter
Rs ResultSubmitter
}
CheckContainerRunner contains all of the components necessary to run checkContainer.
func NewCheckContainerRunner ¶
type CheckOperatorRunner ¶
type CheckOperatorRunner struct {
Cfg *runtime.Config
Eng engine.CheckEngine
Formatter formatters.ResponseFormatter
Rw ResultWriter
}
CheckOperatorRunner contains all of the components necessary to run checkOperator.
func NewCheckOperatorRunner ¶
NewCheckOperatorRunner returns a CheckOperatorRunner containing all of the tooling necessary to run checkOperator.
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, reason string, log *log.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, cfg certification.Config) 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, cfg certification.Config) 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.