Documentation ¶
Index ¶
- Variables
- func CreateAdmissionAttributes(req admissionv1.AdmissionRequest) pkgadmission.Attributes
- func GetNamespacesForClusterQuota(ctx context.Context, c client.Client, ...) (sets.String, error)
- func GetResourceQuotaForClusterQuota(ctx context.Context, c client.Client, ...) (sets.String, map[string][]*corev1.ResourceQuota, error)
- func UpdateOnConflict(ctx context.Context, backoff wait.Backoff, apiReader client.Reader, ...) (controllerutil.OperationResult, error)
- type Admission
- type ClusterResourceQuotaReconciler
- type Updater
Constants ¶
This section is empty.
Variables ¶
var ( ClusterResourceQuotaKind = "ClusterResourceQuota" LabelClusterResourceQuotaAutoUpdate = "clusterresourcequota.quota.kubezoo.io/autoupdate" )
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 CreateAdmissionAttributes ¶
func CreateAdmissionAttributes(req admissionv1.AdmissionRequest) pkgadmission.Attributes
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 (*Admission) InjectDecoder ¶
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 ¶
func (r *ClusterResourceQuotaReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
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.