In order to figure out which object was updated we will store resourceVersion of resource definition on child object as an annotation:
definitionVersion: "31231231"
During deployment orchestration we will compare current resource definition resourceVersion with one stored on child resource and update child in case if it will be necessary.
In order to update - we will copy UUID and resourceVersion from object stored in kubernetes onto object retrieved from resource definition and push it to k8s api. It should be possible to write single function that will do this transformation.
I am assuming that we want to preserve original order of deployment during update, so if deployment1 was created before deployment2 - it should be also updated this way. Thus we need to guarantee that if two objects were updated concurrently we will always verify state of parent, and invalidate it, before validating deployment2.
In order to figure out which object was updated we will store resourceVersion of resource definition on child object as an annotation:
During deployment orchestration we will compare current resource definition resourceVersion with one stored on child resource and update child in case if it will be necessary.
In order to update - we will copy UUID and resourceVersion from object stored in kubernetes onto object retrieved from resource definition and push it to k8s api. It should be possible to write single function that will do this transformation.
I am assuming that we want to preserve original order of deployment during update, so if deployment1 was created before deployment2 - it should be also updated this way. Thus we need to guarantee that if two objects were updated concurrently we will always verify state of parent, and invalidate it, before validating deployment2.