Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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.

In order to apply the recursive update it needs to implement the recursive properties validation.
Using same methods for the validation, we can convert properly what is supposed to be a Map by definition.

Work Breakdown:

  • Create reusable methods to retrieve data structure of the properties
  • Implement validation in creation, update and migrate of the instance
  • Implement recursive merge and add eventually additional validations in migration
  • participant needs same recursive merge, so needs the full service template in priming time

Unresolved question:

...

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

Code Block
languageyml
titleInstance properties
properties:
  chart:
    chartId:
      name: acelement
      version: 0.1.0
    namespace: default
    releaseName: acm-starter
    podName: acm-starter


Code Block
languageyml
titleInstance update/migrate properties
properties:
  chart:
    releaseName: acm-starter-new
    podKey: 123
    podName: null


Code Block
languageyml
titleMerged properties
properties:
  chart:
    chartId:
      name: acelement
      version: 0.1.0
    namespace: default
    releaseName: acm-starter-new
    podKey: 123

...