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

@@ -15,11 +15,12 @@
*/
locals {
prefix = var.prefix == null || var.prefix == "" ? "" : "${var.prefix}_"
prefix = var.prefix == null || var.prefix == "" ? "" : "${var.prefix}_"
_factory_listings_path = pathexpand(coalesce(var.factories_config.listings, "-"))
_factory_listings = {
for f in try(fileset(var.factories_config.listings, "*.yaml"), []) :
for f in try(fileset(local._factory_listings_path, "*.yaml"), []) :
trimsuffix(f, ".yaml") => yamldecode(
file("${var.factories_config.listings}/${f}")
file("${local._factory_listings_path}/${f}")
)
}
factory_listings = merge(local._factory_listings, var.listings)