This is a suggestion based off some investigatory work when trying to convert v1alpha5 Runs into v1alpha6. When inlining JSON within a struct it can cause issues:
Overwriting fields with non-unique keys,
Prevents the use of manual marshalling / unmarshalling implementations
The latter is preventing us from removing the current implementation of ProviderId marshalling and replacing the marshalling rules within the Status struct instead (This would be much better than the current implementation as it is not possible to marshal and unmarshal a Status struct independently from a whole resource struct. eg Runs).
By applying this PR we can move away from embedding the Status struct in within the RunStatus which frees up the possibility of custom marshalling in v1alpha7 handling the ProviderId conversion to a string field in a cleaner way.
Downsides to this are the Status will be nested within the existing Status field for Runs.
This is a suggestion based off some investigatory work when trying to convert
v1alpha5
Runs intov1alpha6
. When inlining JSON within a struct it can cause issues:The latter is preventing us from removing the current implementation of ProviderId marshalling and replacing the marshalling rules within the
Status
struct instead (This would be much better than the current implementation as it is not possible to marshal and unmarshal aStatus
struct independently from a whole resource struct. egRuns
).By applying this PR we can move away from embedding the Status struct in within the RunStatus which frees up the possibility of custom marshalling in
v1alpha7
handling the ProviderId conversion to a string field in a cleaner way.Downsides to this are the Status will be nested within the existing
Status
field for Runs.Links to https://github.com/sky-uk/kfp-operator/issues/364 for v1alpha6 changes to api spec