Closed liamfallon closed 1 week ago
This bug has already been fixed, following the steps above (log below) shows that the correct error message is emitted.
% porchctl rpkg init looby --repository mgmt --workspace liam -n zooby
mgmt-cc83c405baad19f7dfe2dd64db8dec71fad56041 created
% porchctl rpkg pull mgmt-cc83c405baad19f7dfe2dd64db8dec71fad56041 -n zooby looby
% echo "Added the Starlark pipeline entry"
Added the Starlark pipeline entry
% kpt fn render looby
Package "looby":
[RUNNING] "gcr.io/kpt-fn/starlark:v0.4.3"
[FAIL] "gcr.io/kpt-fn/starlark:v0.4.3" in 200ms
Results:
[error]: fail: Validation always fails
Stderr:
"failed to evaluate function: error: function failure"
Exit code: 1
% porchctl rpkg push mgmt-cc83c405baad19f7dfe2dd64db8dec71fad56041 -n zooby looby
Package is updated, but failed to render the package.
Error: fn.render: pkg /:
pkg.render:
pipeline.run: error: function failure
[RUNNING] "gcr.io/kpt-fn/starlark:v0.4.3"
[FAIL] "gcr.io/kpt-fn/starlark:v0.4.3"
Results:
[error]: fail: Validation always fails
mgmt-cc83c405baad19f7dfe2dd64db8dec71fad56041 pushed
% porchctl rpkg delete -n zooby mgmt-cc83c405baad19f7dfe2dd64db8dec71fad56041
mgmt-cc83c405baad19f7dfe2dd64db8dec71fad56041 deleted
Already fixed in current version of Porch.
Original issue URL: https://github.com/kptdev/kpt/issues/3423 Original issue user: https://github.com/ChristopherFry Original issue created at: 2022-07-30T03:03:30Z Original issue last updated at: 2022-08-24T20:43:54Z Original issue body: Porch always returns a generic error when a Kptfile validator function fails on render.
Expected behavior
Porch should return the fail message of the validator.
Actual behavior
Porch returns the following error regardless of the fail message of the validator
Information
Both Porch and the CLI are on https://github.com/GoogleContainerTools/kpt/tree/208b4c422c85ff6da4cb4c2b9755f0a23a1329c6.
Steps to reproduce the behavior
Create a simple Kpt package using
kpt alpha rpkg init
Use
kpt alpha rpkg pull
to save package to local filesystemAdd a simple StarlarkRun validation resource to the package
Update Kptfile to reference StarlarkRun resource
Using
kpt fn render
the expected error message returnsUsing
kpt alpha rpkg push
to push the package to Porch the generic error message is returnedOriginal issue comments: Comment user: https://github.com/natasha41575 Comment created at: 2022-08-09T22:23:14Z Comment last updated at: 2022-08-09T22:23:35Z Comment body: https://github.com/GoogleContainerTools/kpt/pull/3451 will surface the validation error. Do you mind taking a quick look to see if the format of the returned error works for you?
Comment user: https://github.com/natasha41575 Comment created at: 2022-08-24T20:43:54Z Comment last updated at: 2022-08-24T20:43:54Z Comment body: Per offline discussion, @droot will be taking over this by surfacing the function results in the API.