feat: implement Kpt function conditional rendering via CEL (Issue #1084)#1086
feat: implement Kpt function conditional rendering via CEL (Issue #1084)#1086SurbhiAgarwal1 wants to merge 2 commits into
Conversation
- Fix GetFunctionCondition bug in kptfile.go (m → v in validators loop, GetFieldString → GetString, SubObjects → SliceSubObjects) - Implement CEL condition evaluation in cel.go with proper YAML unmarshaling - Add unit tests: cel_test.go and GetFunctionCondition tests in kptfile_test.go - Add e2e pipeline test with condition: 'false' on ipam-fn (upf_pkg_cond testdata) - Ensure server-side rendering stays consistent with local kpt fn render - Update dependencies: add cel-go to lib, fix genproto/googleapis/api version
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @SurbhiAgarwal1. Thanks for your PR. I'm waiting for a nephio-project member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
Hey, you're trying to work against the wrong repository here, please check: https://github.com/nephio-project/porch. All the porch issues are tracked against the nephio repository for now. |
Fixes kptdev/porch#905
Summary
This PR implements kpt function conditional rendering via CEL expressions to ensure server-side rendering in Porch stays consistent with local
kpt fn render.Changes
GetFunctionCondition(kptfile.go): corrected variable name in validators loop, method names, and type namescel.gowith proper YAML unmarshalingcel_test.go)GetFunctionConditioninkptfile_test.gocondition: "false"on ipam-fn demonstrating function skippingTesting
go test ./cel/... ./kptfile/...go test -run TestPipelinesWithConditionsVerification
Functions with a
conditionfield in the Kptfile pipeline are now properly evaluated and skipped when the CEL expression evaluates to false, matching the behavior of localkpt fn render.