Documentation
¶
Index ¶
- Constants
- func GetModuleName(moduleYamlFile *ModuleYaml, chartYamlFile *ChartYaml) string
- func IsSymlink(fi os.FileInfo) bool
- func LoadModuleAsChart(moduleName, dir string) (*chart.Chart, error)
- func RenderModuleForValuesFile(modulePath string, globalSchema *spec.Schema, valuesFile string) (map[string]string, error)
- func RenderModuleWithValues(modulePath string, userValues map[string]any) (map[string]string, error)
- func RunRender(m *Module, vals chartutil.Values, objectStore *storage.UnstructuredObjectStore, ...) error
- func ToLowerCamel(s string) string
- func Walk(root string, walkFn filepath.WalkFunc) error
- type ChartYaml
- type Module
- func (m *Module) GetChart() *chart.Chart
- func (m *Module) GetMetadata() *chart.Metadata
- func (m *Module) GetModuleConfig() *pkg.LintersSettings
- func (m *Module) GetName() string
- func (m *Module) GetNamespace() string
- func (m *Module) GetObjectStore() *storage.UnstructuredObjectStore
- func (m *Module) GetPath() string
- func (m *Module) GetStorage() map[storage.ResourceIndex]storage.StoreObject
- func (m *Module) GetValues() map[string]any
- func (m *Module) GetWerfFile() string
- func (m *Module) Release()
- func (m *Module) String() string
- type ModuleList
- type ModuleYaml
Constants ¶
const ( ChartConfigFilename = "Chart.yaml" ModuleConfigFilename = "module.yaml" )
Variables ¶
This section is empty.
Functions ¶
func GetModuleName ¶
func GetModuleName(moduleYamlFile *ModuleYaml, chartYamlFile *ChartYaml) string
func LoadModuleAsChart ¶
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 renders the module's chart through nelm's public action.ChartRender and stores the resulting objects for the linters. The render is tolerant per template (see render.Render): a template that aborts — an intentional `fail`, or a `required` on a value dmt cannot supply offline — is dropped and reported as a non-fatal warning, so the rest of the chart is still stored and linted. Only a render error that cannot be localized to a droppable template fails module creation. Image references resolve from dmt's value stubs (global.modulesImages, scanned from images/).
func ToLowerCamel ¶
ToLowerCamel converts a string to lowerCamelCase
func Walk ¶
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 ¶
func ParseChartFile ¶
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
func NewRemoteModule ¶ added in v0.2.4
NewRemoteModule builds a module from a directory extracted out of a registry image. An image carries neither a loadable chart nor rendered objects, so this skips the render pipeline NewModule runs: the release and bundle scopes only ask for rules that need the path.
The invariant that buys is one those scope tables have to keep — a rule reaching for GetChart, GetObjectStore or GetValues here finds nil. name comes from the image reference rather than module.yaml, because a module.yaml missing from the image is one of the things the layout rules are there to report.
func (*Module) GetMetadata ¶
func (*Module) GetModuleConfig ¶
func (m *Module) GetModuleConfig() *pkg.LintersSettings
func (*Module) GetNamespace ¶
func (*Module) GetObjectStore ¶
func (m *Module) GetObjectStore() *storage.UnstructuredObjectStore
func (*Module) GetStorage ¶
func (m *Module) GetStorage() map[storage.ResourceIndex]storage.StoreObject
func (*Module) GetWerfFile ¶
func (*Module) Release ¶ added in v0.2.4
func (m *Module) Release()
Release returns the module's rendered object store to the shared pool and detaches it from the module. Call it once the module has been fully linted; the module (and any object obtained from its store) must not be used afterwards. Safe to call more than once and on a nil module.
type ModuleList ¶
type ModuleList []*Module
type ModuleYaml ¶
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 |