istio: istio.io/istio/operator/pkg/helm Index | Files

package helm

import "istio.io/istio/operator/pkg/helm"

Index

Package Files

fs_renderer.go helm.go urlfetcher.go vfs_renderer.go

Constants

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"
)
const (
    // InstallationDirectory is temporary folder name for caching downloaded installation packages.
    InstallationDirectory = "istio-install-packages"
    // OperatorSubdirFilePath is file path of installation packages to helm charts.
    OperatorSubdirFilePath = "manifests"
    // OperatorSubdirFilePath15 is the file path of installation packages to helm charts for 1.5 and earlier.
    // TODO: remove in 1.7.
    OperatorSubdirFilePath15 = "install/kubernetes/operator"
)
const (
    DefaultProfileFilename = "default.yaml"
    ChartsSubdirName       = "charts"

    LocalBuildInfo = "" /* 285 byte string literal not displayed */

)

func BuiltinProfileToFilename Uses

func BuiltinProfileToFilename(name string) string

func CheckCompiledInCharts Uses

func CheckCompiledInCharts() error

CheckCompiledInCharts tests for the presence of compiled in charts. These can be missing if a developer creates binaries using go build instead of make and tries to use compiled in charts.

func DefaultFilenameForProfile Uses

func DefaultFilenameForProfile(profile string) string

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

func DownloadTo Uses

func DownloadTo(srcURL, dest string) (string, error)

DownloadTo downloads from remote srcURL to dest local file path

func GenerateHubTagOverlay Uses

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

GenerateHubTagOverlay creates an IstioOperatorSpec overlay YAML for hub and tag.

func GetProfileYAML Uses

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 Uses

func IsDefaultProfile(profile string) bool

IsDefaultProfile reports whether the given profile is the default profile.

func ListProfiles Uses

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

list all the profiles.

func LoadValues Uses

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

func LoadValuesVFS Uses

func LoadValuesVFS(profileName string) (string, error)

LoadValuesVFS loads the compiled in file corresponding to the given profile name.

func ReadProfileYAML Uses

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.).

func URLToDirname Uses

func URLToDirname(url string) (string, *version.Version, error)

URLToDirname, given an input URL pointing to an Istio release tar, returns the subdirectory name that the tar would be extracted to and the version in the URL. The input URLs are expected to have the form https://.../istio-{version}-{platform}[optional suffix].tar.gz.

type FileTemplateRenderer Uses

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

FileTemplateRenderer is a helm template renderer for a local filesystem.

func NewFileTemplateRenderer Uses

func NewFileTemplateRenderer(helmChartDirPath, componentName, namespace string) *FileTemplateRenderer

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 (*FileTemplateRenderer) RenderManifest Uses

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

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

func (*FileTemplateRenderer) RenderManifestFiltered Uses

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

RenderManifestFiltered filters templates to render using the supplied filter function.

func (*FileTemplateRenderer) Run Uses

func (h *FileTemplateRenderer) Run() error

Run implements the TemplateRenderer interface.

type TemplateFilterFunc Uses

type TemplateFilterFunc func(string) bool

TemplateFilterFunc filters templates to render by their file name

type TemplateRenderer Uses

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 Uses

func NewHelmRenderer(operatorDataDir, helmSubdir, componentName, namespace string) (TemplateRenderer, error)

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.)

type URLFetcher Uses

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

URLFetcher is used to fetch and manipulate charts from remote url

func NewURLFetcher Uses

func NewURLFetcher(url string, destDirRoot string) *URLFetcher

NewURLFetcher creates an URLFetcher pointing to installation package URL and destination dir to extract it into, and returns a pointer to it. url is the source URL where release tar is downloaded from. It should be in the form https://.../istio-{version}-{platform}.tar.gz i.e. the full URL path to the Istio release tar. destDirRoot is the root dir where charts are downloaded and extracted. If set to "", the destination dir will be set to the default value, which is static for caching purposes.

func (*URLFetcher) DestDir Uses

func (f *URLFetcher) DestDir() string

DestDir returns path of destination dir that the tar was extracted to.

func (*URLFetcher) Fetch Uses

func (f *URLFetcher) Fetch() error

Fetch fetches and untars the charts.

type VFSRenderer Uses

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

VFSRenderer is a helm template renderer that uses compiled-in helm charts.

func NewVFSRenderer Uses

func NewVFSRenderer(helmChartDirPath, componentName, namespace string) *VFSRenderer

NewVFSRenderer creates a VFSRenderer with the given relative path to helm charts, component name and namespace and a base values YAML string.

func (*VFSRenderer) RenderManifest Uses

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

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

func (*VFSRenderer) RenderManifestFiltered Uses

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

RenderManifestFiltered filters templates to render using the supplied filter function.

func (*VFSRenderer) Run Uses

func (h *VFSRenderer) Run() error

Run implements the TemplateRenderer interface.

Package helm imports 21 packages (graph) and is imported by 10 packages. Updated 2021-01-22. Refresh now. Tools for package owners.