Should "kpt fn run" include "kpt live"-managed "inventory" ConfigMap in its ResourceList?
Following from #629, when running kpt fn run against a package in which I've run kpt live init, the invoked function receives the ConfigMap manifest named "inventory" (stored in file inventory-template.yaml) as an item in the supplied ResourceList object. Given that this file is created, read, and rewritten by kpt, it strikes me as surprising, dangerous, and burdensome to subject the content to these kpt fn run functions.
Authors of these functions have to deliberately ignore this object in order to avoid the risk of corrupting it. If there was a standard predicate available in the various language-specific function libraries to skip over this object, that would help, but I'd prefer instead to elide this object entirely as input to kpt fn run, or maybe to introduce a command-line flag that allows opting into including this file, still leaving it out by default.
/assign
I'm not sure... but is that what the annotation "config.kubernetes.io/local-config" is for?
I interpret it as 'local-config' only, ie should tools ignore this file? "true" or "false"
References:
https://github.com/kubernetes-sigs/kustomize/blob/master/cmd/config/docs/commands/run-fns.md#config-functions
https://googlecontainertools.github.io/kpt-functions-sdk/run/
I'm not sure we should limit the ability to modify the inventory file. I was able to find a use case for allowing the namespace in inventory.yaml to be modified by kpt cfg set . namespace foo. This was so that I could pre-create the inventory.yaml for a project that would ultimately be deployed to multiple different namespaces. All the user has to do is:
$ kpt cfg set . namespace foo
$ kpt live apply .