Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder interface {
WithGVK(apiVersion, kind string) RequirementBuilder
WithRO(object runtime.Object) ROBuilder
}
type Requirement ¶
type Requirement interface {
Get() (name string, selector *fnv1.ResourceSelector, err error)
}
type RequirementBuilder ¶
type RequirementBuilder interface {
WithNamespace(namespace *string) RequirementBuilder
MatchName(resourceName string) Requirement
MatchLabels(labels map[string]string) Requirement
}
type Requirements ¶
type Requirements struct {
// contains filtered or unexported fields
}
func Requires ¶
func Requires(requirements ...Requirement) (*Requirements, error)
Requires returns a new Requirements instance that requires the given extra resources.
func (*Requirements) Assure ¶
func (r *Requirements) Assure(req *fnv1.RunFunctionRequest) (provided bool, err error)
Assure checks if the requirements are met in the given request. If not, it returns false. Per the function protocol, Crossplane sets the map key to an empty Resources message when it tried to fetch a resource that does not exist. So:
- key missing → not requested yet → wait for the next iteration
- key present, wrong item count → real error
- all keys present and valid → continue
Errors still return provided=true so that existing callers following the README pattern (checking !provided before err != nil) keep surfacing errors instead of silently waiting.
func (*Requirements) Register ¶
func (r *Requirements) Register(rsp *fnv1.RunFunctionResponse)
Register registers the requirements in the given response, merging with any existing requirements rather than overwriting them.