Skip to content

Commit

Permalink
Merge pull request #8760 from bacongobbler/fix-yamlv2-annotations
Browse files Browse the repository at this point in the history
fix: use yaml annotations for yaml.v2 validation
  • Loading branch information
Matthew Fisher committed Sep 17, 2020
2 parents f2ede29 + a9d1204 commit 3a7b781
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions pkg/plugin/plugin.go
Expand Up @@ -34,27 +34,27 @@ const pluginFileName = "plugin.yaml"
// charts from special sources
type Downloaders struct {
// Protocols are the list of schemes from the charts URL.
Protocols []string `json:"protocols"`
Protocols []string `json:"protocols" yaml:"protocols"`
// Command is the executable path with which the plugin performs
// the actual download for the corresponding Protocols
Command string `json:"command"`
Command string `json:"command" yaml:"command"`
}

// Metadata describes a plugin.
//
// This is the plugin equivalent of a chart.Metadata.
type Metadata struct {
// Name is the name of the plugin
Name string `json:"name"`
Name string `json:"name" yaml:"name"`

// Version is a SemVer 2 version of the plugin.
Version string `json:"version"`
Version string `json:"version" yaml:"version"`

// Usage is the single-line usage text shown in help
Usage string `json:"usage"`
Usage string `json:"usage" yaml:"usage"`

// Description is a long description shown in places like `helm help`
Description string `json:"description"`
Description string `json:"description" yaml:"description"`

// Command is the command, as a single string.
//
Expand All @@ -64,26 +64,26 @@ type Metadata struct {
//
// 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"`
Command string `json:"command" yaml:"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"`
IgnoreFlags bool `json:"ignoreFlags" yaml:"ignoreFlags,omitempty"`

// 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"`
UseTunnel bool `json:"useTunnel" yaml:"useTunnel,omitempty"`

// Hooks are commands that will run on events.
Hooks Hooks

// Downloaders field is used if the plugin supply downloader mechanism
// for special protocols.
Downloaders []Downloaders `json:"downloaders"`
Downloaders []Downloaders `json:"downloaders" yaml:"downloaders"`
}

// Plugin represents a plugin.
Expand Down

0 comments on commit 3a7b781

Please sign in to comment.