Documentation ¶
Index ¶
- func GetClaimCRDName(xrd v1alpha1.CompositeResourceDefinition) types.NamespacedName
- func GroupVersionKindOf(crd v1beta1.CustomResourceDefinition) schema.GroupVersionKind
- func Setup(mgr manager.Manager, remoteClient client.Client, logger logging.Logger) error
- type APIRemoteCRDFetcher
- type CRDFetcher
- type ControllerEngine
- type FetchFn
- type NopFetcher
- type Reconciler
- type ReconcilerOption
- func WithCRDFetcher(re CRDFetcher) ReconcilerOption
- func WithControllerEngine(c ControllerEngine) ReconcilerOption
- func WithFinalizer(f runtimeresource.Finalizer) ReconcilerOption
- func WithLocalApplicator(a runtimeresource.Applicator) ReconcilerOption
- func WithLogger(log logging.Logger) ReconcilerOption
- func WithRecorder(er event.Recorder) ReconcilerOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetClaimCRDName ¶
func GetClaimCRDName(xrd v1alpha1.CompositeResourceDefinition) types.NamespacedName
GetClaimCRDName returns the name of the claim CRD that's created as result of given CompositeResourceDefinition.
func GroupVersionKindOf ¶
func GroupVersionKindOf(crd v1beta1.CustomResourceDefinition) schema.GroupVersionKind
GroupVersionKindOf returns the served GroupVersionKind of given CRD.
Types ¶
type APIRemoteCRDFetcher ¶
type APIRemoteCRDFetcher struct {
// contains filtered or unexported fields
}
APIRemoteCRDFetcher gets the sanitized form of the claim CRD of given CompositeResourceDefinition by fetching it from remote cluster and stripping out cluster-specific metadata.
func NewAPIRemoteCRDFetcher ¶
func NewAPIRemoteCRDFetcher(client client.Client) *APIRemoteCRDFetcher
NewAPIRemoteCRDFetcher returns a new APIRemoteCRDFetcher.
func (*APIRemoteCRDFetcher) Fetch ¶
func (r *APIRemoteCRDFetcher) Fetch(ctx context.Context, xrd v1alpha1.CompositeResourceDefinition) (*v1beta1.CustomResourceDefinition, error)
Fetch returns the sanitized form of the claim CRD of given CompositeResourceDefinition by fetching it from remote cluster and stripping out cluster-specific metadata.
type CRDFetcher ¶
type CRDFetcher interface {
Fetch(ctx context.Context, ip v1alpha1.CompositeResourceDefinition) (*v1beta1.CustomResourceDefinition, error)
}
CRDFetcher can be satisfied with objects that can return a CRD with CompositeResourceDefinition information.
type ControllerEngine ¶
type ControllerEngine interface { Start(name string, o kcontroller.Options, w ...controller.Watch) error Stop(name string) }
ControllerEngine can be satisfied with objects that can start and stop a controller.
type FetchFn ¶
type FetchFn func(ctx context.Context, ip v1alpha1.CompositeResourceDefinition) (*v1beta1.CustomResourceDefinition, error)
FetchFn is used to provide a single function instead of a full object to satisfy Fetch interface.
func (FetchFn) Fetch ¶
func (r FetchFn) Fetch(ctx context.Context, ip v1alpha1.CompositeResourceDefinition) (*v1beta1.CustomResourceDefinition, error)
Fetch calls FetchFn it belongs to.
type NopFetcher ¶
type NopFetcher struct{}
NopFetcher does nothing.
func (NopFetcher) Fetch ¶
func (n NopFetcher) Fetch(_ context.Context, _ v1alpha1.CompositeResourceDefinition) (*v1beta1.CustomResourceDefinition, error)
Fetch does nothing.
type Reconciler ¶
type Reconciler struct {
// contains filtered or unexported fields
}
Reconciler watches the CompositeResourceDefinition with resource claim offerings in the cluster and creates a CRD for each of them with spec that is fetched via supplied CRDFetcher. Then it creates a controller for each new type that will sync the instances of that type from local cluster to remote cluster.
func NewReconciler ¶
func NewReconciler(mgr manager.Manager, remoteClient client.Client, opts ...ReconcilerOption) *Reconciler
NewReconciler returns a new *Reconciler.
type ReconcilerOption ¶
type ReconcilerOption func(*Reconciler)
ReconcilerOption is used to configure *Reconciler.
func WithCRDFetcher ¶
func WithCRDFetcher(re CRDFetcher) ReconcilerOption
WithCRDFetcher specifies how the Reconciler should fetch CRDs of claims.
func WithControllerEngine ¶
func WithControllerEngine(c ControllerEngine) ReconcilerOption
WithControllerEngine specifies how the Reconciler should start and stop controllers.
func WithFinalizer ¶
func WithFinalizer(f runtimeresource.Finalizer) ReconcilerOption
WithFinalizer specifies how the Reconciler should add and remove finalizers.
func WithLocalApplicator ¶
func WithLocalApplicator(a runtimeresource.Applicator) ReconcilerOption
WithLocalApplicator specifies what Applicator in local cluster Reconciler should use.
func WithLogger ¶
func WithLogger(log logging.Logger) ReconcilerOption
WithLogger specifies how the Reconciler should log messages.
func WithRecorder ¶
func WithRecorder(er event.Recorder) ReconcilerOption
WithRecorder specifies how the Reconciler should record Kubernetes events.