Version: v0.0.0-...-6c2d9fc Latest Latest

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

Go to latest
Published: Mar 31, 2017 License: Apache-2.0 Imports: 28 Imported by: 0



Package action provides implementations for each Helm Classic command.

This is not intended to be a stand-alone library, as many of the commands will write to output, and even os.Exit when things go wrong.



View Source
const (
	// Owner is default Helm repository owner or organization.
	Owner = "helm"

	// Project is the default Charts repository name.
	Project = "charts"

	// MaxMetadataNameLength is the longest allowed by kubernetes.
	MaxMetadataNameLength = 24
View Source
const (
	// Chartfile is the name of the YAML file that contains chart metadata.
	// One must exist inside the top level directory of every chart.
	Chartfile = "Chart.yaml"


View Source
var InstallOrder = []string{"Namespace", "Secret", "ConfigMap", "PersistentVolume", "ServiceAccount", "Service", "Pod", "ReplicationController", "Deployment", "DaemonSet", "Ingress", "Job"}

InstallOrder defines the order in which manifests should be installed, by Kind.

Anything not on the list will be installed after the last listed item, in an indeterminate order.

View Source
var UninstallOrder = []string{"Service", "Pod", "ReplicationController", "Deployment", "DaemonSet", "ConfigMap", "Secret", "PersistentVolume", "ServiceAccount", "Ingress", "Job", "Namespace"}

UninstallOrder defines the order in which manifests are uninstalled.

Unknown manifest types (those not explicitly referenced in this list) will be uninstalled before any of these, since we know that none of the core types depend on non-core types.


func AddRepo

func AddRepo(homedir, name, repository string)

AddRepo adds a repo to the list of repositories.

func CheckAllPrereqs

func CheckAllPrereqs(home string)

CheckAllPrereqs makes sure we have all the tools we need for overall Helm Classic success

func CheckKubePrereqs

func CheckKubePrereqs()

CheckKubePrereqs makes sure we have the tools necessary to interact with a kubernetes cluster

func CheckLatest

func CheckLatest(version string)

CheckLatest checks whether this version of Helm Classic is the latest version.

This does not ensure that this is the latest. If a newer version is found, this generates a message indicating that.

The passed-in version is the base version that will be checked against the remote release list.

func CheckLocalPrereqs

func CheckLocalPrereqs(home string)

CheckLocalPrereqs makes sure we have all the tools we need to work with charts locally

func Create

func Create(chartName, homeDir string)

Create a chart

- chartName being created - homeDir is the helm home directory for the user

func DeleteRepo

func DeleteRepo(homedir, name string)

DeleteRepo deletes a repository.

func Doctor

func Doctor(home string)

Doctor helps you see what's wrong with your Helm Classic setup

func Edit

func Edit(chartName, homeDir string)

Edit charts using the shell-defined $EDITOR

- chartName being edited - homeDir is the Helm Classic home directory for the user

func Fetch

func Fetch(chartName, lname, homedir string)

Fetch gets a chart from the source repo and copies to the workdir.

- chartName is the source - lname is the local name for that chart (chart-name); if blank, it is set to the chart. - homedir is the home directory for the user

func Generate

func Generate(chart, homedir string, exclude []string, force bool)

Generate runs generators on the entire chart.

By design, this only operates on workspaces, as it should never be run on the cache.

func GenerateTemplate

func GenerateTemplate(out io.Writer, in io.Reader, vals interface{})

GenerateTemplate evaluates a template and writes it to an io.Writer

func HasPlugin

func HasPlugin(name string) bool

HasPlugin returns true if the named plugin exists.

func Info

func Info(chartName, homedir, format string)

Info prints information about a chart.

- chartName to display - homeDir is the helm home directory for the user - format is a optional Go template

func Install

func Install(chartName, home, namespace string, force bool, generate bool, exclude []string, client kubectl.Runner)

Install loads a chart into Kubernetes.

If the chart is not found in the workspace, it is fetched and then installed.

During install, manifests are sent to Kubernetes in the ordered specified by InstallOrder.

func Lint

func Lint(chartPath string)

Lint validates that a chart is well-formed

- chartPath path to chart directory

func LintAll

func LintAll(homedir string)

LintAll vlaidates all charts are well-formed

- homedir is the home directory for the user

func List

func List(homedir string)

List lists all of the local charts.

func ListRepos

func ListRepos(homedir string)

ListRepos lists the repositories.

func Plugin

func Plugin(homedir, cmd string, args []string)

Plugin attempts to execute a plugin.

It looks on the path for an executable named `helm-COMMAND`, and executes that, passing it all of the arguments received after the subcommand.

Output is passed directly back to the user.

This ensures that the following environment variables are set:

- $HELM_HOME: points to the user's Helm home directory.
- $HELM_DEFAULT_REPO: the local name of the default repository.
- $HELM_COMMAND: the name of the command (as seen by Helm) that resulted in this program being executed.

func PluginName

func PluginName(name string) string

PluginName returns the full plugin name.

func PrintREADME

func PrintREADME(chart, home string)

PrintREADME prints the README file (if it exists) to the console.

func Publish

func Publish(chartName, homeDir, repo string, force bool)

Publish a chart from the workspace to the cache directory

- chartName being published - homeDir is the helm home directory for the user - force publishing even if the chart directory already exists

func Remove

func Remove(chart, homedir string, force bool)

Remove removes a chart from the workdir.

- chart is the source - homedir is the home directory for the user - force will remove installed charts from workspace

func Search(term, homedir string, regexp bool)

Search looks for packages with 'term' in their name.

func Target

func Target(client kubectl.Runner)

Target displays information about the cluster

func Template

func Template(out, in, data string, force bool) error

Template renders a template to an output file.

func Uninstall

func Uninstall(chartName, home, namespace string, force bool, client kubectl.Runner)

Uninstall removes a chart from Kubernetes.

Manifests are removed from Kubernetes in the order specified by chart.UninstallOrder. Any unknown types are removed before that sequence is run.

func Update

func Update(home string)

Update fetches the remote repo into the home directory.


type GHRepoService

type GHRepoService interface {
	DownloadContents(string, string, string, *github.RepositoryContentGetOptions) (io.ReadCloser, error)

GHRepoService is a restricted interface to GitHub client operations.

var RepoService GHRepoService

RepoService is a GitHub client instance.

Jump to

Keyboard shortcuts

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