At the moment, at migrate/update time, there is a merge of the old and new properties helm by the instance. However, this merge of properties does not take account of nested maps that need to be recursively merged.

Solution 1

For any "property" of the new Map, recursive update will be apply only if in both new and old map, the type of the value "map.get(property)" are Map.

Type of

oldMap.get(property)

Type of

newMap.get(property)

Operation
int/string/boolean/listMapupdate
Mapint/string/boolean/listupdate
int/string/boolean/listint/string/boolean/listupdate
MapMaprecursive update
not presentint/string/boolean/list/mapno update
int/string/boolean/list/mapnot presentinsert
nullint/string/boolean/list/mapdelete

Example

Instance properties
properties:
  chart:
    chartId:
      name: acelement
      version: 0.1.0
    namespace: default
    releaseName: acm-starter
    podName: acm-starter
Instance update/migrate properties
properties:
  chart:
    releaseName: acm-starter-new
    podKey: 123
    podName: null


Merged properties
properties:
  chart:
    chartId:
      name: acelement
      version: 0.1.0
    namespace: default
    releaseName: acm-starter-new
    podKey: 123
  • No labels