Hi,
I have several containers pushing concurrently updates to the same CRD object. Something like: statuses: [{"name": "foo", "status": "ok"},{"name":"bar", "status":"ko"}]
, with the “foo” and “bar” containers updating their status field.
I’d use a strategic merge patch for that (with strategicMergeKey = name), but they aren’t available for CRDs. How should I deisgn that?
- Do get & generate a new CRD & update, but since it’ll regularly fail it I have concurrent updates, retry that several times?
- Move my schema to
statuses: {"foo": {"status": "ok"}, "bar": {"status": "ko"}}
? But it is discoruaged by the Kubernetes API convention. In fact, this solution was initially what was proposed to solve this patch issue Document why we don't use maps in the API in api-conventions.md · Issue #2004 · kubernetes/kubernetes · GitHub API should differentiate between lists to merge and lists to replace in reconciliation · Issue #4889 · kubernetes/kubernetes · GitHub But it was eventually fixed by implementing strategic merge patch https://github.com/kubernetes/kubernetes/pull/6027 … which isn’t available for CRDs.