Enable ValuesFrom.TargetPath to carry complex values

As we can see in flux API documentation:

	// TargetPath is the YAML dot notation path the value should be merged at. When
	// set, the ValuesKey is expected to be a single flat value. Defaults to 'None',
	// which results in the values getting merged at the root.

Consequently, tagetPath is hardly usable as is, as we often need to pass complex values.

In order to workaround that limitation, SWCO should transform the values to enable be mergeable with other without targetPath.

Supposing that we have this ValuesFrom definition:

- type: ConfigMap
  name: my-values
  valuesKey: values
  targetPath: units.loki.helmrelease_spec.values

And following Configmap:

kind: ConfigMap
metadata:
  name: loki-values
  namespace: swc-ns
values: |
  loki:
    compactor:
      compaction_interval: 10m
    limits_config:
      retention_period: 72h

Would be transformed to following ConfigMap in cluster namespace:

kind: ConfigMap
metadata:
  name: loki-values-254sqd64
  namespace: swc-cluster-ns
values: |
  units:
    loki:
      helmrelease_spec:
        values:
          loki:
            compactor:
              compaction_interval: 10m
            limits_config:
              retention_period: 72h
Assignee Loading
Time tracking Loading