environment

package
v0.1.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetExecutedVersion

func GetExecutedVersion(paths KrewPaths, cmdArgs []string) (string, bool, error)

GetExecutedVersion returns the currently executed version. If krew is not executed as an plugin it will return a nil error and an empty string.

func IsPlugin

func IsPlugin(environ []string) bool

IsPlugin checks if the currently executed binary is a plugin.

Types

type KrewPaths

type KrewPaths struct {
	// Base is the path of the krew root.
	// The default path is ~/.kube/plugins/krew
	Base string

	// Index is a git(1) repository containing all local plugin manifests files.
	// ${Index}/<plugin-name>.yaml
	Index string

	// Install is the dir where all plugins will be installed to.
	// ${Install}/<version>/<plugin-content>
	Install string

	// Download is a directory where plugins will be temporarily downloaded to.
	// This is currently a path in os.TempDir()
	Download string
}

KrewPaths contains all important enviroment paths

func MustGetKrewPathsFromEnvs

func MustGetKrewPathsFromEnvs(envs []string) KrewPaths

MustGetKrewPathsFromEnvs returns ensured index paths for krew.

Jump to

Keyboard shortcuts

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