Documentation ¶
Index ¶
- func MergeYAMLValues(tempDir string, vs ...[]byte) (map[string]any, error)
- func ToFlags(flagsStruct any) []string
- func UpdateChartLock(chartLock ChartLock, filepath string) error
- type Chart
- type ChartLock
- type Client
- func (c *Client) DependencyBuild(ctx context.Context, chartDir string) error
- func (c *Client) DownloadFile(ctx context.Context, url, filename string) error
- func (c *Client) Get(ctx context.Context, namespace, name string) (Release, error)
- func (c *Client) GetConfigHome() string
- func (c *Client) GetValues(ctx context.Context, release *Release, values any) error
- func (c *Client) Install(ctx context.Context, chart string, opts InstallOptions) (Release, error)
- func (c *Client) List(ctx context.Context) ([]Release, error)
- func (c *Client) RepoAdd(ctx context.Context, name, url string) error
- func (c *Client) RepoList(ctx context.Context) ([]Repo, error)
- func (c *Client) Search(ctx context.Context, keyword string) ([]Chart, error)
- func (c *Client) ShowValues(ctx context.Context, chart string, values any) error
- func (c *Client) Template(ctx context.Context, chart string, opts TemplateOptions) ([]byte, error)
- func (c *Client) Test(ctx context.Context, release Release) error
- func (c *Client) Uninstall(ctx context.Context, release Release) error
- func (c *Client) Upgrade(ctx context.Context, release, chart string, opts UpgradeOptions) (Release, error)
- type Dependency
- type InstallOptions
- type Options
- type RawYAML
- type Release
- type Repo
- type TemplateOptions
- type UpgradeOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MergeYAMLValues ¶
MergeYAMLValues uses helm's values package to merge a collection of YAML values in accordance with helm's merging logic. Sadly, their merging logic is not exported nor can it accept raw JSON/YAML so we dump files on disk.
func ToFlags ¶
ToFlags is a reflect based helper that translates a go struct with `flag` tags into a string slice of command line arguments. If flagsStruct is not a struct, ToFlags panics.
func UpdateChartLock ¶
Types ¶
type ChartLock ¶
type ChartLock struct { // Generated is the date the lock file was last generated. Generated time.Time `json:"generated"` // Digest is a hash of the dependencies in Chart.yaml. Digest string `json:"digest"` // Dependencies is the list of dependencies that this lock file has locked. Dependencies []*Dependency `json:"dependencies"` }
ChartLock is a helm lock file for dependencies.
func GetChartLock ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a sandboxed programmatic API for the `helm` CLI.
It leverages an isolated HELM_CONFIG_HOME directory to keep operation hermetic but shares a global cache to keep network chatter to a minimum. See `helm env` for more details.
func (*Client) DependencyBuild ¶
func (*Client) DownloadFile ¶
func (*Client) GetConfigHome ¶
func (*Client) ShowValues ¶
type Dependency ¶
type Dependency struct { // Name is the name of the dependency. // // This must mach the name in the dependency's Chart.yaml. Name string `json:"name"` // Version is the version (range) of this chart. // // A lock file will always produce a single version, while a dependency // may contain a semantic version range. Version string `json:"version,omitempty"` // The URL to the repository. // // Appending `index.yaml` to this string should result in a URL that can be // used to fetch the repository index. Repository string `json:"repository"` // A yaml path that resolves to a boolean, used for enabling/disabling charts (e.g. subchart1.enabled ) Condition string `json:"condition,omitempty"` // Tags can be used to group charts for enabling/disabling together Tags []string `json:"tags,omitempty"` // Enabled bool determines if chart should be loaded Enabled bool `json:"enabled,omitempty"` // ImportValues holds the mapping of source values to parent key to be imported. Each item can be a // string or pair of child/parent sublist items. ImportValues []interface{} `json:"import-values,omitempty"` // Alias usable alias to be used for the chart Alias string `json:"alias,omitempty"` }
Dependency describes a chart upon which another chart depends.
type InstallOptions ¶
type InstallOptions struct { CreateNamespace bool `flag:"create-namespace"` Name string `flag:"-"` Namespace string `flag:"namespace"` Values any `flag:"-"` Version string `flag:"version"` NoWait bool `flag:"wait"` NoWaitForJobs bool `flag:"wait-for-jobs"` GenerateName bool `flag:"generate-name"` ValuesFile string `flag:"values"` Set []string `flag:"set"` }
type TemplateOptions ¶
type UpgradeOptions ¶
type UpgradeOptions struct { CreateNamespace bool `flag:"create-namespace"` Install bool `flag:"install"` Namespace string `flag:"namespace"` Version string `flag:"version"` NoWait bool `flag:"wait"` NoWaitForJobs bool `flag:"wait-for-jobs"` ReuseValues bool `flag:"reuse-values"` Values any `flag:"-"` ValuesFile string `flag:"values"` Set []string `flag:"set"` }