Documentation
¶
Overview ¶
helmx provides an API for other golang programs to use helm-x as a library
Index ¶
- func CopyFile(src, dst string) error
- func DefaultRunCommand(cmd string, args []string, stdout, stderr io.Writer, env map[string]string) error
- func Namespace(ns string) *namespace
- func TillerNamespace(tillerNs string) *tillerNamespace
- func TillerStorageBackend(s string) *storage
- func YamlMarshal(v interface{}) ([]byte, error)
- type AdoptOption
- type AdoptOpts
- type ChartifyOption
- type ChartifyOpts
- type ClientOpts
- type DiffOption
- type DiffOpts
- type InjectOpts
- type KustomizeBuildOption
- type KustomizeBuildOpts
- type KustomizeImage
- type KustomizeOpts
- type Option
- type PatchOption
- type PatchOpts
- type RenderOpts
- type ReplaceWithRenderedOpts
- type Runner
- func (r *Runner) Adopt(release string, resources []string, pathOptions *clientcmd.PathOptions, ...) error
- func (r *Runner) CaptureBytes(binary string, args []string) ([]byte, []byte, error)
- func (r *Runner) Chartify(release, dirOrChart string, opts ...ChartifyOption) (string, error)
- func (r *Runner) DeprecatedCaptureBytes(cmd string) ([]byte, []byte, error)
- func (r *Runner) DeprecatedExec(cmd string) error
- func (r *Runner) Diff(release, chart string, opts ...DiffOption) (bool, error)
- func (r *Runner) Inject(files []string, o InjectOpts) error
- func (r *Runner) KustomizeBuild(srcDir string, tempDir string, opts ...KustomizeBuildOption) (string, error)
- func (r *Runner) Patch(tempDir string, generatedManifestFiles []string, opts ...PatchOption) (string, error)
- func (r *Runner) Render(release, chart string, templateOpts RenderOpts) error
- func (r *Runner) ReplaceWithRendered(name, chart string, files []string, o ReplaceWithRenderedOpts) ([]string, error)
- func (r *Runner) Run(name string, args ...string) (string, error)
- func (r *Runner) SearchFiles(o SearchFileOpts) ([]string, error)
- func (r *Runner) Upgrade(release, chart string, o UpgradeOpts) error
- type SearchFileOpts
- type UpgradeOpts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultRunCommand ¶
func TillerNamespace ¶
func TillerNamespace(tillerNs string) *tillerNamespace
func TillerStorageBackend ¶ added in v0.6.0
func TillerStorageBackend(s string) *storage
func YamlMarshal ¶
Types ¶
type AdoptOption ¶
type AdoptOpts ¶
type AdoptOpts struct { *ClientOpts Namespace string TillerNamespace string Out io.Writer }
type ChartifyOption ¶
type ChartifyOption interface {
SetChartifyOption(opts *ChartifyOpts) error
}
func WithChartifyOpts ¶
func WithChartifyOpts(opts *ChartifyOpts) ChartifyOption
type ChartifyOpts ¶
type ChartifyOpts struct { // Debug when set to true passes `--debug` flag to `helm` in order to enable debug logging Debug bool // ValuesFiles are a list of Helm chart values files ValuesFiles []string // SetValues is a list of adhoc Helm chart values being passed via helm's `--set` flags SetValues []string // Namespace is the default namespace in which the K8s manifests rendered by the chart are associated Namespace string // ChartVersion is the semver of the Helm chart being used to render the original K8s manifests before various tweaks applied by helm-x ChartVersion string // TillerNamespace is the namespace Tiller or Helm v3 creates "release" objects(configmaps or secrets depending on the storage backend chosen) TillerNamespace string // EnableKustomizAlphaPlugins will add the `--enable_alpha_plugins` flag when running `kustomize build` EnableKustomizeAlphaPlugins bool Injectors []string Injects []string AdhocChartDependencies []string JsonPatches []string StrategicMergePatches []string }
func (*ChartifyOpts) SetChartifyOption ¶
func (s *ChartifyOpts) SetChartifyOption(opts *ChartifyOpts) error
type ClientOpts ¶
type DiffOption ¶
type DiffOpts ¶
type DiffOpts struct { *ChartifyOpts *ClientOpts Chart string AllowUnreleased bool DetailedExitcode bool ResetValues bool Out io.Writer // contains filtered or unexported fields }
func (*DiffOpts) SetDiffOption ¶
type InjectOpts ¶
type InjectOpts struct {
// contains filtered or unexported fields
}
type KustomizeBuildOption ¶
type KustomizeBuildOption interface {
SetKustomizeBuildOption(opts *KustomizeBuildOpts) error
}
type KustomizeBuildOpts ¶
func (*KustomizeBuildOpts) SetKustomizeBuildOption ¶
func (o *KustomizeBuildOpts) SetKustomizeBuildOption(opts *KustomizeBuildOpts) error
type KustomizeImage ¶
type KustomizeImage struct { Name string `yaml:"name"` NewName string `yaml:"newName"` NewTag string `yaml:"newTag"` Digest string `yaml:"digest"` }
func (KustomizeImage) String ¶
func (img KustomizeImage) String() string
type KustomizeOpts ¶
type KustomizeOpts struct { Images []KustomizeImage `yaml:"images"` NamePrefix string `yaml:"namePrefix"` NameSuffix string `yaml:"nameSuffix"` Namespace string `yaml:"namespace"` }
type PatchOption ¶
type PatchOpts ¶
func (*PatchOpts) SetPatchOption ¶
type RenderOpts ¶
type RenderOpts struct { *ChartifyOpts IncludeReleaseConfigmap bool IncludeReleaseSecret bool Out io.Writer }
type ReplaceWithRenderedOpts ¶
type ReplaceWithRenderedOpts struct { // Debug when set to true passes `--debug` flag to `helm` in order to enable debug logging Debug bool // ValuesFiles are a list of Helm chart values files ValuesFiles []string // SetValues is a list of adhoc Helm chart values being passed via helm's `--set` flags SetValues []string // Namespace is the default namespace in which the K8s manifests rendered by the chart are associated Namespace string // ChartVersion is the semver of the Helm chart being used to render the original K8s manifests before various tweaks applied by helm-x ChartVersion string }
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
func (*Runner) Adopt ¶
func (r *Runner) Adopt(release string, resources []string, pathOptions *clientcmd.PathOptions, opts ...AdoptOption) error
func (*Runner) CaptureBytes ¶
func (*Runner) Chartify ¶
func (r *Runner) Chartify(release, dirOrChart string, opts ...ChartifyOption) (string, error)
Chartify creates a temporary Helm chart from a directory or a remote chart, and applies various transformations. Returns the full path to the temporary directory containing the generated chart if succeeded.
Parameters: * `release` is the name of Helm release being installed
func (*Runner) DeprecatedCaptureBytes ¶
DeprecatedCaptureBytes takes a command as a string and executes it, and returns the captured stdout and stderr
func (*Runner) DeprecatedExec ¶
DeprecatedExec takes a command as a string and executes it
func (*Runner) Diff ¶
func (r *Runner) Diff(release, chart string, opts ...DiffOption) (bool, error)
Diff returns true when the diff succeeds and changes are detected.
func (*Runner) KustomizeBuild ¶
func (*Runner) Render ¶
func (r *Runner) Render(release, chart string, templateOpts RenderOpts) error
Render generates K8s manifests for the named release from the chart, and prints the resulting manifests to STDOUT
func (*Runner) ReplaceWithRendered ¶
func (*Runner) SearchFiles ¶
func (r *Runner) SearchFiles(o SearchFileOpts) ([]string, error)
SearchFiles returns a slice of files that are within the base path, has a matching sub path and file type
type SearchFileOpts ¶
type SearchFileOpts struct {
// contains filtered or unexported fields
}
type UpgradeOpts ¶
type UpgradeOpts struct { *ChartifyOpts *ClientOpts Timeout int Install bool DryRun bool ResetValues bool Adopt []string Out io.Writer // contains filtered or unexported fields }