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) Default() any
- func (s *Structural) Enum() []any
- func (s *Structural) Format() string
- 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) Nullable() bool
- func (s *Structural) Properties() map[string]common.Schema
- func (s *Structural) Required() []string
- func (s *Structural) Type() string
- func (s *Structural) WithTypeAndObjectMeta() common.Schema
- func (s *Structural) XListMapKeys() []string
- func (s *Structural) XListType() string
- type StructuralOrBool
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) Default ¶
func (s *Structural) Default() any
func (*Structural) Enum ¶
func (s *Structural) Enum() []any
func (*Structural) Format ¶
func (s *Structural) Format() string
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) Nullable ¶
func (s *Structural) Nullable() bool
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) WithTypeAndObjectMeta ¶
func (s *Structural) WithTypeAndObjectMeta() common.Schema
func (*Structural) XListMapKeys ¶
func (s *Structural) XListMapKeys() []string
func (*Structural) XListType ¶
func (s *Structural) XListType() string
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
Source Files ¶
adaptor.go schemas.go
- Version
- v0.27.9
- Published
- Dec 20, 2023
- Platform
- js/wasm
- Imports
- 3 packages
- Last checked
- 3 minutes ago –
Tools for package owners.