Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( DefaultCertImageFilename = "cert-image.json" DefaultRPMManifestFilename = "rpm-manifest.json" DefaultTestResultsFilename = "results.json" DefaultPyxisHost = "catalog.redhat.com/api/containers" DefaultPyxisEnv = "prod" SystemdDir = "/etc/systemd/system" )
Functions ¶
This section is empty.
Types ¶
type Check ¶
type Check interface { // Validate will test the provided image and determine whether the // image complies with the check's requirements. Validate(ctx context.Context, imageReference ImageReference) (result bool, err error) // Name returns the name of the check. Name() string // Metadata returns the check's metadata. Metadata() Metadata // Help return the check's help information Help() HelpText }
Check as an interface containing all methods necessary to use and identify a given check.
func NewGenericCheck ¶
func NewGenericCheck( name string, validatorFn ValidatorFunc, metadata Metadata, helptext HelpText, ) Check
NewGenericCheck returns a basic check implementation with the provided inputs. This is to enable a quick way to add additional checks to the default checks already enforced.
Developers can always define structs with internal keys and methods, and have that fulfill the Check interface. However, if no internal data or methods are needed, then this generic check provides an easier, purely-functional approach.
type Config ¶
type Config interface {
// contains filtered or unexported methods
}
Config is a read-only preflight configuration.
type HelpText ¶
type HelpText struct { // Message is text provided to the user indicating where they should look // to find out why they failed or encountered an error in validation. Message string `json:"message" xml:"message"` // Suggestion is text provided to the user indicating what might need to // change in order to pass a check. Suggestion string `json:"suggestion" xml:"suggestion"` }
HelpText is the help message associated with any given check
type ImageReference ¶
type ImageReference struct { ImageURI string ImageFSPath string ImageInfo v1.Image ImageRepository string ImageRegistry string ImageTagOrSha string }
ImageReference holds all things image-related
type Metadata ¶
type Metadata struct { // Description contains a brief text detailing the overall goal of the check. Description string `json:"description" xml:"description"` // Level describes the certification level associated with the given check. // // TODO: define this more explicitly when requirements surrounding this metadata // text. Level string `json:"level" xml:"level"` // KnowledgeBaseURL is a URL detailing how to resolve a check failure. KnowledgeBaseURL string `json:"knowledge_base_url,omitempty" xml:"knowledgeBaseURL"` // CheckURL is a URL pointing to the official policy documentation from Red Hat, containing // information on exactly what is being tested and why. CheckURL string `json:"check_url,omitempty" xml:"checkURL"` }
Metadata contains useful information regarding the check.
type ValidatorFunc ¶
type ValidatorFunc = func(context.Context, ImageReference) (bool, error)
ValidatorFunc describes a function that, when executed, will check that an artifact (e.g. operator bundle) complies with a given check.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package artifacts provides functionality for writing artifact files in configured artifacts directory.
|
Package artifacts provides functionality for writing artifact files in configured artifacts directory. |
Package engine contains the interfaces necessary to implement policy execution.
|
Package engine contains the interfaces necessary to implement policy execution. |
Package formatters defines the abstractions used to properly format a preflight Result.
|
Package formatters defines the abstractions used to properly format a preflight Result. |
internal
|
|
Package runtime contains the structs and definitions consumed by Preflight at runtime.
|
Package runtime contains the structs and definitions consumed by Preflight at runtime. |