MCPcopy Create free account
hub / github.com/flant/shell-operator / GetSchema

Function GetSchema

pkg/kube/object_patch/validation.go:149–160  ·  view source on GitHub ↗

GetSchema returns loaded schema.

(name string)

Source from the content-addressed store, hash-verified

147
148// GetSchema returns loaded schema.
149func GetSchema(name string) *spec.Schema {
150 if s, ok := SchemasCache[name]; ok {
151 return s
152 }
153 if _, ok := Schemas[name]; !ok {
154 return nil
155 }
156
157 // ignore error because load is guaranteed by tests
158 SchemasCache[name], _ = LoadSchema(name)
159 return SchemasCache[name]
160}
161
162// LoadSchema returns spec.Schema object loaded from yaml in Schemas map.
163func LoadSchema(name string) (*spec.Schema, error) {

Callers 2

Test_GetSchemaFunction · 0.70
ParseOperationsFunction · 0.70

Calls 1

LoadSchemaFunction · 0.70

Tested by 1

Test_GetSchemaFunction · 0.56