Documentation ¶
Index ¶
- Constants
- func DefaultFilenameForProfile(profile string) string
- func GenerateHubTagOverlay(hub, tag string) (string, error)
- func GetFilesRecursive(f fs.FS, root string) ([]string, error)
- func GetProfileYAML(installPackagePath, profileOrPath string) (string, error)
- func IsDefaultProfile(profile string) bool
- func ListProfiles(charts string) ([]string, error)
- func LoadValues(profileName string, chartsDir string) (string, error)
- func ReadProfileYAML(profile, manifestsPath string) (string, error)
- type Renderer
- type TemplateFilterFunc
- type TemplateRenderer
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 ( // DefaultProfileFilename is the name of the default profile yaml file. DefaultProfileFilename = "default.yaml" ChartsSubdirName = "charts" )
Variables ¶
This section is empty.
Functions ¶
func DefaultFilenameForProfile ¶
DefaultFilenameForProfile returns the profile name of the default profile for the given profile.
func GenerateHubTagOverlay ¶
GenerateHubTagOverlay creates an IstioOperatorSpec overlay YAML for hub and tag.
func GetProfileYAML ¶
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 ¶
IsDefaultProfile reports whether the given profile is the default profile.
func ReadProfileYAML ¶
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 ¶
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.
type TemplateFilterFunc ¶
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.)