MCPcopy
hub / github.com/FairwindsOps/polaris / CheckObject

Method CheckObject

pkg/config/schema.go:313–320  ·  view source on GitHub ↗

CheckObject checks arbitrary data against the schema

(ctx context.Context, obj any)

Source from the content-addressed store, hash-verified

311
312// CheckObject checks arbitrary data against the schema
313func (check SchemaCheck) CheckObject(ctx context.Context, obj any) (bool, []jsonschema.KeyError, error) {
314 bytes, err := json.Marshal(obj)
315 if err != nil {
316 return false, nil, err
317 }
318 errs, err := check.Validator.ValidateBytes(ctx, bytes)
319 return len(errs) == 0, errs, err
320}
321
322// CheckAdditionalObjects looks for an object that passes the specified additional schema
323func (check SchemaCheck) CheckAdditionalObjects(ctx context.Context, groupkind string, objects []any) (bool, error) {

Callers 5

CheckPodSpecMethod · 0.95
CheckPodTemplateMethod · 0.95
CheckContainerMethod · 0.95
applySchemaCheckFunction · 0.80

Calls

no outgoing calls

Tested by 1