MCPcopy
hub / github.com/carvel-dev/ytt / Run

Function Run

pkg/validations/validate.go:63–75  ·  view source on GitHub ↗

Run takes a root Node, and threadName, and validates each Node in the tree. When a Node's value is invalid, the errors are collected and returned in a Check. Otherwise, returns empty Check and nil error.

(node yamlmeta.Node, threadName string)

Source from the content-addressed store, hash-verified

61// When a Node's value is invalid, the errors are collected and returned in a Check.
62// Otherwise, returns empty Check and nil error.
63func Run(node yamlmeta.Node, threadName string) (Check, error) {
64 if node == nil {
65 return Check{}, nil
66 }
67
68 validation := newValidationRun(threadName, node)
69 err := yamlmeta.WalkWithParent(node, nil, "", validation)
70 if err != nil {
71 return Check{}, err
72 }
73
74 return validation.chk, nil
75}
76
77type validationRun struct {
78 thread *starlark.Thread

Callers 2

validateValuesMethod · 0.92
EvalAndValidateTemplateFunction · 0.92

Calls 2

WalkWithParentFunction · 0.92
newValidationRunFunction · 0.85

Tested by 1

EvalAndValidateTemplateFunction · 0.74