controller

package
v0.9.5 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: EUPL-1.2 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BackendNamespace

func BackendNamespace(
	ctx context.Context,
	paas *v1alpha1.Paas,
	name string,
	quota string,
	scheme *runtime.Scheme,
) (*corev1.Namespace, error)

backendNamespace is a code for Creating Namespace

func ClusterWideCapabilityName

func ClusterWideCapabilityName(quotaName string) (capabilityName string, err error)

func ClusterWideQuotaName

func ClusterWideQuotaName(capabilityName string) string

func EnsureNamespace

func EnsureNamespace(
	r client.Client,
	ctx context.Context,
	addMessageFunc func(v1alpha1.PaasStatusLevel, v1alpha1.PaasStatusAction, client.Object, string),
	paas *v1alpha1.Paas,
	ns *corev1.Namespace,
	scheme *runtime.Scheme,
) error

ensureNamespace ensures Namespace presence in given namespace.

func EnsureRoleBinding

func EnsureRoleBinding(
	ctx context.Context,
	r Reconciler,
	paas *v1alpha1.Paas,
	statusMessages *v1alpha1.PaasNsStatus,
	rb *rbac.RoleBinding,
) error

ensureRoleBinding ensures RoleBinding presence in given rolebinding.

func FinalizeRoleBinding

func FinalizeRoleBinding(
	ctx context.Context,
	r Reconciler,
	statusMessages *v1alpha1.PaasNsStatus,
	rb *rbac.RoleBinding,
) error

ensureRoleBinding ensures RoleBinding presence in given rolebinding.

Types

type Elements

type Elements map[string]string

Elements represents all key, value pars for one entry in the list of the listgenerator

func ElementsFromJSON

func ElementsFromJSON(raw []byte) (Elements, error)

func (Elements) AsJSON

func (es Elements) AsJSON() ([]byte, error)

func (Elements) AsString

func (es Elements) AsString() string

func (Elements) Key

func (es Elements) Key() string

type Entries

type Entries map[string]Elements

Entries represents all entries in the list of the listgenerator This is a map so that values are unique, the key is the paas entry

func EntriesFromJSON

func EntriesFromJSON(data []apiextensionsv1.JSON) (Entries, error)

func (Entries) AsJSON

func (en Entries) AsJSON() ([]apiextensionsv1.JSON, error)

func (Entries) AsString

func (en Entries) AsString() string

type PaasNSReconciler

type PaasNSReconciler struct {
	client.Client
	Scheme *runtime.Scheme
}

PaasNSReconciler reconciles a PaasNS object

func (*PaasNSReconciler) BackendSecrets

func (r *PaasNSReconciler) BackendSecrets(
	ctx context.Context,
	paasns *v1alpha1.PaasNS,
	paas *v1alpha1.Paas,
) (secrets []*corev1.Secret)

func (*PaasNSReconciler) EnsureAppSetCap

func (r *PaasNSReconciler) EnsureAppSetCap(
	ctx context.Context,
	paasns *v1alpha1.PaasNS,
	paas *v1alpha1.Paas,
) error

ensureAppSetCap ensures a list entry in the AppSet voor the capability

func (*PaasNSReconciler) EnsureAppSetCaps

func (r *PaasNSReconciler) EnsureAppSetCaps(
	ctx context.Context,
	paasns *v1alpha1.PaasNS,
	paas *v1alpha1.Paas,
) error

ensureAppSetCap ensures a list entry in the AppSet voor the capability

func (*PaasNSReconciler) EnsureArgoApp

func (r *PaasNSReconciler) EnsureArgoApp(
	ctx context.Context,
	paasns *v1alpha1.PaasNS,
	paas *v1alpha1.Paas,
) error

ensureArgoApp ensures ArgoApp presence in given argo application.

func (*PaasNSReconciler) EnsureArgoCD

func (r *PaasNSReconciler) EnsureArgoCD(
	ctx context.Context,
	paasns *v1alpha1.PaasNS,
) error

ensureLdapGroup ensures Group presence

func (*PaasNSReconciler) EnsureSecret

func (r *PaasNSReconciler) EnsureSecret(
	ctx context.Context,
	paasns *v1alpha1.PaasNS,
	secret *corev1.Secret,
) error

ensureSecret ensures Secret presence in given secret.

func (*PaasNSReconciler) FinalizeArgoApp

func (r *PaasNSReconciler) FinalizeArgoApp(
	ctx context.Context,
	paasns *v1alpha1.PaasNS,
) error

func (*PaasNSReconciler) FinalizeClusterQuota

func (r *PaasNSReconciler) FinalizeClusterQuota(ctx context.Context, paasns *v1alpha1.PaasNS) error

func (*PaasNSReconciler) FinalizeNamespace

func (r *PaasNSReconciler) FinalizeNamespace(
	ctx context.Context,
	paasns *v1alpha1.PaasNS,
	paas *v1alpha1.Paas,
) error

func (*PaasNSReconciler) GetPaas

func (r *PaasNSReconciler) GetPaas(ctx context.Context, paasns *v1alpha1.PaasNS) (paas *v1alpha1.Paas, err error)

func (*PaasNSReconciler) GetPaasNs

func (r *PaasNSReconciler) GetPaasNs(ctx context.Context, req ctrl.Request) (paasns *v1alpha1.PaasNS, err error)

func (PaasNSReconciler) GetScheme

func (pr PaasNSReconciler) GetScheme() *runtime.Scheme

func (*PaasNSReconciler) Reconcile

func (r *PaasNSReconciler) Reconcile(ctx context.Context, req ctrl.Request) (result ctrl.Result, err error)

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

func (*PaasNSReconciler) ReconcileExtraClusterRoleBinding

func (r *PaasNSReconciler) ReconcileExtraClusterRoleBinding(
	ctx context.Context,
	paasns *v1alpha1.PaasNS,
	paas *v1alpha1.Paas,
) (err error)

func (*PaasNSReconciler) ReconcileNamespaces

func (r *PaasNSReconciler) ReconcileNamespaces(
	ctx context.Context,
	paas *v1alpha1.Paas,
	paasns *v1alpha1.PaasNS,
) (err error)

func (*PaasNSReconciler) ReconcileRolebindings

func (r *PaasNSReconciler) ReconcileRolebindings(
	ctx context.Context,
	paas *v1alpha1.Paas,
	paasns *v1alpha1.PaasNS,
	logger logr.Logger,
) error

ReconcileRolebindings is used by the PaasNS reconciler to reconcile RB's

func (*PaasNSReconciler) ReconcileSecrets

func (r *PaasNSReconciler) ReconcileSecrets(
	ctx context.Context,
	paas *v1alpha1.Paas,
	paasns *v1alpha1.PaasNS,
	logger logr.Logger,
) error

func (*PaasNSReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type PaasQuotas

type PaasQuotas map[string]paas_quota.Quotas

type PaasReconciler

type PaasReconciler struct {
	client.Client
	Scheme *runtime.Scheme
}

PaasReconciler reconciles a Paas object

func (*PaasReconciler) BackendAppProject

func (r *PaasReconciler) BackendAppProject(
	ctx context.Context,
	paas *v1alpha1.Paas,
) *argo.AppProject

backendAppProject is a code for Creating AppProject

func (*PaasReconciler) BackendEnabledQuotaStatus

func (r *PaasReconciler) BackendEnabledQuotaStatus(
	paas *v1alpha1.Paas,
) (quotas PaasQuotas, err error)

func (*PaasReconciler) BackendEnabledQuotas

func (r *PaasReconciler) BackendEnabledQuotas(
	ctx context.Context,
	paas *v1alpha1.Paas,
) (quotas []*quotav1.ClusterResourceQuota, err error)

func (*PaasReconciler) BackendGroups

func (r *PaasReconciler) BackendGroups(
	ctx context.Context,
	paas *v1alpha1.Paas,
) (groups []*userv1.Group)

func (*PaasReconciler) BackendUnneededQuotas

func (r *PaasReconciler) BackendUnneededQuotas(
	ctx context.Context,
	paas *v1alpha1.Paas,
) (quotas []string)

func (*PaasReconciler) EnsureAppProject

func (r *PaasReconciler) EnsureAppProject(
	ctx context.Context,
	paas *v1alpha1.Paas,
	logger logr.Logger,
) error

ensureAppProject ensures AppProject presence in given namespace.

func (*PaasReconciler) EnsureGroup

func (r *PaasReconciler) EnsureGroup(
	ctx context.Context,
	paas *v1alpha1.Paas,
	group *userv1.Group,
) error

ensureGroup ensures Group presence

func (*PaasReconciler) EnsureLdapGroups

func (r *PaasReconciler) EnsureLdapGroups(
	ctx context.Context,
	paas *v1alpha1.Paas,
) error

ensureLdapGroup ensures Group presence

func (*PaasReconciler) EnsureQuota

func (r *PaasReconciler) EnsureQuota(
	ctx context.Context,
	paas *v1alpha1.Paas,
	quota *quotav1.ClusterResourceQuota,
) error

ensureQuota ensures Quota presence

func (*PaasReconciler) FetchAllPaasCapabilityResources

func (r *PaasReconciler) FetchAllPaasCapabilityResources(
	ctx context.Context,
	quota *quotav1.ClusterResourceQuota,
	defaults map[string]string,
) (resources paas_quota.QuotaLists, err error)

func (*PaasReconciler) FinalizeAppSetCaps

func (r *PaasReconciler) FinalizeAppSetCaps(
	ctx context.Context,
	paas *v1alpha1.Paas,
) error

ensureAppSetCap ensures a list entry in the AppSet voor the capability

func (*PaasReconciler) FinalizeClusterQuota

func (r *PaasReconciler) FinalizeClusterQuota(ctx context.Context, paas *v1alpha1.Paas, quotaName string) error

func (*PaasReconciler) FinalizeClusterQuotas

func (r *PaasReconciler) FinalizeClusterQuotas(ctx context.Context, paas *v1alpha1.Paas) error

func (*PaasReconciler) FinalizeClusterWideQuotas

func (r *PaasReconciler) FinalizeClusterWideQuotas(ctx context.Context, paas *v1alpha1.Paas) error

func (*PaasReconciler) FinalizeExtraClusterRoleBindings

func (r *PaasReconciler) FinalizeExtraClusterRoleBindings(
	ctx context.Context,
	paas *v1alpha1.Paas,
) (err error)

func (*PaasReconciler) FinalizeGroups

func (r *PaasReconciler) FinalizeGroups(
	ctx context.Context,
	paas *v1alpha1.Paas,
) (cleaned []string, err error)

func (*PaasReconciler) FinalizeLdapGroups

func (r *PaasReconciler) FinalizeLdapGroups(
	ctx context.Context,
	paas *v1alpha1.Paas,
	cleanedLdapQueries []string,
) error

ensureLdapGroup ensures Group presence

func (*PaasReconciler) FinalizePaasNss

func (r *PaasReconciler) FinalizePaasNss(ctx context.Context, paas *v1alpha1.Paas) error

func (*PaasReconciler) GetPaas

func (r *PaasReconciler) GetPaas(
	ctx context.Context,
	req ctrl.Request,
) (paas *v1alpha1.Paas, err error)

func (*PaasReconciler) GetPaasNs

func (r *PaasReconciler) GetPaasNs(ctx context.Context, paas *v1alpha1.Paas, name string,
	groups []string, secrets map[string]string,
) (*v1alpha1.PaasNS, error)

func (PaasReconciler) GetScheme

func (pr PaasReconciler) GetScheme() *runtime.Scheme

func (*PaasReconciler) Reconcile

func (r *PaasReconciler) Reconcile(ctx context.Context, req ctrl.Request) (result ctrl.Result, err error)

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

func (*PaasReconciler) ReconcileClusterWideQuota

func (r *PaasReconciler) ReconcileClusterWideQuota(ctx context.Context, paas *v1alpha1.Paas) error

func (*PaasReconciler) ReconcileGroups

func (r *PaasReconciler) ReconcileGroups(
	ctx context.Context,
	paas *v1alpha1.Paas,
	logger logr.Logger,
) error

func (*PaasReconciler) ReconcilePaasNss

func (r *PaasReconciler) ReconcilePaasNss(
	ctx context.Context,
	paas *v1alpha1.Paas,
	logger logr.Logger,
) error

func (*PaasReconciler) ReconcileQuotas

func (r *PaasReconciler) ReconcileQuotas(
	ctx context.Context,
	paas *v1alpha1.Paas,
	logger logr.Logger,
) (err error)

func (*PaasReconciler) ReconcileRolebindings

func (r *PaasReconciler) ReconcileRolebindings(
	ctx context.Context,
	paas *v1alpha1.Paas,
	logger logr.Logger,
) error

ReconcileRolebindings is used by the Paas reconciler to reconcile RB's

func (*PaasReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

func (*PaasReconciler) UpdateClusterWideQuotaResources

func (r *PaasReconciler) UpdateClusterWideQuotaResources(
	ctx context.Context,
	quota *quotav1.ClusterResourceQuota,
) (err error)

type Reconciler

type Reconciler interface {
	Get(ctx context.Context, key types.NamespacedName, obj client.Object, opts ...client.GetOption) error
	Create(ctx context.Context, obj client.Object, opts ...client.CreateOption) error
	Update(ctx context.Context, obj client.Object, opts ...client.UpdateOption) error
	GetScheme() *runtime.Scheme
	Delete(context.Context, client.Object, ...client.DeleteOption) error
}

Jump to

Keyboard shortcuts

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