apiserverk8s.io/apiserver/pkg/cel/mutation Index | Files | Directories

package mutation

import "k8s.io/apiserver/pkg/cel/mutation"

Index

Types

type TypeProvider

type TypeProvider struct {
	// contains filtered or unexported fields
}

TypeProvider is a specialized CEL type provider that understands the Object type alias that is used to construct an Apply configuration for a mutation operation.

func NewTypeProviderAndEnvOption

func NewTypeProviderAndEnvOption(resolver common.TypeResolver) (*TypeProvider, cel.EnvOption)

NewTypeProviderAndEnvOption creates the TypeProvider with a given TypeResolver, and also returns the CEL EnvOption to apply it to the env.

func (*TypeProvider) EnumValue

func (p *TypeProvider) EnumValue(enumName string) ref.Val

EnumValue returns the numeric value of the given enum value name. This TypeProvider does not have special handling for EnumValue and thus directly delegate to its underlying type provider.

func (*TypeProvider) FindIdent

func (p *TypeProvider) FindIdent(identName string) (ref.Val, bool)

FindIdent takes a qualified identifier name and returns a ref.ObjectVal if one exists. This TypeProvider does not have special handling for FindIdent and thus directly delegate to its underlying type provider.

func (*TypeProvider) FindStructFieldType

func (p *TypeProvider) FindStructFieldType(structType, fieldName string) (*types.FieldType, bool)

FindStructFieldType returns the field type for a checked type value. Returns false if the field could not be found.

func (*TypeProvider) FindStructType

func (p *TypeProvider) FindStructType(structType string) (*types.Type, bool)

FindStructType returns the Type give a qualified type name, by looking it up with the TypeResolver and translating it to CEL Type. If the type is not known to the TypeResolver, the lookup falls back to the underlying TypeProvider instead.

func (*TypeProvider) NewValue

func (p *TypeProvider) NewValue(structType string, fields map[string]ref.Val) ref.Val

NewValue creates a new type value from a qualified name and map of fields.

Source Files

typeprovider.go

Directories

PathSynopsis
pkg/cel/mutation/common
pkg/cel/mutation/unstructured
Version
v0.30.5
Published
Sep 12, 2024
Platform
js/wasm
Imports
4 packages
Last checked
11 seconds ago

Tools for package owners.