prereqs

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2026 License: MIT Imports: 9 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 RequireAzureLinux4 added in v1.0.0

func RequireAzureLinux4(ctx opctx.Ctx) error

RequireAzureLinux4 verifies that commands which modify the current host run only on Azure Linux 4.

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