prereqs

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// The OS ID of Azure Linux.
	OSIDAzureLinux = "azurelinux"
	// The OS ID of Fedora.
	OSIDFedora = "fedora"
)

Variables

View Source
var ErrMissingExecutable = errors.New("executable missing, no auto-resolution")

ErrMissingExecutable is returned when a required executable cannot be found or acquired.

Functions

func RequireExecutable

func RequireExecutable(ctx opctx.Ctx, programName string, prereq *PackagePrereq) error

Checks that the executable identified by `programName` is available in the host system. If it can't be found but `prereq` is provided, then will attempt to auto-install the prerequisite, dependent on the policy configured in `ctx`. If `programName` isn't present and can't be auto-installed, returns an error.

Types

type PackagePrereq

type PackagePrereq struct {
	// List of Azure Linux distro packages that must be installed to provide this prerequisite.
	AzureLinuxPackages []string
	// List of Fedora distro packages that must be installed to provide this prerequisite.
	FedoraPackages []string
}

Represents a prerequisite resource that must be present in the host; can provide information on how to acquire that resource if not ready.

func (*PackagePrereq) Install

func (p *PackagePrereq) Install(ctx opctx.Ctx) error

Installs the prerequisite on the host system.

Jump to

Keyboard shortcuts

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