Documentation ¶
Index ¶
- Constants
- func ContentTypeForFileName(name string) string
- func CopyDir(src string, dst string, force bool) (err error)
- func CopyDirOverwrite(src string, dst string) (err error)
- func CopyDirPreserve(src string, dst string) error
- func CopyFile(src, dst string) (err error)
- func CopyFileOrDir(src string, dst string, force bool) (err error)
- func CreateUniqueDirectory(dir string, name string, maximumAttempts int) (string, error)
- func DeleteDirContents(dir string) error
- func DeleteDirContentsExcept(dir string, exceptDir string) error
- func DeleteFile(fileName string) (err error)
- func DestroyFile(filename string) error
- func DirExists(path string) (bool, error)
- func FileExists(path string) (bool, error)
- func FileIsEmpty(path string) (bool, error)
- func FilterFileExists(paths []string) []string
- func FirstFileExists(paths ...string) (string, error)
- func GlobAllFiles(basedir string, pattern string, fn func(string) error) error
- func IgnoreFile(path string, ignores []string) (bool, error)
- func IsEmpty(name string) (bool, error)
- func ListDirectory(root string, recurse bool) error
- func LoadBytes(dir, name string) ([]byte, error)
- func Now() *timestamp.Timestamp
- func PathWithBinary(paths ...string) string
- func RecreateDirs(dirs ...string) error
- func RenameDir(src string, dst string, force bool) (err error)
- func RenameFile(src string, dst string) (err error)
- func SplitManifests(bigFile string) map[string]string
- func Template(repo string, releaseName string, outputDir string, showNotes bool, ...) (res string, err error)
- func Timestamp(t time.Time) *timestamp.Timestamp
- type ChartSummary
- type Command
- func (c *Command) Attempts() int
- func (c *Command) CurrentArgs() []string
- func (c *Command) CurrentDir() string
- func (c *Command) CurrentEnv() map[string]string
- func (c *Command) CurrentName() string
- func (c *Command) DidError() bool
- func (c *Command) DidFail() bool
- func (c *Command) Error() error
- func (c *Command) Run() (string, error)
- func (c *Command) RunWithoutRetry() (string, error)
- func (c *Command) SetArgs(args []string)
- func (c *Command) SetDir(dir string)
- func (c *Command) SetEnv(env map[string]string)
- func (c *Command) SetEnvVariable(name string, value string)
- func (c *Command) SetExponentialBackOff(backoff *backoff.ExponentialBackOff)
- func (c *Command) SetName(name string)
- func (c *Command) SetTimeout(timeout time.Duration)
- func (c *Command) String() string
- type CommandError
- type Commander
- type HelmCLI
- func (h *HelmCLI) AddRepo(repo, URL, username, password string) error
- func (h *HelmCLI) BuildDependency() error
- func (h *HelmCLI) DecryptSecrets(location string) error
- func (h *HelmCLI) DeleteRelease(ns string, releaseName string, purge bool) error
- func (h *HelmCLI) Env() map[string]string
- func (h *HelmCLI) FetchChart(chart string, version string, untar bool, untardir string, repo string, ...) error
- func (h *HelmCLI) FindChart() (string, error)
- func (h *HelmCLI) HelmBinary() string
- func (h *HelmCLI) Init(clientOnly bool, serviceAccount string, tillerNamespace string, upgrade bool) error
- func (h *HelmCLI) InstallChart(chart string, releaseName string, ns string, version string, timeout int, ...) error
- func (h *HelmCLI) IsRepoMissing(URL string) (bool, error)
- func (h *HelmCLI) Lint() (string, error)
- func (h *HelmCLI) ListCharts() (string, error)
- func (h *HelmCLI) ListRepos() (map[string]string, error)
- func (h *HelmCLI) PackageChart() error
- func (h *HelmCLI) RemoveRepo(repo string) error
- func (h *HelmCLI) RemoveRequirementsLock() error
- func (h *HelmCLI) SearchChartVersions(chart string) ([]string, error)
- func (h *HelmCLI) SearchCharts(filter string) ([]ChartSummary, error)
- func (h *HelmCLI) SetCWD(dir string)
- func (h *HelmCLI) SetHelmBinary(binary string)
- func (h *HelmCLI) SetHost(tillerAddress string)
- func (h *HelmCLI) StatusRelease(ns string, releaseName string) error
- func (h *HelmCLI) Template(chart string, releaseName string, ns string, outDir string, upgrade bool, ...) error
- func (h *HelmCLI) UpdateRepo() error
- func (h *HelmCLI) UpgradeChart(chart string, releaseName string, ns string, version string, install bool, ...) error
- func (h *HelmCLI) Version(tls bool) (string, error)
- func (h *HelmCLI) VersionWithArgs(tls bool, extraArgs ...string) (string, error)
- type SimpleHead
- type Version
Constants ¶
const ( DefaultWritePermissions = 0760 MaximumNewDirectoryAttempts = 1000 )
const (
// ChartFileName file name for a chart
ChartFileName = "Chart.yaml"
)
Variables ¶
This section is empty.
Functions ¶
func ContentTypeForFileName ¶
ContentTypeForFileName returns the MIME type for the given file name
func CopyDirOverwrite ¶
CopyDirOverwrite copies from the source dir to the destination dir overwriting files along the way
func CopyDirPreserve ¶
CopyDirPreserve copies from the src dir to the dst dir if the file does NOT already exist in dst
func CopyFileOrDir ¶
CopyFileOrDir copies the source file or directory to the given destination
func CreateUniqueDirectory ¶
CreateUniqueDirectory creates a new directory but if the combination of dir and name exists then append a number until a unique name is found
func DeleteDirContents ¶
DeleteDirContents removes all the contents of the given directory
func DeleteDirContentsExcept ¶
func DeleteFile ¶
DeleteFile deletes a file from the operating system. This should NOT be used to delete any sensitive information because it can easily be recovered. Use DestroyFile to delete sensitive information
func DestroyFile ¶
DestroyFile will securely delete a file by first overwriting it with random bytes, then deleting it. This should always be used for deleting sensitive information
func FileExists ¶
func FileIsEmpty ¶
FileIsEmpty checks if a file is empty
func FilterFileExists ¶
FilterFileExists filters out files which do not exist
func FirstFileExists ¶
FirstFileExists returns the first file which exists or an error if we can't detect if a file that exists
func GlobAllFiles ¶
GlobAllFiles performs a glob on the pattern and then processes all the files found. if a folder matches the glob its treated as another glob to recurse into the directory
func IgnoreFile ¶
IgnoreFile returns true if the path matches any of the ignores. The match is the same as filepath.Match.
func ListDirectory ¶
ListDirectory logs the directory at path
func PathWithBinary ¶
PathWithBinary Sets the $PATH variable. Accepts an optional slice of strings containing paths to add to $PATH
func RecreateDirs ¶
DeleteDirContents removes all the contents of the given directory
func RenameFile ¶
func SplitManifests ¶
SplitManifests takes a string of manifest and returns a map contains individual manifests
Types ¶
type ChartSummary ¶
type Command ¶
type Command struct { Errors []error Dir string Name string Args []string ExponentialBackOff *backoff.ExponentialBackOff Timeout time.Duration Out io.Writer Err io.Writer Env map[string]string // contains filtered or unexported fields }
Command is a struct containing the details of an external command to be executed
func (*Command) CurrentArgs ¶
CurrentArgs returns the current command arguments
func (*Command) CurrentDir ¶
CurrentDir returns the current Dir
func (*Command) CurrentEnv ¶
CurrentEnv returns the current envrionment variables
func (*Command) CurrentName ¶
CurrentName returns the current name of the command
func (*Command) DidError ¶
DidError returns a boolean if any error occurred in any execution of the command
func (*Command) DidFail ¶
DidFail returns a boolean if the command could not complete (errored on every attempt)
func (*Command) RunWithoutRetry ¶
RunWithoutRetry Execute the command without retrying on failure and block waiting for return values
func (*Command) SetArgs ¶
SetArgs Setter method for Args to enable use of interface instead of Command struct
func (*Command) SetDir ¶
SetDir Setter method for Dir to enable use of interface instead of Command struct
func (*Command) SetEnv ¶
SetEnv Setter method for Env to enable use of interface instead of Command struct
func (*Command) SetEnvVariable ¶
SetEnvVariable sets an environment variable into the environment
func (*Command) SetExponentialBackOff ¶
func (c *Command) SetExponentialBackOff(backoff *backoff.ExponentialBackOff)
SetExponentialBackOff Setter method for ExponentialBackOff to enable use of interface instead of Command struct
func (*Command) SetName ¶
SetName Setter method for Name to enable use of interface instead of Command struct
func (*Command) SetTimeout ¶
SetTimeout Setter method for Timeout to enable use of interface instead of Command struct
type CommandError ¶
type CommandError struct { Command Command Output string // contains filtered or unexported fields }
CommandError is the error object encapsulating an error from a Command
func (CommandError) Error ¶
func (c CommandError) Error() string
type Commander ¶
type Commander interface { DidError() bool DidFail() bool Error() error Run() (string, error) RunWithoutRetry() (string, error) SetName(string) CurrentName() string SetDir(string) CurrentDir() string SetArgs([]string) CurrentArgs() []string SetTimeout(time.Duration) SetExponentialBackOff(*backoff.ExponentialBackOff) SetEnv(map[string]string) CurrentEnv() map[string]string SetEnvVariable(string, string) }
Commander defines the interface for a Command
type HelmCLI ¶
HelmCLI implements common helm actions based on helm CLI
func NewHelmCLI ¶
NewHelmCLI creates a new HelmCLI instance configured to use the provided helm CLI in the given current working directory
func NewHelmCLIWithRunner ¶
func NewHelmCLIWithRunner(runner Commander, binary string, version Version, cwd string, debug bool) *HelmCLI
NewHelmCLIWithRunner creaets a new HelmCLI interface for the given runner
func (*HelmCLI) BuildDependency ¶
BuildDependency builds the helm dependencies of the helm chart from the current working directory
func (*HelmCLI) DecryptSecrets ¶
func (*HelmCLI) DeleteRelease ¶
DeleteRelease removes the given release
func (*HelmCLI) FetchChart ¶
func (h *HelmCLI) FetchChart(chart string, version string, untar bool, untardir string, repo string, username string, password string) error
FetchChart fetches a Helm Chart
func (*HelmCLI) FindChart ¶
FindChart find a chart in the current working directory, if no chart file is found an error is returned
func (*HelmCLI) HelmBinary ¶
HelmBinary return the configured helm CLI
func (*HelmCLI) Init ¶
func (h *HelmCLI) Init(clientOnly bool, serviceAccount string, tillerNamespace string, upgrade bool) error
Init executes the helm init command according with the given flags
func (*HelmCLI) InstallChart ¶
func (h *HelmCLI) InstallChart(chart string, releaseName string, ns string, version string, timeout int, values []string, valueFiles []string, repo string, username string, password string) error
InstallChart installs a helm chart according with the given flags
func (*HelmCLI) IsRepoMissing ¶
IsRepoMissing checks if the repository with the given URL is missing from helm
func (*HelmCLI) Lint ¶
Lint lints the helm chart from the current working directory and returns the warnings in the output
func (*HelmCLI) ListCharts ¶
ListCharts execute the helm list command and returns its output
func (*HelmCLI) PackageChart ¶
PackageChart packages the chart from the current working directory
func (*HelmCLI) RemoveRepo ¶
RemoveRepo removes the given repo from helm
func (*HelmCLI) RemoveRequirementsLock ¶
RemoveRequirementsLock removes the requirements.lock file from the current working directory
func (*HelmCLI) SearchChartVersions ¶
SearchChartVersions search all version of the given chart
func (*HelmCLI) SearchCharts ¶
func (h *HelmCLI) SearchCharts(filter string) ([]ChartSummary, error)
SearchCharts searches for all the charts matching the given filter
func (*HelmCLI) SetHelmBinary ¶
SetHelmBinary configure a new helm CLI
func (*HelmCLI) StatusRelease ¶
StatusRelease returns the output of the helm status command for a given release
func (*HelmCLI) Template ¶
func (h *HelmCLI) Template(chart string, releaseName string, ns string, outDir string, upgrade bool, values []string, valueFiles []string) error
Template generates the YAML from the chart template to the given directory
func (*HelmCLI) UpdateRepo ¶
UpdateRepo updates the helm repositories
func (*HelmCLI) UpgradeChart ¶
func (h *HelmCLI) UpgradeChart(chart string, releaseName string, ns string, version string, install bool, timeout int, force bool, wait bool, values []string, valueFiles []string, repo string, username string, password string) error
UpgradeChart upgrades a helm chart according with given helm flags
type SimpleHead ¶
type SimpleHead struct { Version string `json:"apiVersion"` Kind string `json:"kind,omitempty"` Metadata *struct { Name string `json:"name"` Annotations map[string]string `json:"annotations"` } `json:"metadata,omitempty"` }
SimpleHead defines what the structure of the head of a manifest file