Setting the json tags is needed as we marshal this struct in the cel-policy, kw.oci.getManifest() function to return it as map.
To honour this new contract with the json tags, mark fields as exported.
This also simplifies creating mocks with this type struct without type casting.
Note that API is still backwards compatible as we were using the fields via the getters, which are untouched. Plus, cel-policy seems to be the first consumer of this.
Description
Relates to https://github.com/kubewarden/cel-policy/issues/31
Setting the json tags is needed as we marshal this struct in the cel-policy,
kw.oci.getManifest()
function to return it as map.To honour this new contract with the json tags, mark fields as exported. This also simplifies creating mocks with this type struct without type casting.
Note that API is still backwards compatible as we were using the fields via the getters, which are untouched. Plus, cel-policy seems to be the first consumer of this.
Test
CI, and the followup cel-policy PR.
Additional Information
Tradeoff
Potential improvement