common

package
v0.0.0-...-c4c25d3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 5, 2025 License: AGPL-3.0, Apache-2.0, MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
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

func Wait

func Wait() ctrl.Result

Wait returns the result to requeue after a short delay. Used for waiting for other resources to be ready.

Types

type DefaultScope

type DefaultScope[T client.Object] struct {
	// contains filtered or unexported fields
}

func (*DefaultScope[T]) PatchObject

func (in *DefaultScope[T]) PatchObject() error

type Scope

type Scope[T client.Object] interface {
	PatchObject() error
}

func NewDefaultScope

func NewDefaultScope[T client.Object](ctx context.Context, client client.Client, object T) (Scope[T], error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL