Help us shape the future of Go! Take the 2026 Go Developer Survey

v1beta1

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EnvironmentSource

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

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

	// Selector selects EnvironmentConfig(s) via labels.
	// +optional
	Selector *EnvironmentSourceSelector `json:"selector,omitempty"`
}

EnvironmentSource selects a EnvironmentConfig resource.

func (*EnvironmentSource) DeepCopy

func (in *EnvironmentSource) DeepCopy() *EnvironmentSource

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

func (*EnvironmentSource) DeepCopyInto

func (in *EnvironmentSource) DeepCopyInto(out *EnvironmentSource)

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

func (*EnvironmentSource) GetType

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

type EnvironmentSourceReference

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

An EnvironmentSourceReference references an EnvironmentConfig by it's name.

func (*EnvironmentSourceReference) DeepCopy

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

func (*EnvironmentSourceReference) DeepCopyInto

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

type EnvironmentSourceSelector

type EnvironmentSourceSelector struct {

	// Mode specifies retrieval strategy: "Single" or "Multiple".
	// +kubebuilder:validation:Enum=Single;Multiple
	// +kubebuilder:default=Single
	Mode EnvironmentSourceSelectorModeType `json:"mode,omitempty"`

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

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

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

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

An EnvironmentSourceSelector selects an EnvironmentConfig via labels.

func (*EnvironmentSourceSelector) DeepCopy

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

func (*EnvironmentSourceSelector) DeepCopyInto

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

func (*EnvironmentSourceSelector) GetMode

func (*EnvironmentSourceSelector) GetSortByFieldPath

func (e *EnvironmentSourceSelector) GetSortByFieldPath() string

type EnvironmentSourceSelectorLabelMatcher

type EnvironmentSourceSelectorLabelMatcher struct {
	// Type specifies where the value for a label comes from.
	// +optional
	// +kubebuilder:validation:Enum=FromCompositeFieldPath;Value
	// +kubebuilder:default=FromCompositeFieldPath
	Type EnvironmentSourceSelectorLabelMatcherType `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
	// environment 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 EnvironmentSourceSelectorLabelMatcher acts like a k8s label selector but can draw the label value from a different path.

func (*EnvironmentSourceSelectorLabelMatcher) DeepCopy

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

func (*EnvironmentSourceSelectorLabelMatcher) DeepCopyInto

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

func (*EnvironmentSourceSelectorLabelMatcher) FromFieldPathIsOptional

func (e *EnvironmentSourceSelectorLabelMatcher) FromFieldPathIsOptional() bool

FromFieldPathIsOptional returns true if the FromFieldPathPolicy is set to Optional.

func (*EnvironmentSourceSelectorLabelMatcher) GetType

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

type EnvironmentSourceSelectorLabelMatcherType

type EnvironmentSourceSelectorLabelMatcherType string

EnvironmentSourceSelectorLabelMatcherType specifies where the value for a label comes from.

const (
	// EnvironmentSourceSelectorLabelMatcherTypeFromCompositeFieldPath extracts
	// the label value from a composite fieldpath.
	EnvironmentSourceSelectorLabelMatcherTypeFromCompositeFieldPath EnvironmentSourceSelectorLabelMatcherType = "FromCompositeFieldPath"
	// EnvironmentSourceSelectorLabelMatcherTypeValue uses a literal as label
	// value.
	EnvironmentSourceSelectorLabelMatcherTypeValue EnvironmentSourceSelectorLabelMatcherType = "Value"
)

type EnvironmentSourceSelectorModeType

type EnvironmentSourceSelectorModeType string

EnvironmentSourceSelectorModeType specifies amount of retrieved EnvironmentConfigs with matching label.

const (
	// EnvironmentSourceSelectorSingleMode extracts only first EnvironmentConfig from the sorted list.
	EnvironmentSourceSelectorSingleMode EnvironmentSourceSelectorModeType = "Single"

	// EnvironmentSourceSelectorMultiMode extracts multiple EnvironmentConfigs from the sorted list.
	EnvironmentSourceSelectorMultiMode EnvironmentSourceSelectorModeType = "Multiple"
)

type EnvironmentSourceType

type EnvironmentSourceType string

EnvironmentSourceType specifies the way the EnvironmentConfig is selected.

const (
	// EnvironmentSourceTypeReference by name.
	EnvironmentSourceTypeReference EnvironmentSourceType = "Reference"
	// EnvironmentSourceTypeSelector by labels.
	EnvironmentSourceTypeSelector EnvironmentSourceType = "Selector"
)

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 InputSpec `json:"spec,omitempty"`
}

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 {
	// DefaultData statically defines the initial state of the environment.
	// It has the same schema-less structure as the data field in
	// environment configs.
	// It is overwritten by the selected environment configs.
	DefaultData map[string]extv1.JSON `json:"defaultData,omitempty"`

	// EnvironmentConfigs selects a list of `EnvironmentConfig`s. The resolved
	// resources are stored in the composite resource at
	// `spec.environmentConfigRefs` and is only updated if it is null.
	//
	// The list of references is used to compute an in-memory environment at
	// compose time. The data of all object is merged in the order they are
	// listed, meaning the values of EnvironmentConfigs with a larger index take
	// priority over ones with smaller indices.
	//
	// The computed environment can be accessed in a composition using
	// `FromEnvironmentFieldPath` and `CombineFromEnvironment` patches.
	// +optional
	EnvironmentConfigs []EnvironmentSource `json:"environmentConfigs,omitempty"`

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

An InputSpec specifies the environment 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 PatchPolicy

type PatchPolicy struct {
	// FromFieldPath specifies how to patch from a field path. The default is
	// 'Optional', which means the patch will be a no-op if the specified
	// fromFieldPath does not exist. Use 'Required' if the patch should fail if
	// the specified path does not exist.
	// +kubebuilder:validation:Enum=Optional;Required
	// +optional
	FromFieldPath *FromFieldPathPolicy `json:"fromFieldPath,omitempty"`
	MergeOptions  *xpv1.MergeOptions   `json:"mergeOptions,omitempty"`
}

A PatchPolicy configures the specifics of patching behaviour.

func (*PatchPolicy) DeepCopy

func (in *PatchPolicy) DeepCopy() *PatchPolicy

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

func (*PatchPolicy) DeepCopyInto

func (in *PatchPolicy) DeepCopyInto(out *PatchPolicy)

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

func (*PatchPolicy) GetFromFieldPathPolicy

func (pp *PatchPolicy) GetFromFieldPathPolicy() FromFieldPathPolicy

GetFromFieldPathPolicy returns the FromFieldPathPolicy for this PatchPolicy, defaulting to FromFieldPathPolicyOptional if not specified.

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 added in v0.0.6

func (p *Policy) IsResolutionPolicyOptional() bool

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

Jump to

Keyboard shortcuts

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