Skip to content

utils_deep_merge_* expose the object #181

@sergiomcalzada

Description

@sergiomcalzada

Describe the Feature

After mergin the files you need to convert to an object the string. If you are chaining the merge a double encode is needed

Use Case

data "utils_deep_merge_json" "example" {
  for_each  = local.some_array
  input = [for s in each.value: jsonencode(s)]
}

resource "kubectl_manifest" "example" {    
  for_each  = data.utils_deep_merge_json.example
  yaml_body =  templatefile(**jsondecode(each.value.output).template**", merge(
                  **jsondecode(each.value.output).some_object**,
                  {
                    namespace = var.ns                    
                  },
                ))
}


Describe Ideal Solution

Expose the merged string as an object

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions