package model
import "k8s.io/apiextensions-apiserver/pkg/apiserver/schema/cel/model"
Index ¶
- func SchemaDeclType(s *schema.Structural, isResourceRoot bool) *apiservercel.DeclType
- func WithTypeAndObjectMeta(s *schema.Structural) *schema.Structural
- type Structural
- func (s *Structural) AdditionalProperties() common.SchemaOrBool
- func (s *Structural) AllOf() []common.Schema
- func (s *Structural) AnyOf() []common.Schema
- func (s *Structural) Default() any
- func (s *Structural) Enum() []any
- func (s *Structural) Format() string
- func (s *Structural) IsExclusiveMaximum() bool
- func (s *Structural) IsExclusiveMinimum() bool
- func (s *Structural) IsXEmbeddedResource() bool
- func (s *Structural) IsXIntOrString() bool
- func (s *Structural) IsXPreserveUnknownFields() bool
- func (s *Structural) Items() common.Schema
- func (s *Structural) MaxItems() *int64
- func (s *Structural) MaxLength() *int64
- func (s *Structural) MaxProperties() *int64
- func (s *Structural) Maximum() *float64
- func (s *Structural) MinItems() *int64
- func (s *Structural) MinLength() *int64
- func (s *Structural) MinProperties() *int64
- func (s *Structural) Minimum() *float64
- func (s *Structural) MultipleOf() *float64
- func (s *Structural) Not() common.Schema
- func (s *Structural) Nullable() bool
- func (s *Structural) OneOf() []common.Schema
- func (s *Structural) Pattern() string
- func (s *Structural) Properties() map[string]common.Schema
- func (s *Structural) Required() []string
- func (s *Structural) Type() string
- func (s *Structural) UniqueItems() bool
- func (s *Structural) WithTypeAndObjectMeta() common.Schema
- func (s *Structural) XListMapKeys() []string
- func (s *Structural) XListType() string
- func (s *Structural) XMapType() string
- func (s *Structural) XValidations() []common.ValidationRule
- type StructuralOrBool
- type StructuralValidationRule
Functions ¶
func SchemaDeclType ¶
func SchemaDeclType(s *schema.Structural, isResourceRoot bool) *apiservercel.DeclType
SchemaDeclType converts the structural schema to a CEL declaration, or returns nil if the structural schema should not be exposed in CEL expressions. Set isResourceRoot to true for the root of a custom resource or embedded resource.
Schemas with XPreserveUnknownFields not exposed unless they are objects. Array and "maps" schemas are not exposed if their items or additionalProperties schemas are not exposed. Object Properties are not exposed if their schema is not exposed.
The CEL declaration for objects with XPreserveUnknownFields does not expose unknown fields.
func WithTypeAndObjectMeta ¶
func WithTypeAndObjectMeta(s *schema.Structural) *schema.Structural
WithTypeAndObjectMeta ensures the kind, apiVersion and metadata.name and metadata.generateName properties are specified, making a shallow copy of the provided schema if needed.
Types ¶
type Structural ¶
type Structural struct { Structural *schema.Structural }
func (*Structural) AdditionalProperties ¶
func (s *Structural) AdditionalProperties() common.SchemaOrBool
func (*Structural) AllOf ¶
func (s *Structural) AllOf() []common.Schema
func (*Structural) AnyOf ¶
func (s *Structural) AnyOf() []common.Schema
func (*Structural) Default ¶
func (s *Structural) Default() any
func (*Structural) Enum ¶
func (s *Structural) Enum() []any
func (*Structural) Format ¶
func (s *Structural) Format() string
func (*Structural) IsExclusiveMaximum ¶
func (s *Structural) IsExclusiveMaximum() bool
func (*Structural) IsExclusiveMinimum ¶
func (s *Structural) IsExclusiveMinimum() bool
func (*Structural) IsXEmbeddedResource ¶
func (s *Structural) IsXEmbeddedResource() bool
func (*Structural) IsXIntOrString ¶
func (s *Structural) IsXIntOrString() bool
func (*Structural) IsXPreserveUnknownFields ¶
func (s *Structural) IsXPreserveUnknownFields() bool
func (*Structural) Items ¶
func (s *Structural) Items() common.Schema
func (*Structural) MaxItems ¶
func (s *Structural) MaxItems() *int64
func (*Structural) MaxLength ¶
func (s *Structural) MaxLength() *int64
func (*Structural) MaxProperties ¶
func (s *Structural) MaxProperties() *int64
func (*Structural) Maximum ¶
func (s *Structural) Maximum() *float64
func (*Structural) MinItems ¶
func (s *Structural) MinItems() *int64
func (*Structural) MinLength ¶
func (s *Structural) MinLength() *int64
func (*Structural) MinProperties ¶
func (s *Structural) MinProperties() *int64
func (*Structural) Minimum ¶
func (s *Structural) Minimum() *float64
func (*Structural) MultipleOf ¶
func (s *Structural) MultipleOf() *float64
func (*Structural) Not ¶
func (s *Structural) Not() common.Schema
func (*Structural) Nullable ¶
func (s *Structural) Nullable() bool
func (*Structural) OneOf ¶
func (s *Structural) OneOf() []common.Schema
func (*Structural) Pattern ¶
func (s *Structural) Pattern() string
func (*Structural) Properties ¶
func (s *Structural) Properties() map[string]common.Schema
func (*Structural) Required ¶
func (s *Structural) Required() []string
func (*Structural) Type ¶
func (s *Structural) Type() string
func (*Structural) UniqueItems ¶
func (s *Structural) UniqueItems() bool
func (*Structural) WithTypeAndObjectMeta ¶
func (s *Structural) WithTypeAndObjectMeta() common.Schema
func (*Structural) XListMapKeys ¶
func (s *Structural) XListMapKeys() []string
func (*Structural) XListType ¶
func (s *Structural) XListType() string
func (*Structural) XMapType ¶
func (s *Structural) XMapType() string
func (*Structural) XValidations ¶
func (s *Structural) XValidations() []common.ValidationRule
type StructuralOrBool ¶
type StructuralOrBool struct { StructuralOrBool *schema.StructuralOrBool }
func (*StructuralOrBool) Allows ¶
func (sb *StructuralOrBool) Allows() bool
func (*StructuralOrBool) Schema ¶
func (sb *StructuralOrBool) Schema() common.Schema
type StructuralValidationRule ¶
type StructuralValidationRule struct {
// contains filtered or unexported fields
}
func (*StructuralValidationRule) FieldPath ¶
func (s *StructuralValidationRule) FieldPath() string
func (*StructuralValidationRule) Message ¶
func (s *StructuralValidationRule) Message() string
func (*StructuralValidationRule) MessageExpression ¶
func (s *StructuralValidationRule) MessageExpression() string
func (*StructuralValidationRule) Rule ¶
func (s *StructuralValidationRule) Rule() string
Source Files ¶
adaptor.go schemas.go
- Version
- v0.33.0 (latest)
- Published
- Apr 23, 2025
- Platform
- linux/amd64
- Imports
- 3 packages
- Last checked
- 1 hour ago –
Tools for package owners.