update

package
v0.71.1-rc.2 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2026 License: Apache-2.0 Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package update keeps the agentlab binary current. `agentlab self-update` installs the newest GitHub release over the running executable, the way muster and mcp-kubernetes do it (creativeprojects/go-selfupdate against the repository's releases; a development build is refused) — and only after the release's cosign Sigstore bundle verifies: architect signs every binary it publishes in CircleCI, keyless, and the shared validator (github.com/giantswarm/selfupdate-cosign) checks the download against that signature before anything is written. A release without a bundle, or a download that does not match its bundle, is refused and the installed binary stays as it is. Remind prints a one-line hint ahead of every command while a newer release exists — the per-command check devctl runs, with two deliberate differences: it never blocks (an outdated lab still runs), and it gives up fast when GitHub cannot be reached, so a machine without internet is never held up. GitHub's answer is remembered under the user's cache directory for an hour (a failed attempt for ten minutes), so the round trip is rare, and capped at two seconds when it happens. The hint installs nothing, so it does not ask for a bundle.

Index

Constants

View Source
const OptOutEnv = "AGENTLAB_NO_UPDATE_CHECK"

OptOutEnv silences the newer-release hint when set to any value. The self-update command ignores it.

View Source
const Repository = "giantswarm/agentlab"

Repository is the GitHub repository whose releases carry the binaries. Its assets are named agentlab-<os>-<arch> (agentlab-windows-<arch>.exe), the shape go-selfupdate picks out for the running OS and architecture by itself, each next to its cosign Sigstore bundle (agentlab-<os>-<arch>.bundle) — the signature self-update verifies the download against.

Variables

View Source
var ErrOutdated = errors.New("a newer agentlab release is available")

ErrOutdated is what `agentlab self-update --check` returns when a newer release exists; main turns it into exit status 125, devctl's convention for `version check`.

Functions

func Remind

func Remind(ctx context.Context, w io.Writer)

Remind writes a hint on w when a release newer than the running binary exists, and nothing otherwise — never an error, never a wait worth noticing: the lab works the same on an old binary. Quiet for a build that is no release ("dev"), under OptOutEnv, and whenever GitHub cannot say within remindTimeout (offline, rate-limited, no binary for this platform).

func Run

func Run(ctx context.Context, w io.Writer, checkOnly bool) error

Run is `agentlab self-update`. It looks up the newest release and, unless checkOnly, downloads the binary for this OS and architecture and its Sigstore bundle, verifies the one against the other, and only then writes it over the running executable — the flow muster and mcp-kubernetes ship. Progress goes to w. A development build is refused: "dev" compares with nothing and was not installed from a release to begin with. A release without a bundle for this platform's binary is refused before anything is downloaded, a download that does not verify before anything is written; both leave the executable as it is. With checkOnly the versions are reported and the result is ErrOutdated when a newer release exists, nil when nothing newer is out — and the same refusal when the newest release has no bundle, since self-update would install nothing from it.

Types

This section is empty.

Jump to

Keyboard shortcuts

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