controllers

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2022 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ClusterResourceQuotaKind = "ClusterResourceQuota"

	LabelClusterResourceQuotaAutoUpdate = "clusterresourcequota.quota.kubezoo.io/autoupdate"
)
View Source
var DefaultRetry = wait.Backoff{
	Steps:    5,
	Duration: 10 * time.Millisecond,
	Factor:   1.0,
	Jitter:   0.1,
}

DefaultRetry is the recommended retry for a conflict where multiple clients are making changes to the same resource.

Functions

func GetNamespacesForClusterQuota

func GetNamespacesForClusterQuota(ctx context.Context, c client.Client, clusterquota *quotav1alpha1.ClusterResourceQuota) (sets.String, error)

func GetResourceQuotaForClusterQuota

func GetResourceQuotaForClusterQuota(ctx context.Context, c client.Client, clusterquota *quotav1alpha1.ClusterResourceQuota) (sets.String, map[string][]*corev1.ResourceQuota, error)

func UpdateOnConflict

func UpdateOnConflict(
	ctx context.Context,
	backoff wait.Backoff,
	apiReader client.Reader,
	apiWriter Updater,
	obj client.Object,
	f controllerutil.MutateFn,
) (controllerutil.OperationResult, error)

Types

type Admission

type Admission struct {
	// contains filtered or unexported fields
}

func NewAdmission

func NewAdmission(ctx context.Context, client client.Client) *Admission

func (*Admission) Handle

func (*Admission) InjectDecoder

func (a *Admission) InjectDecoder(d *admission.Decoder) error

InjectDecoder injects the decoder into a validatingHandler.

func (*Admission) InjectLogger

func (a *Admission) InjectLogger(logger logr.Logger) error

InjectDecoder injects the decoder into a validatingHandler.

type ClusterResourceQuotaReconciler

type ClusterResourceQuotaReconciler struct {
	client.Client
	Scheme    *runtime.Scheme
	Cache     cache.Cache
	APIReader client.Reader
	Logger    logr.Logger
}

ClusterResourceQuotaReconciler reconciles a ClusterResourceQuota object

func (*ClusterResourceQuotaReconciler) Reconcile

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. TODO(user): Modify the Reconcile function to compare the state specified by the ClusterResourceQuota object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.13.0/pkg/reconcile

func (*ClusterResourceQuotaReconciler) SetupWithManager

func (r *ClusterResourceQuotaReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type Updater

type Updater interface {
	Update(ctx context.Context, obj client.Object, opts ...client.UpdateOption) error
}

Jump to

Keyboard shortcuts

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