Open fsommar opened 4 years ago
Another difference I noticed just now is that the Typescript SDK result flattens the resource reference; putting name and namespace on the same level as kind and apiVersion. The Go SDK result, OTOH, follows the same syntax as declaring a resource, nesting name and namespace underneath metadata.
The severities in kyaml are error
, info
, warning
as opposed to the other two alternative's error
, info
, warn
.
Hi 👋
The Go function SDK, i.e. kyaml framework, is outputting function errors and warnings in a different format from the Typescript SDK, which in turn is also different from the Kpt function documentation.
Actual
Here's an example output from the Go function SDK (
sigs.k8s.io/kustomize/kyaml@v0.8.0
):Here's an example output from the Typescript SDK (
gcr.io/kpt-functions/suggest-psp@sha256:e7b66ce31f6386811c7f874384886b4cffde75501f09dfa864d9de0a1b752dfd
):These were generated by running
kpt fn source kubernetes/ | docker run -i image-name
. I was unable to find a CRD/spec for ResourceList other than what's mentioned in the kustomize repo.There is a third type of results object in the documentation:
Expected
I expected the results output to be aligned between the documentation and the Go and Typescript SDKs, and possibly for the function spec to include a section on the results object.
For now, we'll cover this scenario by trying to parse both result formats before calling it a fail.