Documentation ¶
Overview ¶
Package tenant_controller groups the functionalities related to the Tenant controller.
Package tenant_controller groups the functionalities related to the Tenant controller.
Index ¶
Constants ¶
const ( // NoWorkspacesLabel -> label to be set (to true) when no workspaces are associated to the tenant. NoWorkspacesLabel = "crownlabs.polito.it/no-workspaces" // NFSSecretName -> NFS secret name. NFSSecretName = "mydrive-info" // NFSSecretServerNameKey -> NFS Server key in NFS secret. NFSSecretServerNameKey = "server-name" // NFSSecretPathKey -> NFS path key in NFS secret. NFSSecretPathKey = "path" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KcActor ¶
type KcActor struct { Client gocloak.GoCloak TargetRealm string TargetClientID string UserRequiredActions []string EmailActionsLifeSpanS int // contains filtered or unexported fields }
KcActor contains the needed objects and infos to use keycloak functionalities.
func NewKcActor ¶
func NewKcActor(kcURL, kcUser, kcPsw, targetRealmName, targetClient, loginRealm string) (*KcActor, error)
NewKcActor sets up a keycloak client with the specified parameters and performs the first login.
func (*KcActor) GetAccessToken ¶
GetAccessToken thread-safely returns the access token stored into the Token field.
type TenantReconciler ¶
type TenantReconciler struct { client.Client Scheme *runtime.Scheme KcA *KcActor TargetLabelKey string TargetLabelValue string SandboxClusterRole string Concurrency int MyDrivePVCsSize resource.Quantity MyDrivePVCsStorageClassName string MyDrivePVCsNamespace string RequeueTimeMinimum time.Duration RequeueTimeMaximum time.Duration TenantNSKeepAlive time.Duration BaseWorkspaces []string // This function, if configured, is deferred at the beginning of the Reconcile. // Specifically, it is meant to be set to GinkgoRecover during the tests, // in order to lead to a controlled failure in case the Reconcile panics. ReconcileDeferHook func() }
TenantReconciler reconciles a Tenant object.
func (*TenantReconciler) EnforceSandboxResources ¶
func (r *TenantReconciler) EnforceSandboxResources(ctx context.Context, tenant *clv1alpha2.Tenant) error
EnforceSandboxResources ensures the presence/absence of a sandbox.
func (*TenantReconciler) SetupWithManager ¶
func (r *TenantReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager registers a new controller for Tenant resources.
type WorkspaceReconciler ¶
type WorkspaceReconciler struct { client.Client Scheme *runtime.Scheme KcA *KcActor TargetLabelKey string TargetLabelValue string RequeueTimeMinimum time.Duration RequeueTimeMaximum time.Duration // This function, if configured, is deferred at the beginning of the Reconcile. // Specifically, it is meant to be set to GinkgoRecover during the tests, // in order to lead to a controlled failure in case the Reconcile panics. ReconcileDeferHook func() }
WorkspaceReconciler reconciles a Workspace object.
func (*WorkspaceReconciler) SetupWithManager ¶
func (r *WorkspaceReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager registers a new controller for Workspace resources.