/
Recursive updates of the properties in cache
Recursive updates of the properties in cache
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/list | Map | update |
Map | int/string/boolean/list | update |
int/string/boolean/list | int/string/boolean/list | update |
Map | Map | recursive update |
not present | int/string/boolean/list/map | no update |
int/string/boolean/list/map | not present | insert |
null | int/string/boolean/list/map | delete |
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