v1beta1

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: Apache-2.0 Imports: 3 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package v1beta1 contains the input type for this Function +kubebuilder:object:generate=true +groupName=extra-resources.fn.crossplane.io +versionName=v1beta1

Index

Constants

View Source
const (
	// FunctionContextKeyExtraResources is the default context key.
	FunctionContextKeyExtraResources = "apiextensions.crossplane.io/extra-resources"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Context added in v0.4.0

type Context struct {
	// Key specifies the context key in which to put resolved extra resources.
	// E.g. 'apiextensions.crossplane.io/environment', the environment used in
	// standard functions such as Function Patch and Transform.
	// +kubebuilder:default=apiextensions.crossplane.io/extra-resources
	Key *string `json:"key,omitempty"`
}

A Context specifies how the function uses the response context.

func (*Context) DeepCopy added in v0.4.0

func (in *Context) DeepCopy() *Context

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Context.

func (*Context) DeepCopyInto added in v0.4.0

func (in *Context) DeepCopyInto(out *Context)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Context) GetKey added in v0.4.0

func (i *Context) GetKey() string

GetKey returns the key of the context, defaulting to FunctionContextKeyExtraResources if not specified.

type FromFieldPathPolicy

type FromFieldPathPolicy string

A FromFieldPathPolicy determines how to patch from a field path.

const (
	FromFieldPathPolicyOptional FromFieldPathPolicy = "Optional"
	FromFieldPathPolicyRequired FromFieldPathPolicy = "Required"
)

FromFieldPath patch policies.

type Input

type Input struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// Spec is the input to this function.
	Spec InputSpec `json:"spec"`
}

Input can be used to provide input to this Function. +kubebuilder:object:root=true +kubebuilder:storageversion +kubebuilder:resource:categories=crossplane

func (*Input) DeepCopy

func (in *Input) DeepCopy() *Input

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Input.

func (*Input) DeepCopyInto

func (in *Input) DeepCopyInto(out *Input)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Input) DeepCopyObject

func (in *Input) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type InputSpec

type InputSpec struct {
	// Context specifies how the function uses the response context.
	Context *Context `json:"context,omitempty"`

	// ExtraResources selects a list of `ExtraResource`s. The resolved
	// resources are stored in the composite resource at
	// `spec.extraResourceRefs` and is only updated if it is null.
	ExtraResources []ResourceSource `json:"extraResources"`

	// Policy represents the Resolution policies which apply to all
	// ResourceSourceReferences in ExtraResources list.
	// +optional
	Policy *Policy `json:"policy,omitempty"`
}

An InputSpec specifies extra resource(s) for rendering composed resources.

func (*InputSpec) DeepCopy

func (in *InputSpec) DeepCopy() *InputSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InputSpec.

func (*InputSpec) DeepCopyInto

func (in *InputSpec) DeepCopyInto(out *InputSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Policy

type Policy struct {
	// Resolution specifies whether resolution of this reference is required.
	// The default is 'Required', which means the reconcile will fail if the
	// reference cannot be resolved. 'Optional' means this reference will be
	// a no-op if it cannot be resolved.
	// +optional
	// +kubebuilder:default=Required
	// +kubebuilder:validation:Enum=Required;Optional
	Resolution *xpv1.ResolutionPolicy `json:"resolution,omitempty"`
}

Policy represents the Resolution policy of Reference instance.

func (*Policy) DeepCopy

func (in *Policy) DeepCopy() *Policy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Policy.

func (*Policy) DeepCopyInto

func (in *Policy) DeepCopyInto(out *Policy)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Policy) IsResolutionPolicyOptional

func (p *Policy) IsResolutionPolicyOptional() bool

IsResolutionPolicyOptional checks whether the resolution policy of relevant reference is Optional.

type ResourceSource

type ResourceSource struct {
	// Type specifies the way the ExtraResource is selected.
	// Default is `Reference`
	// +optional
	// +kubebuilder:validation:Enum=Reference;Selector
	// +kubebuilder:default=Reference
	Type ResourceSourceType `json:"type,omitempty"`

	// Ref is a named reference to a single ExtraResource.
	// Either Ref or Selector is required.
	// +optional
	Ref *ResourceSourceReference `json:"ref,omitempty"`

	// Selector selects ExtraResource(s) via labels.
	// +optional
	Selector *ResourceSourceSelector `json:"selector,omitempty"`

	// Kind is the kubernetes kind of the target extra resource(s).
	Kind string `json:"kind,omitempty"`

	// APIVersion is the kubernetes API Version of the target extra resource(s).
	APIVersion string `json:"apiVersion,omitempty"`

	// Namespace is the namespace in which to look for the ExtraResource.
	// If not set, the resource is assumed to be cluster-scoped.
	//
	// Only applies to namespaced kinds: setting it on a cluster-scoped kind
	// selects nothing. Crossplane v1 does not honor it server-side, so Selector
	// matches are filtered by the function and namespaced References cannot be
	// resolved at all.
	// +optional
	Namespace *string `json:"namespace,omitempty"`

	// Into is the key into which extra resources for this selector will be placed.
	Into string `json:"into"`
}

ResourceSource selects a ExtraResource.

func (*ResourceSource) DeepCopy

func (in *ResourceSource) DeepCopy() *ResourceSource

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceSource.

func (*ResourceSource) DeepCopyInto

func (in *ResourceSource) DeepCopyInto(out *ResourceSource)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ResourceSource) GetType

func (e *ResourceSource) GetType() ResourceSourceType

GetType returns the type of the resource source, returning the default if not set.

type ResourceSourceReference

type ResourceSourceReference struct {
	// The name of the object.
	Name string `json:"name"`
}

An ResourceSourceReference references an ExtraResource by it's name.

func (*ResourceSourceReference) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceSourceReference.

func (*ResourceSourceReference) DeepCopyInto

func (in *ResourceSourceReference) DeepCopyInto(out *ResourceSourceReference)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ResourceSourceSelector

type ResourceSourceSelector struct {
	// MaxMatch specifies the number of extracted ExtraResources in Multiple mode, extracts all if nil.
	MaxMatch *uint64 `json:"maxMatch,omitempty"`

	// MinMatch specifies the required minimum of extracted ExtraResources in Multiple mode.
	MinMatch *uint64 `json:"minMatch,omitempty"`

	// SortByFieldPath is the path to the field based on which list of ExtraResources is alphabetically sorted.
	// +kubebuilder:default="metadata.name"
	SortByFieldPath string `json:"sortByFieldPath,omitempty"`

	// MatchLabels ensures an object with matching labels is selected.
	MatchLabels []ResourceSourceSelectorLabelMatcher `json:"matchLabels,omitempty"`
}

An ResourceSourceSelector selects an ExtraResource via labels.

func (*ResourceSourceSelector) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceSourceSelector.

func (*ResourceSourceSelector) DeepCopyInto

func (in *ResourceSourceSelector) DeepCopyInto(out *ResourceSourceSelector)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ResourceSourceSelector) GetSortByFieldPath

func (e *ResourceSourceSelector) GetSortByFieldPath() string

GetSortByFieldPath returns the sort by path if set or a sane default.

type ResourceSourceSelectorLabelMatcher

type ResourceSourceSelectorLabelMatcher struct {
	// Type specifies where the value for a label comes from.
	// +optional
	// +kubebuilder:validation:Enum=FromCompositeFieldPath;Value
	// +kubebuilder:default=FromCompositeFieldPath
	Type ResourceSourceSelectorLabelMatcherType `json:"type,omitempty"`

	// Key of the label to match.
	Key string `json:"key"`

	// ValueFromFieldPath specifies the field path to look for the label value.
	ValueFromFieldPath *string `json:"valueFromFieldPath,omitempty"`

	// FromFieldPathPolicy specifies the policy for the valueFromFieldPath.
	// The default is Required, meaning that an error will be returned if the
	// field is not found in the composite resource.
	// Optional means that if the field is not found in the composite resource,
	// that label pair will just be skipped. N.B. other specified label
	// matchers will still be used to retrieve the desired
	// resource config, if any.
	// +kubebuilder:validation:Enum=Optional;Required
	// +kubebuilder:default=Required
	FromFieldPathPolicy *FromFieldPathPolicy `json:"fromFieldPathPolicy,omitempty"`

	// Value specifies a literal label value.
	Value *string `json:"value,omitempty"`
}

An ResourceSourceSelectorLabelMatcher acts like a k8s label selector but can draw the label value from a different path.

func (*ResourceSourceSelectorLabelMatcher) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceSourceSelectorLabelMatcher.

func (*ResourceSourceSelectorLabelMatcher) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ResourceSourceSelectorLabelMatcher) FromFieldPathIsOptional

func (e *ResourceSourceSelectorLabelMatcher) FromFieldPathIsOptional() bool

FromFieldPathIsOptional returns true if the FromFieldPathPolicy is set to Optional.

func (*ResourceSourceSelectorLabelMatcher) GetType

GetType returns the type of the label matcher, returning the default if not set.

type ResourceSourceSelectorLabelMatcherType

type ResourceSourceSelectorLabelMatcherType string

ResourceSourceSelectorLabelMatcherType specifies where the value for a label comes from.

const (
	// ResourceSourceSelectorLabelMatcherTypeFromCompositeFieldPath extracts
	// the label value from a composite fieldpath.
	ResourceSourceSelectorLabelMatcherTypeFromCompositeFieldPath ResourceSourceSelectorLabelMatcherType = "FromCompositeFieldPath"
	// ResourceSourceSelectorLabelMatcherTypeValue uses a literal as label
	// value.
	ResourceSourceSelectorLabelMatcherTypeValue ResourceSourceSelectorLabelMatcherType = "Value"
)

type ResourceSourceType

type ResourceSourceType string

ResourceSourceType specifies the way the ExtraResource is selected.

const (
	// ResourceSourceTypeReference by name.
	ResourceSourceTypeReference ResourceSourceType = "Reference"
	// ResourceSourceTypeSelector by labels.
	ResourceSourceTypeSelector ResourceSourceType = "Selector"
)

Jump to

Keyboard shortcuts

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