installation

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2021 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrIsAlreadyInstalled = errors.New("can't install, the newest version is already installed")
	ErrIsNotInstalled     = errors.New("plugin is not installed")
	ErrIsAlreadyUpgraded  = errors.New("can't upgrade, the newest version is already installed")
)

Plugin lifecycle errors

Functions

func CleanupStaleKrewInstallations

func CleanupStaleKrewInstallations(fs afero.Fs, dir, currentVersion string) error

CleanupStaleKrewInstallations removes the versions that aren't the current version.

func GetInstalledPluginReceipts

func GetInstalledPluginReceipts(f env.Factory) ([]spec.Receipt, error)

GetInstalledPluginReceipts returns a list of receipts.

func GetMatchingPlatform

func GetMatchingPlatform(platforms []spec.Platform) (spec.Platform, bool, error)

GetMatchingPlatform finds the platform spec in the specified plugin that matches the os/arch of the current machine (can be overridden via KREW_OS and/or KREW_ARCH).

func Install

func Install(p env.Factory, plugin spec.Plugin, indexName string, opts InstallOpts) error

Install will download and install a plugin. The operation tries to not get the plugin dir in a bad state if it fails during the process.

func InstalledPluginsFromIndex

func InstalledPluginsFromIndex(f env.Factory, indexName string) ([]spec.Receipt, error)

InstalledPluginsFromIndex returns a list of all install plugins from a particular spec.

func IsWindows

func IsWindows() bool

IsWindows sees if KREW_OS or runtime.GOOS to find out if current execution mode is win32.

func Load

func Load(fs afero.Fs, path string) (spec.Receipt, error)

Load reads the plugin receipt at the specified destination. If not found, it returns os.IsNotExist error.

func New

func New(plugin spec.Plugin, indexName string, timestamp metav1.Time) spec.Receipt

New returns a new receipt with the given plugin and index name.

func Store

func Store(fs afero.Fs, receipt spec.Receipt, dest string) error

Store saves the given receipt at the destination. The caller has to ensure that the destination directory exists.

func Uninstall

func Uninstall(p env.Factory, name string) error

Uninstall will uninstall a plugin.

Types

type InstallOpts

type InstallOpts struct {
	ArchiveFileOverride string
}

InstallOpts specifies options for plugin installation operation.

type OSArchPair

type OSArchPair struct {
	OS, Arch string
}

OSArchPair is wrapper around operating system and architecture

func OSArch

func OSArch() OSArchPair

OSArch returns the OS/arch combination to be used on the current system. It can be overridden by setting KREW_OS and/or KREW_ARCH environment variables.

func (OSArchPair) String

func (p OSArchPair) String() string

String converts environment into a string

Directories

Path Synopsis
Package semver is a wrapper for handling of semantic version (https://semver.org) values.
Package semver is a wrapper for handling of semantic version (https://semver.org) values.

Jump to

Keyboard shortcuts

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