reconcile

package
v0.68.4 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2026 License: Apache-2.0 Imports: 41 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClusterRole added in v0.51.0

func ClusterRole(ctx context.Context, rclient client.Client, newObj, prevObj *rbacv1.ClusterRole) error

ClusterRole reconciles cluster role object

func ClusterRoleBinding added in v0.51.0

func ClusterRoleBinding(ctx context.Context, rclient client.Client, newObj, prevObj *rbacv1.ClusterRoleBinding) error

ClusterRoleBinding reconciles cluster role binding object

func ConfigMap added in v0.48.0

func ConfigMap(ctx context.Context, rclient client.Client, newObj *corev1.ConfigMap, prevMeta *metav1.ObjectMeta, owner *metav1.OwnerReference) (bool, error)

ConfigMap reconciles configmap object

func DaemonSet added in v0.55.0

func DaemonSet(ctx context.Context, rclient client.Client, newObj, prevObj *appsv1.DaemonSet, owner *metav1.OwnerReference) error

DaemonSet performs an update or create operator for daemonset and waits until it finishes update rollout

func Deployment

func Deployment(ctx context.Context, rclient client.Client, newObj, prevObj *appsv1.Deployment, owner *metav1.OwnerReference, o *DeploymentOpts) error

Deployment performs an update or create operator for deployment and waits until it's replicas is ready

func HPA

func HPA(ctx context.Context, rclient client.Client, newObj, prevObj *v2.HorizontalPodAutoscaler, owner *metav1.OwnerReference) error

HPA creates or update horizontalPodAutoscaler object

func HTTPRoute added in v0.66.0

func HTTPRoute(ctx context.Context, rclient client.Client, newObj, prevObj *gwapiv1.HTTPRoute, owner *metav1.OwnerReference) error

HTTPRoute creates or updates HTTPRoute object

func Ingress added in v0.68.0

func Ingress(ctx context.Context, rclient client.Client, newObj, prevObj *networkingv1.Ingress, owner *metav1.OwnerReference) error

Ingress creates or updates Ingress object

func Init added in v0.68.2

func Init(cfg *config.BaseOperatorConf, statusUpdate time.Duration)

Init sets package defaults

func IsRetryable added in v0.66.0

func IsRetryable(err error) bool

IsRetryable determines one of errors: * error which indicates that timeout for app transition into Ready state reached and should be continued at the next reconcile loop * k8s conflict error * reconciled resource is being deleted

func PDB

func PDB(ctx context.Context, rclient client.Client, newObj, prevObj *policyv1.PodDisruptionBudget, owner *metav1.OwnerReference) error

PDB creates or updates PodDisruptionBudget

func PersistentVolumeClaim added in v0.48.0

func PersistentVolumeClaim(ctx context.Context, rclient client.Client, newObj, prevObj *corev1.PersistentVolumeClaim, owner *metav1.OwnerReference) error

PersistentVolumeClaim reconciles PVC object It updates only resource spec other fields are ignored Makes attempt to resize pvc if needed in case of deletion timestamp > 0 does nothing user must manually remove finalizer if needed

func PodIsReady

func PodIsReady(pod *corev1.Pod, minReadySeconds int32) bool

PodIsReady check is pod is ready

func Role added in v0.48.0

func Role(ctx context.Context, rclient client.Client, newObj, prevObj *rbacv1.Role, owner *metav1.OwnerReference) error

Role reconciles role object

func RoleBinding added in v0.48.0

func RoleBinding(ctx context.Context, rclient client.Client, newObj, prevObj *rbacv1.RoleBinding, owner *metav1.OwnerReference) error

RoleBinding reconciles rolebindg object

func Secret added in v0.48.0

func Secret(ctx context.Context, rclient client.Client, newObj *corev1.Secret, prevMeta *metav1.ObjectMeta, owner *metav1.OwnerReference) error

Secret reconciles secret object

func Service added in v0.48.0

func Service(ctx context.Context, rclient client.Client, newObj, prevObj *corev1.Service, owner *metav1.OwnerReference) error

Service - reconcile needed and actual state of service for given crd, it will recreate service if needed. NOTE it doesn't perform validation: in case of spec.type= LoadBalancer or NodePort, clusterIP: None is not allowed, its users responsibility to define it correctly.

func ServiceAccount

func ServiceAccount(ctx context.Context, rclient client.Client, newObj, prevObj *corev1.ServiceAccount, owner *metav1.OwnerReference) error

ServiceAccount creates service account or updates exist one

func StatefulSet added in v0.68.0

func StatefulSet(ctx context.Context, rclient client.Client, newObj, prevObj *appsv1.StatefulSet, owner *metav1.OwnerReference, o *StatefulSetOpts) error

StatefulSet performs create and update operations for given statefulSet with STSOptions

func StatusForChildObjects added in v0.51.0

func StatusForChildObjects[T any, PT interface {
	*T
	objectWithStatus
}](ctx context.Context, rclient client.Client, parentObjectName string, childObjects []PT) error

StatusForChildObjects reconciles status sub-resources Expects parentObjectName in the following form: NAME.NAMESPACE.RESOURCE

for example vmalertmanager `main` at namespace `monitoring` must be in form: main.monitoring.vmalertmanager

func UpdateObjectStatus added in v0.59.0

func UpdateObjectStatus[T client.Object, ST StatusWithMetadata[STC], STC any](ctx context.Context, rclient client.Client, object ObjectWithDeepCopyAndStatus[T, ST, STC], actualStatus vmv1beta1.UpdateStatus, maybeErr error) error

UpdateStatus reconcile provided object status with given actualStatus status

func VMAgent added in v0.68.0

func VMAgent(ctx context.Context, rclient client.Client, newObj, prevObj *vmv1beta1.VMAgent, owner *metav1.OwnerReference) error

VMAgent performs an update or create of VMAgent and till it's ready

func VMAuth added in v0.68.0

func VMAuth(ctx context.Context, rclient client.Client, newObj, prevObj *vmv1beta1.VMAuth, owner *metav1.OwnerReference) error

VMAuth performs an update or create of VMAuth and till it's ready

func VMCluster added in v0.68.0

func VMCluster(ctx context.Context, rclient client.Client, newObj, prevObj *vmv1beta1.VMCluster, owner *metav1.OwnerReference) error

VMCluster performs an update or create of VMCluster and till it's ready

func VMPodScrape added in v0.68.2

func VMPodScrape(ctx context.Context, rclient client.Client, newObj, prevObj *vmv1beta1.VMPodScrape, owner *metav1.OwnerReference) error

VMPodScrape creates or updates given object

func VMServiceScrape added in v0.68.2

func VMServiceScrape(ctx context.Context, rclient client.Client, newObj, prevObj *vmv1beta1.VMServiceScrape, owner *metav1.OwnerReference) error

VMServiceScrape creates or updates given object

func VPA added in v0.68.0

func VPA(ctx context.Context, rclient client.Client, newObj, prevObj *vpav1.VerticalPodAutoscaler, owner *metav1.OwnerReference) error

VPA creates or updates VerticalPodAutoscaler object

Types

type DeploymentOpts added in v0.68.4

type DeploymentOpts struct {
	PatchSpec func(existingSpec, newSpec *appsv1.DeploymentSpec)
}

type ObjectWithDeepCopyAndStatus added in v0.59.0

type ObjectWithDeepCopyAndStatus[T client.Object, ST StatusWithMetadata[STC], STC any] interface {
	client.Object
	DeepCopy() T
	GetStatus() ST
	GetStatusMetadata() *vmv1beta1.StatusMetadata
	DefaultStatusFields(ST)
}

type StatefulSetOpts added in v0.68.4

type StatefulSetOpts struct {
	SelectorLabels map[string]string
	PatchSpec      func(existingSpec, newSpec *appsv1.StatefulSetSpec)
	UpdateBehavior *vmv1beta1.StatefulSetUpdateStrategyBehavior
}

StatefulSetOpts options for StatefulSet update HPA and UpdateReplicaCount optional

type StatusWithMetadata added in v0.59.0

type StatusWithMetadata[T any] interface {
	DeepCopy() T
}

StatusWithMetadata defines

Jump to

Keyboard shortcuts

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