Documentation
¶
Overview ¶
Package reference contains utilities for working with cross-resource references.
Package reference contains utilities for working with cross-resource references.
Index ¶
- func ControllersMustMatch(s *xpv1.Selector) bool
- func ControllersMustMatchNamespaced(s *xpv1.NamespacedSelector) bool
- func FromFloatPtrValue(v *float64) string
- func FromFloatPtrValues(v []*float64) []string
- func FromIntPtrValue(v *int64) string
- func FromIntPtrValues(v []*int64) []string
- func FromPtrValue(v *string) string
- func FromPtrValues(v []*string) []string
- func ToFloatPtrValue(v string) *float64
- func ToFloatPtrValues(v []string) []*float64
- func ToIntPtrValue(v string) *int64
- func ToIntPtrValues(v []string) []*int64
- func ToPtrValue(v string) *string
- func ToPtrValues(v []string) []*string
- type APINamespacedResolver
- type APIResolver
- type ExtractValueFn
- type MultiNamespacedResolutionRequest
- type MultiNamespacedResolutionResponse
- type MultiResolutionRequest
- type MultiResolutionResponse
- type NamespacedResolutionRequest
- type NamespacedResolutionResponse
- type ResolutionRequest
- type ResolutionResponse
- type To
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ControllersMustMatch ¶
ControllersMustMatch returns true if the supplied Selector requires that a reference be to a managed resource whose controller reference matches the referencing resource.
func ControllersMustMatchNamespaced ¶
func ControllersMustMatchNamespaced(s *xpv1.NamespacedSelector) bool
ControllersMustMatchNamespaced returns true if the supplied Selector requires that a reference be to a managed resource whose controller reference matches the referencing resource.
func FromFloatPtrValue ¶
FromFloatPtrValue adapts a float pointer field for use as a CurrentValue.
func FromFloatPtrValues ¶
FromFloatPtrValues adapts a slice of float64 pointer fields for use as CurrentValues.
func FromIntPtrValue ¶
FromIntPtrValue adapts an int pointer field for use as a CurrentValue.
func FromIntPtrValues ¶
FromIntPtrValues adapts a slice of int64 pointer fields for use as CurrentValues.
func FromPtrValue ¶
FromPtrValue adapts a string pointer field for use as a CurrentValue.
func FromPtrValues ¶
FromPtrValues adapts a slice of string pointer fields for use as CurrentValues. NOTE: Do not use this utility function unless you have to. Using pointer slices does not adhere to our current API practices. The current use case is where generated code creates reference-able fields in a provider which are string pointers and need to be resolved as part of `ResolveMultiple`.
func ToFloatPtrValue ¶
ToFloatPtrValue adapts a ResolvedValue for use as a float64 pointer field.
func ToFloatPtrValues ¶
ToFloatPtrValues adapts ResolvedValues for use as a slice of float64 pointer fields.
func ToIntPtrValue ¶
ToIntPtrValue adapts a ResolvedValue for use as an int pointer field.
func ToIntPtrValues ¶
ToIntPtrValues adapts ResolvedValues for use as a slice of int64 pointer fields.
func ToPtrValue ¶
ToPtrValue adapts a ResolvedValue for use as a string pointer field.
func ToPtrValues ¶
ToPtrValues adapts ResolvedValues for use as a slice of string pointer fields. NOTE: Do not use this utility function unless you have to. Using pointer slices does not adhere to our current API practices. The current use case is where generated code creates reference-able fields in a provider which are string pointers and need to be resolved as part of `ResolveMultiple`.
Types ¶
type APINamespacedResolver ¶
type APINamespacedResolver struct {
// contains filtered or unexported fields
}
An APINamespacedResolver selects and resolves references to managed resources in the Kubernetes API server.
func NewAPINamespacedResolver ¶
func NewAPINamespacedResolver(c client.Reader, from resource.Managed) *APINamespacedResolver
NewAPINamespacedResolver returns a Resolver that selects and resolves references from the supplied managed resource to other managed resources in the Kubernetes API server.
func (*APINamespacedResolver) Resolve ¶
func (r *APINamespacedResolver) Resolve(ctx context.Context, req NamespacedResolutionRequest) (NamespacedResolutionResponse, error)
Resolve the supplied NamespacedResolutionRequest. The returned NamespacedResolutionResponse always contains valid values unless an error was returned.
func (*APINamespacedResolver) ResolveMultiple ¶
func (r *APINamespacedResolver) ResolveMultiple(ctx context.Context, req MultiNamespacedResolutionRequest) (MultiNamespacedResolutionResponse, error)
ResolveMultiple resolves the supplied MultiNamespacedResolutionRequest. The returned MultiNamespacedResolutionResponse always contains valid values unless an error was returned.
type APIResolver ¶
type APIResolver struct {
// contains filtered or unexported fields
}
An APIResolver selects and resolves references to managed resources in the Kubernetes API server.
func NewAPIResolver ¶
func NewAPIResolver(c client.Reader, from resource.Managed) *APIResolver
NewAPIResolver returns a Resolver that selects and resolves references from the supplied managed resource to other managed resources in the Kubernetes API server.
func (*APIResolver) Resolve ¶
func (r *APIResolver) Resolve(ctx context.Context, req ResolutionRequest) (ResolutionResponse, error)
Resolve the supplied ResolutionRequest. The returned ResolutionResponse always contains valid values unless an error was returned.
func (*APIResolver) ResolveMultiple ¶
func (r *APIResolver) ResolveMultiple(ctx context.Context, req MultiResolutionRequest) (MultiResolutionResponse, error)
ResolveMultiple resolves the supplied MultiResolutionRequest. The returned MultiResolutionResponse always contains valid values unless an error was returned.
type ExtractValueFn ¶
An ExtractValueFn specifies how to extract a value from the resolved managed resource.
func ExternalName ¶
func ExternalName() ExtractValueFn
ExternalName extracts the resolved managed resource's external name from its external name annotation.
type MultiNamespacedResolutionRequest ¶
type MultiNamespacedResolutionRequest struct {
CurrentValues []string
References []xpv1.NamespacedReference
Selector *xpv1.NamespacedSelector
To To
Extract ExtractValueFn
Namespace string
}
A MultiNamespacedResolutionRequest requests that several references to a particular kind of managed resource be resolved.
func (*MultiNamespacedResolutionRequest) IsNoOp ¶
func (rr *MultiNamespacedResolutionRequest) IsNoOp() bool
IsNoOp returns true if the supplied MultiNamespacedResolutionRequest cannot or should not be processed.
type MultiNamespacedResolutionResponse ¶
type MultiNamespacedResolutionResponse struct {
ResolvedValues []string
ResolvedReferences []xpv1.NamespacedReference
}
A MultiNamespacedResolutionResponse returns the result of several reference resolutions. The returned values are always safe to set if resolution was successful.
func (MultiNamespacedResolutionResponse) Validate ¶
func (rr MultiNamespacedResolutionResponse) Validate() error
Validate this MultiNamespacedResolutionResponse.
type MultiResolutionRequest ¶
type MultiResolutionRequest struct {
CurrentValues []string
References []xpv1.Reference
Selector *xpv1.Selector
To To
Extract ExtractValueFn
Namespace string
}
A MultiResolutionRequest requests that several references to a particular kind of managed resource be resolved.
func (*MultiResolutionRequest) IsNoOp ¶
func (rr *MultiResolutionRequest) IsNoOp() bool
IsNoOp returns true if the supplied MultiResolutionRequest cannot or should not be processed.
type MultiResolutionResponse ¶
A MultiResolutionResponse returns the result of several reference resolutions. The returned values are always safe to set if resolution was successful.
func (MultiResolutionResponse) Validate ¶
func (rr MultiResolutionResponse) Validate() error
Validate this MultiResolutionResponse.
type NamespacedResolutionRequest ¶
type NamespacedResolutionRequest struct {
CurrentValue string
Reference *xpv1.NamespacedReference
Selector *xpv1.NamespacedSelector
To To
Extract ExtractValueFn
Namespace string
}
A NamespacedResolutionRequest requests that a reference to a particular kind of managed resource be resolved.
func (*NamespacedResolutionRequest) IsNoOp ¶
func (rr *NamespacedResolutionRequest) IsNoOp() bool
IsNoOp returns true if the supplied NamespacedResolutionRequest cannot or should not be processed.
type NamespacedResolutionResponse ¶
type NamespacedResolutionResponse struct {
ResolvedValue string
ResolvedReference *xpv1.NamespacedReference
}
A NamespacedResolutionResponse returns the result of a reference resolution. The returned values are always safe to set if resolution was successful.
func (NamespacedResolutionResponse) Validate ¶
func (rr NamespacedResolutionResponse) Validate() error
Validate this NamespacedResolutionResponse.
type ResolutionRequest ¶
type ResolutionRequest struct {
CurrentValue string
Reference *xpv1.Reference
Selector *xpv1.Selector
To To
Extract ExtractValueFn
Namespace string
}
A ResolutionRequest requests that a reference to a particular kind of managed resource be resolved.
func (*ResolutionRequest) IsNoOp ¶
func (rr *ResolutionRequest) IsNoOp() bool
IsNoOp returns true if the supplied ResolutionRequest cannot or should not be processed.
type ResolutionResponse ¶
A ResolutionResponse returns the result of a reference resolution. The returned values are always safe to set if resolution was successful.
func (ResolutionResponse) Validate ¶
func (rr ResolutionResponse) Validate() error
Validate this ResolutionResponse.