preflight

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package preflight checks, on the host it runs on, the environment properties that SECURITY.md's guarantees rely on.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Write

func Write(w io.Writer, results []Result) (bool, error)

Write prints one line per result and reports whether any property is violated, or a check failed to run; unknown does not fail it.

Types

type DockerAPI

DockerAPI is the part of the Docker client the preflight uses.

type Env

type Env struct {
	Docker    DockerAPI
	Run       func(ctx context.Context, name string, args ...string) ([]byte, error)
	DataDir   string
	SharedDir string
}

Env is what the preflight checks: the Docker API, a way to run host commands, the plugin's data directory, and the shared certificate directory as mounted where the preflight runs (empty if it is not).

type Result

type Result struct {
	Property string // E1, E2, ...
	Status   Status
	Detail   string
}

Result is the outcome of checking one environment property.

func Check

func Check(ctx context.Context, env Env) []Result

Check checks the environment properties it can see from this host: E1, E2, E4, E5, E6, E7, E8 and E9, in this order.

type Status

type Status string

Status is the outcome of checking one property.

const (
	OK       Status = "ok"
	Violated Status = "violated"
	Unknown  Status = "unknown" // the check cannot tell from this host
	Info     Status = "info"    // an operator's choice, reported
	Error    Status = "error"   // the check could not run
)

The outcomes of a check. Only Violated and Error fail the preflight.

Jump to

Keyboard shortcuts

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