kpt-functions-sdk icon indicating copy to clipboard operation
kpt-functions-sdk copied to clipboard

CEL support for navigating the resource list

Open johnbelamaric opened this issue 2 years ago • 2 comments

Initial support for navigating the resource list and pulling out values using CEL.

This is a building block for https://github.com/GoogleContainerTools/kpt/issues/3964, but can be used directly by functions to interpret CEL-expression based inputs even if we do not yet implement that generally.

johnbelamaric avatar Sep 08 '23 18:09 johnbelamaric

@justinsb fyi, we discussed CEL the other day with respect to https://github.com/GoogleContainerTools/kpt/issues/3964

johnbelamaric avatar Sep 08 '23 19:09 johnbelamaric

So, I guess it's not clear immediately what this does. It enables us to use CEL to navigate the entire list of resources. It basically eliminates the need for apply replacements, likely in almost all cases, and the Starlark functions used in the value propagation pattern - if we plumb it into function inputs. For example, I can write items.with_apiVersion("v1").with_name("example2").with_kind("Namespace").metadata.annotations["foo"] as an expression, rather than using the apply replacements functions to copy that value into a config map and then use that for inputs.

johnbelamaric avatar Sep 13 '23 16:09 johnbelamaric