kpt-functions-sdk
kpt-functions-sdk copied to clipboard
Improve functionRunner interface
- Update
itemsfrom[]*KubeObjecttoKubeObjects. This aligns the resourceList.items with the latest change in https://github.com/GoogleContainerTools/kpt-functions-sdk/commit/78748f08d9977e08b5cf2dd678d04ed22d209a75#diff-7b055320c11f07c233d6db3fec422e3059d52a0f295a12e02b489aa4a539a50d - functionRunner can parse functionConfig value for
ConfigMap.Dataand custom functionConfig in two formats
For example, a SetLabel struct that implements Runner interface, have its Owner and Org value automatically parsed from either 1. SetLabels type with owner and org fields or 2. ConfigMap type with Data fields having keys owner and org
type SetLabels struct {
Owner string
Org string
}
FunctionConfig 1
apiVersion: fn.kpt.dev/v1alpha1
kind: SetLabel
metadata:
name: custom
owner: kpt
org: google
FunctionConfig 2
apiVersion: v1
kind: ConfigMap
metadata:
name: custom
data:
owner: kpt
org: google
cc @zyy98