Documentation
¶
Index ¶
- Constants
- func BindingsAttributes(bindings []v1alpha1.Binding) ([]*console.PolicyBindingAttributes, error)
- func GateJobAttributes(job *v1alpha1.JobSpec) (*console.GateJobAttributes, error)
- func HandleRequeue(result *ctrl.Result, err error, setCondition func(condition metav1.Condition)) (ctrl.Result, error)
- func OwnedByEventHandler(ownerGk *metav1.GroupKind) handler.EventHandler
- func Project(ctx context.Context, c runtimeclient.Client, scheme *runtime.Scheme, ...) (*v1alpha1.Project, *ctrl.Result, error)
- func ServiceTemplateAttributes(ctx context.Context, c runtimeclient.Client, namespace string, ...) (*console.ServiceTemplateAttributes, error)
- func TryAddOwnedByAnnotation(ctx context.Context, client runtimeclient.Client, owner runtimeclient.Object, ...) error
- func Wait() ctrl.Result
- type DefaultScope
- type Scope
Constants ¶
const ( // OwnedByAnnotation is an annotation used to mark resources that are owned by our CRDs. // It is used instead of the standard owner reference to avoid garbage collection of resources // but still be able to reconcile them. OwnedByAnnotation = "deployments.plural.sh/owned-by" )
Variables ¶
This section is empty.
Functions ¶
func BindingsAttributes ¶
func BindingsAttributes(bindings []v1alpha1.Binding) ([]*console.PolicyBindingAttributes, error)
BindingsAttributes translates a list of bindings into API attributes using identity cache.
func GateJobAttributes ¶
func GateJobAttributes(job *v1alpha1.JobSpec) (*console.GateJobAttributes, error)
func HandleRequeue ¶
func HandleRequeue(result *ctrl.Result, err error, setCondition func(condition metav1.Condition)) (ctrl.Result, error)
HandleRequeue allows avoiding rate limiting when some errors occur, i.e., when a resource is not created yet, or when it is waiting for an ID. If the result is set, then any potential error will be saved in a condition and ignored in the return to avoid rate limiting. If not found error is detected, then the result is automatically changed to wait. It is important that at least one from a result or an error has to be non-nil.
func OwnedByEventHandler ¶
func OwnedByEventHandler(ownerGk *metav1.GroupKind) handler.EventHandler
func Project ¶
func Project(ctx context.Context, c runtimeclient.Client, scheme *runtime.Scheme, obj interface{}) (*v1alpha1.Project, *ctrl.Result, error)
Project checks resource for a project reference and then fetches the corresponding resource. It also sets the owner reference of the project to the provided object.
func ServiceTemplateAttributes ¶
func ServiceTemplateAttributes(ctx context.Context, c runtimeclient.Client, namespace string, srv *v1alpha1.ServiceTemplate, repositoryID *string) (*console.ServiceTemplateAttributes, error)
func TryAddOwnedByAnnotation ¶
func TryAddOwnedByAnnotation(ctx context.Context, client runtimeclient.Client, owner runtimeclient.Object, child runtimeclient.Object) error
Types ¶
type DefaultScope ¶
func (*DefaultScope[T]) PatchObject ¶
func (in *DefaultScope[T]) PatchObject() error