Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cue: fix holos cue vet exit code (#358)
Without this patch `holos cue vet` always returns exit code 0, even when there are errors. This patch fixes the problem by catching the error and returning it to our own top level error handler. Note the final error, "could not run: terminating because of errors" which wraps the generic error reported by cue in the presence of multiple errors. Result: ``` ❯ holos cue vet ./policy --path 'strings.ToLower(kind)' /tmp/podinfo.gen.yaml deployment.kind: conflicting values "Forbidden" and "Deployment": ./policy/validations.cue:18:8 ../../../../../tmp/podinfo.gen.yaml:25:7 deployment.spec.template.spec.containers.0.resources.limits: conflicting values null and {[string]:"k8s.io/apimachinery/pkg/api/resource".#Quantity} (mismatched types null and struct): ./cue.mod/gen/k8s.io/api/apps/v1/types_go_gen.cue:355:9 ./cue.mod/gen/k8s.io/api/apps/v1/types_go_gen.cue:376:12 ./cue.mod/gen/k8s.io/api/core/v1/types_go_gen.cue:2840:11 ./cue.mod/gen/k8s.io/api/core/v1/types_go_gen.cue:2968:14 ./cue.mod/gen/k8s.io/api/core/v1/types_go_gen.cue:3882:15 ./cue.mod/gen/k8s.io/api/core/v1/types_go_gen.cue:3882:18 ./cue.mod/gen/k8s.io/api/core/v1/types_go_gen.cue:5027:9 ./cue.mod/gen/k8s.io/api/core/v1/types_go_gen.cue:6407:16 ./policy/validations.cue:17:13 ../../../../../tmp/podinfo.gen.yaml:104:19 could not run: terminating because of errors ```
- Loading branch information