Documentation ¶
Index ¶
- Variables
- func CleanupStaleKrewInstallations(fs afero.Fs, dir, currentVersion string) error
- func GetInstalledPluginReceipts(f env.Factory) ([]spec.Receipt, error)
- func GetMatchingPlatform(platforms []spec.Platform) (spec.Platform, bool, error)
- func Install(p env.Factory, plugin spec.Plugin, indexName string, opts InstallOpts) error
- func InstalledPluginsFromIndex(f env.Factory, indexName string) ([]spec.Receipt, error)
- func IsWindows() bool
- func Load(fs afero.Fs, path string) (spec.Receipt, error)
- func New(plugin spec.Plugin, indexName string, timestamp metav1.Time) spec.Receipt
- func Store(fs afero.Fs, receipt spec.Receipt, dest string) error
- func Uninstall(p env.Factory, name string) error
- type InstallOpts
- type OSArchPair
Constants ¶
This section is empty.
Variables ¶
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 ¶
CleanupStaleKrewInstallations removes the versions that aren't the current version.
func GetInstalledPluginReceipts ¶
GetInstalledPluginReceipts returns a list of receipts.
func GetMatchingPlatform ¶
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 ¶
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 ¶
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 ¶
Load reads the plugin receipt at the specified destination. If not found, it returns os.IsNotExist error.
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