Documentation ¶
Overview ¶
Package external implements external controller types.
Index ¶
- func CloneTemplate(ctx context.Context, in *CloneTemplateInput) (*corev1.ObjectReference, error)
- func Delete(ctx context.Context, c client.Client, ref *corev1.ObjectReference) error
- func FailuresFrom(obj *unstructured.Unstructured) (string, string, error)
- func GenerateTemplate(in *GenerateTemplateInput) (*unstructured.Unstructured, error)
- func Get(ctx context.Context, c client.Client, ref *corev1.ObjectReference, ...) (*unstructured.Unstructured, error)
- func GetObjectReference(obj *unstructured.Unstructured) *corev1.ObjectReference
- func IsInitialized(obj *unstructured.Unstructured) (bool, error)
- func IsReady(obj *unstructured.Unstructured) (bool, error)
- type CloneTemplateInput
- type GenerateTemplateInput
- type ObjectTracker
- type ReconcileOutput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CloneTemplate ¶
func CloneTemplate(ctx context.Context, in *CloneTemplateInput) (*corev1.ObjectReference, error)
CloneTemplate uses the client and the reference to create a new object from the template.
func Delete ¶ added in v0.4.3
Delete uses the client and reference to delete an external, unstructured object.
func FailuresFrom ¶ added in v0.3.0
func FailuresFrom(obj *unstructured.Unstructured) (string, string, error)
FailuresFrom returns the FailureReason and FailureMessage fields from the external object status.
func GenerateTemplate ¶ added in v0.3.3
func GenerateTemplate(in *GenerateTemplateInput) (*unstructured.Unstructured, error)
GenerateTemplate generates an object with the given template input.
func Get ¶
func Get(ctx context.Context, c client.Client, ref *corev1.ObjectReference, namespace string) (*unstructured.Unstructured, error)
Get uses the client and reference to get an external, unstructured object.
func GetObjectReference ¶ added in v0.3.3
func GetObjectReference(obj *unstructured.Unstructured) *corev1.ObjectReference
GetObjectReference converts an unstructured into object reference.
func IsInitialized ¶ added in v0.3.0
func IsInitialized(obj *unstructured.Unstructured) (bool, error)
IsInitialized returns true if the Status.Initialized field on an external object is true.
func IsReady ¶
func IsReady(obj *unstructured.Unstructured) (bool, error)
IsReady returns true if the Status.Ready field on an external object is true.
Types ¶
type CloneTemplateInput ¶ added in v0.3.0
type CloneTemplateInput struct { // Client is the controller runtime client. Client client.Client // TemplateRef is a reference to the template that needs to be cloned. TemplateRef *corev1.ObjectReference // Namespace is the Kubernetes namespace the cloned object should be created into. Namespace string // ClusterName is the cluster this object is linked to. ClusterName string // OwnerRef is an optional OwnerReference to attach to the cloned object. // +optional OwnerRef *metav1.OwnerReference // Labels is an optional map of labels to be added to the object. // +optional Labels map[string]string // Annotations is an optional map of annotations to be added to the object. // +optional Annotations map[string]string }
CloneTemplateInput is the input to CloneTemplate.
type GenerateTemplateInput ¶ added in v0.3.3
type GenerateTemplateInput struct { // Template is the TemplateRef turned into an unstructured. Template *unstructured.Unstructured // TemplateRef is a reference to the template that needs to be cloned. TemplateRef *corev1.ObjectReference // Namespace is the Kubernetes namespace the cloned object should be created into. Namespace string // ClusterName is the cluster this object is linked to. ClusterName string // OwnerRef is an optional OwnerReference to attach to the cloned object. // +optional OwnerRef *metav1.OwnerReference // Labels is an optional map of labels to be added to the object. // +optional Labels map[string]string // Annotations is an optional map of annotations to be added to the object. // +optional Annotations map[string]string }
GenerateTemplateInput is the input needed to generate a new template.
type ObjectTracker ¶ added in v0.3.0
type ObjectTracker struct { Controller controller.Controller // contains filtered or unexported fields }
ObjectTracker is a helper struct to deal when watching external unstructured objects.
type ReconcileOutput ¶ added in v0.3.0
type ReconcileOutput struct { // RequeueAfter if greater than 0, tells the Controller to requeue the reconcile key after the Duration. // Implies that Requeue is true, there is no need to set Requeue to true at the same time as RequeueAfter. // // TODO(vincepri): Remove this field here and try to return a better struct that embeds ctrl.Result, // we can't do that today because the field would conflict with the current `Result` field, // which should probably be renamed to `Object` or something similar. RequeueAfter time.Duration // Details of the referenced external object. // +optional Result *unstructured.Unstructured // Indicates if the external object is paused. // +optional Paused bool }
ReconcileOutput is a return type of the external reconciliation of referenced objects.