Documentation
¶
Index ¶
- Constants
- func BuildComponentInFilePath(componentType, componentName, relPath string) string
- func BuildComponentYqPath(componentType, componentName, relPath string) string
- func InferVarType(hclType, rawValue string) (string, bool)
- func PickProvenanceFile(entries []merge.ProvenanceEntry) (file string, line int, ok bool)
- func ProcessYAMLConfigFile(atmosConfig *schema.AtmosConfiguration, basePath string, filePath string, ...) (*schema.StackManifestProcessingResult, error)
- func ProcessYAMLConfigFiles(atmosConfig *schema.AtmosConfiguration, stacksBasePath string, ...) ([]string, map[string]any, map[string]map[string]any, error)
- func VarNameFromRelPath(relPath string) (string, bool)
Constants ¶
const ComponentsSectionName = "components"
ComponentsSectionName is the top-level stack manifest key under which all components are nested.
Variables ¶
This section is empty.
Functions ¶
func BuildComponentInFilePath ¶ added in v1.223.0
BuildComponentInFilePath maps a component-relative dot-path (e.g. "vars.region") to its location inside a stack manifest file, which nests component config under components.<type>.<name>. Segments are joined raw (unescaped), matching how merge provenance keys are recorded (see pkg/utils.AppendJSONPathKey), so this form is used for provenance lookups. For addressing YAML nodes safely, use BuildComponentYqPath instead.
Example: ("terraform", "vpc", "vars.region") -> "components.terraform.vpc.vars.region".
func BuildComponentYqPath ¶ added in v1.223.0
BuildComponentYqPath builds the same component-relative location as BuildComponentInFilePath but quotes the literal structural segments (componentType, componentName) when they are not simple identifiers, so a component named "vpc.prod" or "foo[0]" addresses the correct manifest node instead of being parsed as nested path syntax. The relPath is appended as-is because it is already user-facing dot-path syntax (parsed downstream by the YAML path translator). Use this form for all real YAML reads/writes.
Example: ("terraform", `vpc.prod`, "vars.region") ->
`components.terraform."vpc.prod".vars.region`.
func InferVarType ¶
InferVarType maps a Terraform-declared HCL variable type (the raw source text captured by terraform-config-inspect, e.g. "string", "number", "list(string)") plus the raw CLI value being set to the atmosyaml.TypeXXX `stack set --type=auto` should use. Returns ("", false) when hclType is empty/"any" (implicit any -- no signal), unrecognized, or -- for "number" -- when rawValue doesn't parse as either an int or a float.
func PickProvenanceFile ¶ added in v1.223.0
func PickProvenanceFile(entries []merge.ProvenanceEntry) (file string, line int, ok bool)
PickProvenanceFile returns the source file (and line) of the winning provenance entry for a path. Provenance records entries in merge order, so the LAST entry is usually the one whose value is effective after deep-merge -- but every ancestor stack file in an import chain re-walks the already-merged tree and records its own pass-through entry (Line: 0) even for keys it never actually sets, so a value defined only in an imported file is otherwise shadowed by a phantom trailing entry. Scan backward for the last entry with a concrete position (Line > 0); fall back to the literal last entry only if none qualify. Returns ok=false when there are no entries (the path is not defined anywhere).
func ProcessYAMLConfigFile ¶
func ProcessYAMLConfigFile( atmosConfig *schema.AtmosConfiguration, basePath string, filePath string, importsConfig map[string]map[string]any, context map[string]any, ignoreMissingFiles bool, skipTemplatesProcessingInImports bool, ignoreMissingTemplateValues bool, skipIfMissing bool, parentTerraformOverridesInline map[string]any, parentTerraformOverridesImports map[string]any, parentHelmfileOverridesInline map[string]any, parentHelmfileOverridesImports map[string]any, atmosManifestJsonSchemaFilePath string, ) (*schema.StackManifestProcessingResult, error)
ProcessYAMLConfigFile takes a path to a YAML stack manifest, recursively processes and deep-merges all the imports, and returns the processing result.
func ProcessYAMLConfigFiles ¶
func ProcessYAMLConfigFiles( atmosConfig *schema.AtmosConfiguration, stacksBasePath string, terraformComponentsBasePath string, helmfileComponentsBasePath string, packerComponentsBasePath string, ansibleComponentsBasePath string, filePaths []string, processStackDeps bool, processComponentDeps bool, ignoreMissingFiles bool, ) ( []string, map[string]any, map[string]map[string]any, error, )
ProcessYAMLConfigFiles takes a list of paths to stack manifests, processes and deep-merges all imports, and returns a list of stack configs.
func VarNameFromRelPath ¶
VarNameFromRelPath reports whether relPath addresses a top-level vars.<name> value (e.g. "vars.replicas" -> ("replicas", true)) and, if so, returns the variable name. Anything else -- non-vars paths, nested attribute paths (vars.foo.bar), indexed paths (vars.foo[0]) -- returns ("", false): a raw Terraform-declared type string can't tell us the shape of a nested attribute or list element without full type-expression parsing, which is out of scope for this lookup.
Types ¶
This section is empty.