modules

package
v0.1.97 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ChartConfigFilename  = "Chart.yaml"
	ModuleConfigFilename = "module.yaml"
)

Variables

This section is empty.

Functions

func GetModuleName

func GetModuleName(moduleYamlFile *ModuleYaml, chartYamlFile *ChartYaml) string
func IsSymlink(fi os.FileInfo) bool

IsSymlink is used to determine if the fileinfo is a symbolic link.

func LoadModuleAsChart

func LoadModuleAsChart(moduleName, dir string) (*chart.Chart, error)

LoadModuleAsChart loads a module as a chart default helm loader couldn't be used without Chart.yaml, but deckhouse module could exist without this file, deckhouse will create it automatically

func RenderModuleForValuesFile

func RenderModuleForValuesFile(modulePath string, globalSchema *spec.Schema, valuesFile string) (map[string]string, error)

RenderModuleForValuesFile renders the module at modulePath using values auto-generated from its openapi schemas (config-values.yaml plus the given values file, e.g. "values.yaml" or "values_ce.yaml") combined with the global schema, mirroring the value generation dmt uses while linting. It returns the rendered manifests keyed by chart-relative source file path.

func RenderModuleWithValues

func RenderModuleWithValues(modulePath string, userValues map[string]any) (map[string]string, error)

RenderModuleWithValues renders the module at modulePath with the supplied user values (the ".Values" tree, e.g. holding "global" and the module's own section) and returns the rendered manifests keyed by chart-relative source file path.

Image references resolve from dmt's image/registry stubs (digests scanned from images/, injected by values.HelmFormatModuleImages). Suitable for golden-snapshot tests.

func RunRender

func RunRender(m *Module, vals chartutil.Values, objectStore *storage.UnstructuredObjectStore, errorList *dmtErrors.LintRuleErrorsList) error

RunRender strictly renders the module's chart through nelm's public action.ChartRender and stores the resulting objects for the linters. Strict rendering mirrors how deckhouse-controller installs the module: a template error fails the whole render, so the module is reported rather than half-linted. Image references resolve from dmt's value stubs (global.modulesImages, scanned from images/).

func ToLowerCamel

func ToLowerCamel(s string) string

ToLowerCamel converts a string to lowerCamelCase

func Walk

func Walk(root string, walkFn filepath.WalkFunc) error

Walk walks the file tree rooted at root, calling walkFn for each file or directory in the tree, including root. All errors that arise visiting files and directories are filtered by walkFn. The files are walked in lexical order, which makes the output deterministic but means that for very large directories Walk can be inefficient. Walk follows symbolic links.

Types

type ChartYaml

type ChartYaml struct {
	Name    string `json:"name"`
	Version string `json:"version"`
}

func ParseChartFile

func ParseChartFile(path string) (*ChartYaml, error)

type Module

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

func NewModule

func NewModule(path string, vals *chartutil.Values, globalSchema *spec.Schema, rootConfig *config.RootConfig, errorList *dmtErrors.LintRuleErrorsList) (*Module, error)

func (*Module) GetChart

func (m *Module) GetChart() *chart.Chart

func (*Module) GetMetadata

func (m *Module) GetMetadata() *chart.Metadata

func (*Module) GetModuleConfig

func (m *Module) GetModuleConfig() *pkg.LintersSettings

func (*Module) GetName

func (m *Module) GetName() string

func (*Module) GetNamespace

func (m *Module) GetNamespace() string

func (*Module) GetObjectStore

func (m *Module) GetObjectStore() *storage.UnstructuredObjectStore

func (*Module) GetPath

func (m *Module) GetPath() string

func (*Module) GetStorage

func (m *Module) GetStorage() map[storage.ResourceIndex]storage.StoreObject

func (*Module) GetValues

func (m *Module) GetValues() map[string]any

func (*Module) GetWerfFile

func (m *Module) GetWerfFile() string

func (*Module) String

func (m *Module) String() string

type ModuleList

type ModuleList []*Module

type ModuleYaml

type ModuleYaml struct {
	Name      string `json:"name"`
	Namespace string `json:"namespace"`
}

func ParseModuleConfigFile

func ParseModuleConfigFile(path string) (*ModuleYaml, error)

Directories

Path Synopsis
schema/defaults
Package defaults generates a module's render values from its openapi schemas: it fills every property, honors `not: {required: [...]}` mutual exclusion, and picks the fullest x-examples entry.
Package defaults generates a module's render values from its openapi schemas: it fills every property, honors `not: {required: [...]}` mutual exclusion, and picks the fullest x-examples entry.
schema/reggen
Package reggen generates text based on regex definitions based on the reggen library by Lucas Jones https://github.com/lucasjones/reggen/blob/master/reggen.go
Package reggen generates text based on regex definitions based on the reggen library by Lucas Jones https://github.com/lucasjones/reggen/blob/master/reggen.go

Jump to

Keyboard shortcuts

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