Documentation
¶
Index ¶
- func CompareInt64Slices(a, b []int64) bool
- func CompareMapBool(a, b map[string]bool) bool
- func CompareMapInt64(a, b map[string]int64) bool
- func CompareMapString(a, b map[string]string) bool
- func CompareStringSlices(a, b []string) bool
- type CtyDecoder
- type CtyEncoder
- type Implementation
- type ImplementationMerger
- type Index
- type Indexer
- type Invoker
- func (a *Invoker) DecodeCty(r xpresource.Managed, v cty.Value, s *providers.Schema) (xpresource.Managed, error)
- func (a *Invoker) EncodeCty(r xpresource.Managed, s *providers.Schema) (cty.Value, error)
- func (a *Invoker) GVK() k8schema.GroupVersionKind
- func (a *Invoker) MarshalResourceYaml(r xpresource.Managed) ([]byte, error)
- func (a *Invoker) MergeResources(f xpresource.Managed, t xpresource.Managed) (MergeDescription, error)
- func (a *Invoker) SchemeBuilder() (*scheme.Builder, error)
- func (a *Invoker) TerraformResourceName() string
- func (a *Invoker) UnmarshalResourceYaml(b []byte) (xpresource.Managed, error)
- type MergeDescription
- type ProviderInit
- type ReconcilerConfigurer
- type ResourceMerger
- type ResourceYAMLMarshaller
- type ResourceYAMLUnmarshaller
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareInt64Slices ¶
func CompareMapBool ¶
func CompareMapInt64 ¶
func CompareMapString ¶
func CompareStringSlices ¶
Types ¶
type CtyDecoder ¶
type CtyDecoder interface {
DecodeCty(xpresource.Managed, cty.Value, *providers.Schema) (xpresource.Managed, error)
}
type CtyEncoder ¶
type Implementation ¶
type Implementation struct { // GVK is used to index other elements of the Entry by GVK GVK k8schema.GroupVersionKind // TerraformResourceName is needed to map the crossplane type // to the Terraform type name. This is needed to find the schema // for the type and to identify the type in API calls. TerraformResourceName string // SchemeBuilder is used to register the controller for this type with the // controller runtime. StartTerraformManager (in pkg/controller) iterates // through all the registration entries and performs the bindings. SchemeBuilder *scheme.Builder // ReconcilerConfigurer is the function responsible for calling // managed.NewReconciler to bind the reconciler to the managed resource // type. It is also invoked in StartTerraformManager. ReconcilerConfigurer ReconcilerConfigurer // ResourceMerger can update the local kubernetes object with attributes // from the cloud provider, late-initializing Spec fields, copying over Status // fields and annotations. ResourceMerger ResourceMerger // CtyEncoder produces the cty.Value (cty-encoded resource for // terraform) for a resource.Managed, given the corresponding schema // object. Note that we do not try to compile schemas in to the generated // code, they are always obtained from the terraform process itself. CtyEncoder CtyEncoder // CtyDecoder is the complement to EncodeCtyCallback. In addition // to the schema and cty.Value, it also requires a resource.Managed, using // the deepcopied value from this resource as the base structure (and // providing values for .Spec fields and k8s metadata) CtyDecoder CtyDecoder // ResourceYAMLMarshaller is the complement to UnmarshalResourceCallback, taking // a resource.Managed and producing the []byte representation. ResourceYAMLMarshaller ResourceYAMLMarshaller // ResourceYAMLUnmarshaller is only used for prototyping atm -- it's a // function that can parse the []byte representation of a managed resource // to a resource.Managed ResourceYAMLUnmarshaller ResourceYAMLUnmarshaller }
Implementation is a collection of callbacks required to implement a resource There can be multiple Implementations for a resource; ImplementationMerger is used to overlay them in a predictable fashion.
type ImplementationMerger ¶
type ImplementationMerger struct {
// contains filtered or unexported fields
}
An ImplementationMerger collects a sequence of Implementations through the Overlay method, and then can generate a single Implementation which is the result of merging all the layers into a single Implementation. It does this by picking a non-nil value for each field from the highest possible layer. Please see indexer_test.go for clarification.
func NewImplementationMerger ¶
func NewImplementationMerger() *ImplementationMerger
func (*ImplementationMerger) Merge ¶
func (mt *ImplementationMerger) Merge() (Implementation, error)
Merge flattens all the layers in the ImplementationMerger, with the invariant: a layers' non-empty fields always replace underlying layers' fields. So last field Overlayed wins, eg call Overlay w/ the generated base Implementation before the user-override Implementations. I don't know if we really need an error; if we can assume generated Implementations cover everything, we don't. if that turns out to be a bad assumption, the error would give us an escape hatch to fail on incomplete implementations at runtime.
func (*ImplementationMerger) Overlay ¶
func (mt *ImplementationMerger) Overlay(ft *Implementation)
type Index ¶
type Index struct {
// contains filtered or unexported fields
}
func (*Index) InvokerForGVK ¶
func (idx *Index) InvokerForGVK(gvk k8schema.GroupVersionKind) (*Invoker, error)
func (*Index) ReconcilerConfigurers ¶
func (idx *Index) ReconcilerConfigurers() []ReconcilerConfigurer
func (*Index) SchemeBuilders ¶
type Indexer ¶
type Indexer struct {
// contains filtered or unexported fields
}
func NewIndexer ¶
func NewIndexer() *Indexer
func (*Indexer) BuildIndex ¶
func (*Indexer) Overlay ¶
func (i *Indexer) Overlay(ft *Implementation) error
type Invoker ¶
type Invoker struct {
// contains filtered or unexported fields
}
func (*Invoker) DecodeCty ¶
func (a *Invoker) DecodeCty(r xpresource.Managed, v cty.Value, s *providers.Schema) (xpresource.Managed, error)
func (*Invoker) GVK ¶
func (a *Invoker) GVK() k8schema.GroupVersionKind
func (*Invoker) MarshalResourceYaml ¶
func (a *Invoker) MarshalResourceYaml(r xpresource.Managed) ([]byte, error)
func (*Invoker) MergeResources ¶
func (a *Invoker) MergeResources(f xpresource.Managed, t xpresource.Managed) (MergeDescription, error)
func (*Invoker) TerraformResourceName ¶
func (*Invoker) UnmarshalResourceYaml ¶
func (a *Invoker) UnmarshalResourceYaml(b []byte) (xpresource.Managed, error)
type MergeDescription ¶
type ProviderInit ¶
type ProviderInit struct { GVK k8schema.GroupVersionKind SchemeBuilder *scheme.Builder Initializer client.Initializer }
type ReconcilerConfigurer ¶
type ResourceMerger ¶
type ResourceMerger interface {
MergeResources(xpresource.Managed, xpresource.Managed) MergeDescription
}
type ResourceYAMLMarshaller ¶
type ResourceYAMLMarshaller interface {
MarshalResourceYAML(xpresource.Managed) ([]byte, error)
}
type ResourceYAMLUnmarshaller ¶
type ResourceYAMLUnmarshaller interface {
UnmarshalResourceYAML([]byte) (xpresource.Managed, error)
}