var unbounded … type CELSchemaContext … // TypeInfo returns the CELTypeInfo for this CELSchemaContext node. Returns nil, nil if this CELSchemaContext is nil, // or if current level or above does not have x-kubernetes-validations rules. The returned type info is shared and // should not be modified by the caller. func (c *CELSchemaContext) TypeInfo() (*CELTypeInfo, error) { … } type CELTypeInfo … type converter … func defaultConverter(schema *apiextensions.JSONSchemaProps, isRoot bool) (*CELTypeInfo, error) { … } // RootCELContext constructs CELSchemaContext for the given root schema. func RootCELContext(schema *apiextensions.JSONSchemaProps) *CELSchemaContext { … } // ChildPropertyContext returns nil, nil if this CELSchemaContext is nil, otherwise constructs and returns a // CELSchemaContext for propertyName. func (c *CELSchemaContext) ChildPropertyContext(propSchema *apiextensions.JSONSchemaProps, propertyName string) *CELSchemaContext { … } // ChildAdditionalPropertiesContext returns nil, nil if this CELSchemaContext is nil, otherwise it constructs and returns // a CELSchemaContext for the properties of an object if this CELSchemaContext is an object. // schema must be non-nil and have a non-nil schema.AdditionalProperties. func (c *CELSchemaContext) ChildAdditionalPropertiesContext(propsSchema *apiextensions.JSONSchemaProps) *CELSchemaContext { … } // ChildItemsContext returns nil, nil if this CELSchemaContext is nil, otherwise it constructs and returns a CELSchemaContext // for the items of an array if this CELSchemaContext is an array. func (c *CELSchemaContext) ChildItemsContext(itemsSchema *apiextensions.JSONSchemaProps) *CELSchemaContext { … } // childContext returns nil, nil if this CELSchemaContext is nil, otherwise it constructs a new CELSchemaContext for the // given child schema of the current schema context. // accessor optionally provides a way to access CELTypeInfo of the child from the current schema context's CELTypeInfo. // childContext returns a CELSchemaContext where the MaxCardinality is multiplied by the // factor that the schema increases the cardinality of its children. If the CELSchemaContext's // MaxCardinality is unbounded (nil) or the factor that the schema increase the cardinality // is unbounded, the resulting CELSchemaContext's MaxCardinality is also unbounded. func (c *CELSchemaContext) childContext(child *apiextensions.JSONSchemaProps, accessor typeInfoAccessor) *CELSchemaContext { … } type typeInfoAccessor … type propertyTypeInfoAccessor … func (c propertyTypeInfoAccessor) accessTypeInfo(parentTypeInfo *CELTypeInfo) *CELTypeInfo { … } type itemsTypeInfoAccessor … func (c itemsTypeInfoAccessor) accessTypeInfo(parentTypeInfo *CELTypeInfo) *CELTypeInfo { … } type additionalItemsTypeInfoAccessor … func (c additionalItemsTypeInfoAccessor) accessTypeInfo(parentTypeInfo *CELTypeInfo) *CELTypeInfo { … } type TotalCost … // ObserveExpressionCost accumulates the cost of evaluating a -kubernetes-validations rule. func (c *TotalCost) ObserveExpressionCost(path *field.Path, cost uint64) { … } type RuleCost … // extractMaxElements returns the factor by which the schema increases the cardinality // (number of possible data elements) of its children. If schema is a map and has // MaxProperties or an array has MaxItems, the int pointer of the max value is returned. // If schema is a map or array and does not have MaxProperties or MaxItems, // unbounded (nil) is returned to indicate that there is no limit to the possible // number of data elements imposed by the current schema. If the schema is an object, 1 is // returned to indicate that there is no increase to the number of possible data elements // for its children. Primitives do not have children, but 1 is returned for simplicity. func extractMaxElements(schema *apiextensions.JSONSchemaProps) *uint64 { … } func zeroIfNegative(v int64) int64 { … } func uint64ptr(i uint64) *uint64 { … }