helm

package
v0.0.0-...-d7df7b9 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: Apache-2.0 Imports: 17 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// YAMLSeparator is a separator for multi-document YAML files.
	YAMLSeparator = "\n---\n"

	// DefaultProfileString is the name of the default profile.
	DefaultProfileString = "default"

	// NotesFileNameSuffix is the file name suffix for helm notes.
	// see https://helm.sh/docs/chart_template_guide/notes_files/
	NotesFileNameSuffix = ".txt"
)
View Source
const (
	// DefaultProfileFilename is the name of the default profile yaml file.
	DefaultProfileFilename = "default.yaml"
	ChartsSubdirName       = "charts"
)

Variables

This section is empty.

Functions

func DefaultFilenameForProfile

func DefaultFilenameForProfile(profile string) string

DefaultFilenameForProfile returns the profile name of the default profile for the given profile.

func GenerateHubTagOverlay

func GenerateHubTagOverlay(hub, tag string) (string, error)

GenerateHubTagOverlay creates an IstioOperatorSpec overlay YAML for hub and tag.

func GetFilesRecursive

func GetFilesRecursive(f fs.FS, root string) ([]string, error)

func GetProfileYAML

func GetProfileYAML(installPackagePath, profileOrPath string) (string, error)

GetProfileYAML returns the YAML for the given profile name, using the given profileOrPath string, which may be either a profile label or a file path.

func IsDefaultProfile

func IsDefaultProfile(profile string) bool

IsDefaultProfile reports whether the given profile is the default profile.

func ListProfiles

func ListProfiles(charts string) ([]string, error)

list all the profiles.

func LoadValues

func LoadValues(profileName string, chartsDir string) (string, error)

func ReadProfileYAML

func ReadProfileYAML(profile, manifestsPath string) (string, error)

ReadProfileYAML reads the YAML values associated with the given profile. It uses an appropriate reader for the profile format (compiled-in, file, HTTP, etc.).

Types

type Renderer

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

Renderer is a helm template renderer for a fs.FS.

func NewGenericRenderer

func NewGenericRenderer(files fs.FS, dir, componentName, namespace string, version *version.Info) *Renderer

NewFileTemplateRenderer creates a TemplateRenderer with the given parameters and returns a pointer to it. helmChartDirPath must be an absolute file path to the root of the helm charts.

func (*Renderer) RenderManifest

func (h *Renderer) RenderManifest(values string) (string, error)

RenderManifest renders the current helm templates with the current values and returns the resulting YAML manifest string.

func (*Renderer) RenderManifestFiltered

func (h *Renderer) RenderManifestFiltered(values string, filter TemplateFilterFunc) (string, error)

RenderManifestFiltered filters templates to render using the supplied filter function.

func (*Renderer) Run

func (h *Renderer) Run() error

Run implements the TemplateRenderer interface.

type TemplateFilterFunc

type TemplateFilterFunc func(string) bool

TemplateFilterFunc filters templates to render by their file name

type TemplateRenderer

type TemplateRenderer interface {
	// Run starts the renderer and should be called before using it.
	Run() error
	// RenderManifest renders the associated helm charts with the given values YAML string and returns the resulting
	// string.
	RenderManifest(values string) (string, error)
	// RenderManifestFiltered filters manifests to render by template file name
	RenderManifestFiltered(values string, filter TemplateFilterFunc) (string, error)
}

TemplateRenderer defines a helm template renderer interface.

func NewHelmRenderer

func NewHelmRenderer(operatorDataDir, helmSubdir, componentName, namespace string, version *version.Info) TemplateRenderer

NewHelmRenderer creates a new helm renderer with the given parameters and returns an interface to it. The format of helmBaseDir and profile strings determines the type of helm renderer returned (compiled-in, file, HTTP etc.)

Jump to

Keyboard shortcuts

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