Documentation
¶
Overview ¶
Package preflight checks that this machine can reach what a scan would read: each repository at its revision, the paths a component is scoped to, each image, each endpoint. With the credentials and the network the scan would have, and before the scan is started.
Every check touches something outside the descriptor, a checkout, a registry, a network or a credential, which is why it lives in `doctor` rather than `validate`.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Check ¶
type Check struct {
// Kind is what was checked: repository, paths, image, host or infrastructure.
Kind string `json:"kind"`
// Target names it, without credentials.
Target string `json:"target"`
Status Status `json:"status"`
// Detail is the result in words: what resolved, or why it failed or was not checked.
Detail string `json:"detail"`
}
Check is one target checked, and what came of it.
type Options ¶
type Options struct {
// Offline skips every check that needs the network, and reports each as not checked.
Offline bool
// Timeout bounds each target's checks. Zero means 20 seconds.
Timeout time.Duration
// Concurrency bounds how many targets are checked at once. Zero means 8.
Concurrency int
Probes Probes
}
Options shape a run.
type Probes ¶
type Probes struct {
// Revision resolves a repository's revision to a commit.
Revision func(ctx context.Context, url, revision string) (string, error)
// Paths checks a repository's paths at a revision and returns the commit it read.
Paths func(ctx context.Context, url, revision string, paths []string) (string, error)
// Image checks that an image can be read, and says from where.
Image func(ctx context.Context, ref string, offline bool) (string, error)
// Host opens a connection to an endpoint and says what it established.
Host func(ctx context.Context, rawURL string) (string, error)
}
Probes are the checks themselves. A nil field is the real probe; tests replace them.
Click to show internal directories.
Click to hide internal directories.