Pathexpand all factory data paths (#3033)

* Pathexpand all factory data paths

* fix net monitoring paths

* fix file paths

---------

Co-authored-by: Ludovico Magnocavallo <ludomagno@google.com>
This commit is contained in:
Simone Ruffilli
2025-04-16 13:28:10 +02:00
committed by GitHub
parent 088437fabd
commit c6c4cc71d5
12 changed files with 41 additions and 29 deletions

View File

@@ -16,12 +16,13 @@
locals {
# descriptive_name cannot contain colons, so we omit the universe from the default
_observability_factory_path = pathexpand(coalesce(var.factories_config.observability, "-"))
descriptive_name = (
var.descriptive_name != null ? var.descriptive_name : "${local.prefix}${var.name}"
)
observability_factory_data_raw = [
for f in try(fileset(var.factories_config.observability, "*.yaml"), []) :
yamldecode(file("${var.factories_config.observability}/${f}"))
for f in try(fileset(local._observability_factory_path, "*.yaml"), []) :
yamldecode(file("${local._observability_factory_path}/${f}"))
]
parent_type = var.parent == null ? null : split("/", var.parent)[0]
parent_id = var.parent == null ? null : split("/", var.parent)[1]