Skip to main content

convert_v1alpha1_to_v1

Function convert_v1alpha1_to_v1 

Source
pub fn convert_v1alpha1_to_v1(value: Value) -> Result<Value, Error>
Expand description

Converts a JSON-encoded v1alpha1 Materialize object to v1, for use by the CRD conversion webhook.

Output fields are exactly the input fields, mapped field-wise, plus derived fields when the input is complete. Server-side apply round-trips each field manager’s owned subset of an object through the conversion webhook when it reconciles managed fields recorded at another version. Those subsets routinely lack required fields, so conversion must accept partial objects, and it must not add fields the input did not carry, since a field manager must not gain ownership of fields it never set.

Fields derived from the complete spec (status.requestedRolloutHash here, spec.requestRollout in the other direction) cannot be computed from a subset, so they are spliced in from the typed conversion only when the input deserializes as a complete object. The request carries no indicator of partialness, so a subset that happens to contain every required field also gains the derived fields. That is the irreducible ambiguity, and it is limited to exactly those fields.