Documentation
¶
Index ¶
- func ComposeValuesFromSchemas(modulePath, moduleName string, globalSchema *spec.Schema) (chartutil.Values, error)
- func ComposeValuesFromSchemasForValuesFile(modulePath, moduleName string, globalSchema *spec.Schema, valuesFile string) (chartutil.Values, error)
- func GetGlobalValues(rootDir string) (*spec.Schema, error)
- func GetModuleValuesForValuesFile(modulePath, valuesFile string) (*spec.Schema, error)
- func HelmFormatModuleImages(modulePath, moduleName string, rawValues map[string]any) (chartutil.Values, error)
- func ModuleCamelName(name string) string
- func OverrideValues(values, vals *chartutil.Values) error
- type SchemaType
- type Schemas
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComposeValuesFromSchemas ¶
func ComposeValuesFromSchemas(modulePath, moduleName string, globalSchema *spec.Schema) (chartutil.Values, error)
ComposeValuesFromSchemas generates a module's render values from its openapi schemas (default "values.yaml"), keyed by the module's path and name.
func ComposeValuesFromSchemasForValuesFile ¶
func ComposeValuesFromSchemasForValuesFile(modulePath, moduleName string, globalSchema *spec.Schema, valuesFile string) (chartutil.Values, error)
ComposeValuesFromSchemasForValuesFile is like ComposeValuesFromSchemas but generates the module values from the given openapi values schema file name (e.g. "values_ce.yaml") instead of the default "values.yaml".
func GetModuleValuesForValuesFile ¶
GetModuleValuesForValuesFile loads the module values schema from the given file name inside the module's openapi directory (e.g. "values.yaml" or "values_ce.yaml"). The "config-values.yaml" schema, when present, is always used as the base.
func HelmFormatModuleImages ¶
func HelmFormatModuleImages(modulePath, moduleName string, rawValues map[string]any) (chartutil.Values, error)
HelmFormatModuleImages injects dmt's render stubs into the module's values: image digests (scanned from images/, keyed by the module's camelCase name), a fake registry, and the gateway-API discovery stub. It returns the .Values tree fed to the renderer; .Release and .Capabilities are supplied by nelm (extra API versions travel separately as render.ExtraAPIVersions).
func ModuleCamelName ¶
ModuleCamelName converts a module name to the camelCase key deckhouse_lib_helm uses for it. It mirrors helm_lib_module_camelcase_name exactly (name | replace "-" "_" | camelcase | untitle), which matters because dmt keys the module's render values — image digests and per-module settings — under this name so the real helm_lib helpers resolve them at render time. ToLowerCamel here is unsuitable: it inserts word boundaries around digits (l2 -> l2, but e2e -> e2E), diverging from helm_lib on names like "l2-load-balancer".
func OverrideValues ¶
OverrideValues deep-merges vals into the module's generated .Values tree, with vals winning on conflicts. values is the flat .Values tree fed straight to the renderer (see render.Options.Values), so vals must be merged at that same level — e.g. a --values-file or a matrix variant's overrides carry `{<module>: {...}, global: {...}}` and set `.Values.<module>....`. Wrapping vals under a "Values" key here would misplace it at `.Values.Values....`, where no template reads it.
Types ¶
type SchemaType ¶
type SchemaType string
const ( ConfigValuesSchema SchemaType = "config" ValuesSchema SchemaType = "values" HelmValuesSchema SchemaType = "helm" )
type Schemas ¶
type Schemas map[SchemaType]*spec.Schema
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. |
|
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 |