resolver

package
v0.0.0-...-ca727f0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 12, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CELResolver

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

CELResolver represents a resolver for CEL expressions.

func NewCELResolver

func NewCELResolver(logger klog.Logger) *CELResolver

NewCELResolver returns a new CEL resolver.

func (*CELResolver) Resolve

func (cr *CELResolver) Resolve(query string, unstructuredObjectMap map[string]interface{}) map[string]string

Resolve resolves the given query against the given unstructured object.

type Resolver

type Resolver interface {

	// Resolve resolves the given expression.
	// NOTE: The returned map should have a single key:value (query:resolved[LabelValues,Value], of unit length) pair if
	// the expression is resolved to a non-composite value.
	Resolve(query string, unstructuredObjectMap map[string]interface{}) map[string]string
}

Resolver defines behaviors for resolving a given expression.

type UnstructuredResolver

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

UnstructuredResolver represents a resolver for unstructured objects.

func NewUnstructuredResolver

func NewUnstructuredResolver(logger klog.Logger) *UnstructuredResolver

NewUnstructuredResolver returns a new unstructured resolver.

func (*UnstructuredResolver) Resolve

func (ur *UnstructuredResolver) Resolve(query string, unstructuredObjectMap map[string]interface{}) map[string]string

Resolve resolves the given query against the given unstructured object. NOTE: Resolutions resulting in composite values for label keys and values are not supported, owing to upstream limitations: https://github.com/kubernetes/apimachinery/blob/v0.31.0/pkg/apis/meta/v1/unstructured/helpers_test.go#L121.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL