helm

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2025 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chart

type Chart struct {
	*helmchart.Chart
	// contains filtered or unexported fields
}

Chart describes an inspected Helm Chart that has been rendered to actual Kubernetes resources. This struct inherits from helm sdk-go's Chart struct and therefore exposes all of that struct's methods and metadata getters.

func Inspect

func Inspect(
	ctx context.Context,
	subject any,
	opt ...InspectOption,
) (*Chart, error)

Inspect returns a `Chart` that describes a Helm Chart that has been rendered to actual Kubernetes resource manifests.

The `subject` argument can be a filepath, a URL, a helm sdk-go `*Chart` struct, or an `io.Reader` pointing at either a directory or a compressed tar archive.

func (*Chart) OptionalResources

func (c *Chart) OptionalResources(
	ctx context.Context,
) ([]*OptionalResource, error)

OptionalResources returns a slice of OptionalResourceMeta objects that describe the optional Kubernetes Resources that the Helm Chart may install.

func (*Chart) Resources

func (c *Chart) Resources(
	ctx context.Context,
) ([]*unstructured.Unstructured, error)

Resources returns a slice of Kubernetes resources installed by the Helm Chart that match a supplied filter.

type InspectOption

type InspectOption func(opts *InspectOptions)

func WithValues

func WithValues(vals any) InspectOption

WithValues allows passing values.yaml overrides to the Inspect function.

The `vals` parameter should be a string or a map of string to interface.

You may choose to pass a "strvals" single string, e.g. "pdb.create=true", instead of a nested map.

type InspectOptions

type InspectOptions struct {
	// contains filtered or unexported fields
}

InspectOptions is a mechanism for you to control the inspection of a Helm Chart.

type OptionalResource

type OptionalResource struct {
	// GroupKind is the Kubernetes GroupKind that was identified for the
	// Resource during inspection.
	GroupKind schema.GroupKind
	// DefaultName is the name of the Resource that would be rendered with the
	// default values collection.
	DefaultName string
	// ValueToggle is the strvals notation for the configuration value that
	// toggles the creation or enablement of this Resource. For example, assume
	// the very common practice of optionally creating a ServiceAccount
	// Resource when the `serviceAccount.create` value is set to "true", this
	// field would contain "serviceAccount.create=true"
	ValueToggle string
	// DefaultEnabled is true when the Resource is created/enabled when the
	// default values configuration is used during installation.
	DefaultEnabled bool
}

OptionalResource contains information about a Kubernetes Resource that the Helm Chart may install.

Jump to

Keyboard shortcuts

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