Documentation ¶
Index ¶
Constants ¶
View Source
const ( // Install is executed after the plugin is added. Install = "install" // Delete is executed after the plugin is removed. Delete = "delete" )
Types of hooks
View Source
const PluginFileName = "plugin.yaml"
PluginFileName is the name of a plugin file.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Metadata ¶
type Metadata struct { // Name is the name of the plugin Name string `json:"name"` // Version is a SemVer 2 version of the plugin. Version string `json:"version"` // Usage is the single-line usage text shown in help Usage string `json:"usage"` // Description is a long description shown in places like `helm help` Description string `json:"description"` // Command is the command, as a single string. // // The command will be passed through environment expansion, so env vars can // be present in this command. Unless IgnoreFlags is set, this will // also merge the flags passed from Helm. // // Note that command is not executed in a shell. To do so, we suggest // pointing the command to a shell script. Command string `json:"command"` // IgnoreFlags ignores any flags passed in from Helm // // For example, if the plugin is invoked as `helm --debug myplugin`, if this // is false, `--debug` will be appended to `--command`. If this is true, // the `--debug` flag will be discarded. IgnoreFlags bool `json:"ignoreFlags"` // UseTunnel indicates that this command needs a tunnel. // Setting this will cause a number of side effects, such as the // automatic setting of HELM_HOST. UseTunnel bool `json:"useTunnel"` // Hooks are commands that will run on events. Hooks Hooks }
Metadata describes a plugin.
This is the plugin equivalent of a chart.Metadata.
type Plugin ¶
type Plugin struct { // Metadata is a parsed representation of a plugin.yaml Metadata *Metadata // Dir is the string path to the directory that holds the plugin. Dir string // Remote is the remote repo location. Remote string }
Plugin represents a plugin.
func LoadAll ¶
LoadAll loads all plugins found beneath the base directory.
This scans only one directory level.
func (*Plugin) PrepareCommand ¶
PrepareCommand takes a Plugin.Command and prepares it for execution.
It merges extraArgs into any arguments supplied in the plugin. It returns the name of the command and an args array.
The result is suitable to pass to exec.Command.
Click to show internal directories.
Click to hide internal directories.