mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 10:51:29 +00:00
apiextensions: SchemaHas predicate must be read-only/non-captured
This commit is contained in:
parent
7dea3409d4
commit
06aff8a546
@ -1381,6 +1381,11 @@ func schemaHasRecurse(s *apiextensions.JSONSchemaProps, pred func(s *apiextensio
|
||||
return SchemaHas(schema, pred)
|
||||
}
|
||||
|
||||
// SchemaHas recursively traverses the Schema and calls the `pred`
|
||||
// predicate to see if the schema contains specific values.
|
||||
//
|
||||
// The predicate MUST NOT keep a copy of the json schema NOR modify the
|
||||
// schema.
|
||||
func SchemaHas(s *apiextensions.JSONSchemaProps, pred func(s *apiextensions.JSONSchemaProps) bool) bool {
|
||||
if s == nil {
|
||||
return false
|
||||
|
Loading…
Reference in New Issue
Block a user