Documentation
¶
Overview ¶
Package update replaces the running beekeeper with the latest signed release.
Index ¶
Constants ¶
const Repository = "giantswarm/beekeeper"
Repository is the GitHub repository whose releases carry the binaries: beekeeper-<os>-<arch> (beekeeper-windows-<arch>.exe), each next to its cosign Sigstore bundle (<asset>.bundle), which the download is verified against before anything is written.
Variables ¶
var ErrOutdated = errors.New("a newer beekeeper release is available")
ErrOutdated is what a check returns when a newer release exists.
Functions ¶
Types ¶
type Canary ¶
Canary checks a verified candidate binary at path for version before it replaces the installed executable. Returning an error keeps the current executable in place.
type Options ¶
Options configures a Run call through its context.
func OptionsFrom ¶
OptionsFrom returns the Options attached to ctx.
type Result ¶
type Result struct {
Current string `json:"current"`
Latest string `json:"latest"`
Published time.Time `json:"published"`
URL string `json:"url"`
Newer bool `json:"newer"`
// Path is the file the update replaced, symbolic links not resolved.
Path string `json:"path,omitempty"`
Updated bool `json:"updated"`
}
Result is what a check or an update found and did.
func InstallVersion ¶
InstallVersion installs exactly the release version (a tag, "v0.3.0") over the running executable once its bundle verifies, as Run installs the latest: an execution host follows its coordinator's release, never a newer one. The verified download is staged beside the destination and renamed over it atomically, with no backup or ownership-dependent hard link.
func Run ¶
Run looks up the latest release and, unless checkOnly, installs its binary for this OS and architecture over the running executable once its bundle verifies. A running pre-release looks among the pre-releases too, a running release only among releases. Progress goes to w. With checkOnly the error is ErrOutdated when a newer release exists.
The binary is renamed over the executable in one step, symbolic links resolved: a beekeeper watch that runs keeps running the old binary, every process started afterwards runs the new one, and several updates may run at once. A development build, a release without a bundle for this platform's binary and a download that does not verify are refused, and the executable stays as it is.