Documentation
¶
Overview ¶
Package update implements the shared, explicit version inventory behind nova-update and nova-version. It never discovers homes or installs on a verdict.
Index ¶
- Constants
- Variables
- func Compare(a, b string) string
- func Main(name string, args []string, stamp string, out, errs io.Writer) int
- func Run(name string, args []string, stamp string, out, errs io.Writer, env Environment) (rc int)
- func VersionTool(stamp string, env Environment) *tool.Tool
- func WithDrainTimer(ctx context.Context, fn func(time.Duration) (<-chan time.Time, func() bool)) context.Context
- type AdoptCheck
- type Entry
- type Environment
- type ManifestError
- type ProcessResult
- type Read
Constants ¶
const AdoptHeader = "check\tcommand\towner"
AdoptHeader is the checks file watch --adopt reads: one adoption check per line, the command held to the same argv rule as every other exec site.
const ChildCap = 64 * 1024
const HTTPCap = 256 * 1024
const Header = "name\tkind\tinstalled\tlatest\tapply\towner"
Variables ¶
var Kinds = []string{"harness", "engine", "model", "tool", "pin"}
Functions ¶
func Compare ¶
Compare orders only equally long, plain numeric release tags. Arbitrary-size components avoid both floating-point loss and machine integer overflow.
func VersionTool ¶ added in v1.2.3
func VersionTool(stamp string, env Environment) *tool.Tool
VersionTool is nova-version on pkg/tool: its verbs are this package's moved, snapshot and diff (SPEC-VERSION), and report and send, which share nova-update's report body. Run("nova-version", ...) is this tool's Run, so the package's tests reach it by that name.
Types ¶
type AdoptCheck ¶ added in v1.2.3
AdoptCheck is one row of the checks file.
type Entry ¶
type Environment ¶
type Environment struct {
Process processFunc
// Env is the environment a spawned child gets, and the PATH its name is
// looked up on. Nil inherits this process's own.
Env []string
Now func() time.Time
Client *http.Client
Context context.Context
WorkerStart func(id int)
JobAttempt func(index int)
DrainTimer func(time.Duration) (<-chan time.Time, func() bool)
// Rename commits a snapshot; nil is os.Rename.
Rename func(oldPath, newPath string) error
// OpenStore dials the fleet store for report --store; nil is store.Open,
// which authenticates from the process environment.
OpenStore func(ctx context.Context, addr string) (*store.Store, error)
}
Environment supplies deterministic clock/network seams. Nil values use the machine clock and a credential-free, redirect-bounded HTTP client.
type ManifestError ¶ added in v1.2.3
type ManifestError struct {
Problems []string
// More is how many problems past manifestProblemCap were found and not listed.
More int
}
ManifestError is every problem one read of a manifest found, in line order, each one worded as a single-problem refusal was (`line 3: ...`): a run that finds several says so once, and the writer fixes the file in one pass and not one error per run.
func (*ManifestError) Error ¶ added in v1.2.3
func (e *ManifestError) Error() string
type ProcessResult ¶
type ProcessResult struct{ Stdout, Stderr, Path, Reason string }