Documentation ¶
Index ¶
- Constants
- Variables
- func ClickHouseQuotasProvision(quotaName string, databaseName string, chEndpoints *config.ClickHouseEndpoints, ...) []common.Action
- func ClickHouseUsersProvision(username string, password string, grants []string, instanceGrants []string, ...) []common.Action
- func Deployment(cr *v1alpha1.GitLabNamespace) *v1.Deployment
- func DeploymentMutator(clusterConfig *v1alpha1.Cluster, cr *v1alpha1.GitLabNamespace, ...) error
- func DeploymentSelector(cr *v1alpha1.GitLabNamespace) client.ObjectKey
- func GetRBACObjects(cr *v1alpha1.GitLabNamespace) ([]client.Object, error)
- func GetTenantOperatorName() string
- func GetTenantOperatorSelector() map[string]string
- func Group(clusterConfig *v1alpha1.Cluster, cr *v1alpha1.GitLabNamespace) *tenantOperator.Group
- func GroupMutator(clusterConfig *v1alpha1.Cluster, cr *v1alpha1.GitLabNamespace, ...) error
- func GroupSelector(cr *v1alpha1.GitLabNamespace) client.ObjectKey
- func Namespace(cr *v1alpha1.GitLabNamespace) *v1.Namespace
- func NamespaceMutator(cr *v1alpha1.GitLabNamespace, current *v1.Namespace) error
- func NamespaceSelector(cr *v1alpha1.GitLabNamespace) client.ObjectKey
- func ServiceAccount(clusterConfig *v1alpha1.Cluster, cr *v1alpha1.GitLabNamespace) *v1.ServiceAccount
- func ServiceAccountMutator(clusterConfig *v1alpha1.Cluster, cr *v1alpha1.GitLabNamespace, ...) error
- func Tenant(cluster *v1alpha1.Cluster, cr *v1alpha1.GitLabNamespace) *tenantOperator.Tenant
- func TenantMutator(cluster *v1alpha1.Cluster, cr *v1alpha1.GitLabNamespace, ...) error
- func TenantSelector(cr *v1alpha1.GitLabNamespace) client.ObjectKey
- type ClickhouseAssetsT
- type GitLabNamespaceReconciler
- type GitLabNamespaceState
- func (i *GitLabNamespaceState) ClickHouseQuotasInfo(subsystem SubsystemName) (map[string]string, error)
- func (i *GitLabNamespaceState) ClickHouseUserInfo(subsystem SubsystemName) (*url.Userinfo, error)
- func (i *GitLabNamespaceState) GetClickhouseEndpoints() *config.ClickHouseEndpoints
- func (i *GitLabNamespaceState) GetClusterState() *v1alpha1.Cluster
- func (i *GitLabNamespaceState) Read(ctx context.Context, cr *v1alpha1.GitLabNamespace, client client.Client) error
- func (i *GitLabNamespaceState) TenantEmpty() bool
- type ReconcileGitLabNamespace
- type SubsystemName
Constants ¶
const ( MemoryRequest = "256Mi" CpuRequest = "100m" MemoryLimit = "512Mi" CpuLimit = "300m" )
Variables ¶
var Replicas int32 = 1
Functions ¶
func Deployment ¶
func Deployment(cr *v1alpha1.GitLabNamespace) *v1.Deployment
func DeploymentMutator ¶
func DeploymentMutator( clusterConfig *v1alpha1.Cluster, cr *v1alpha1.GitLabNamespace, current *v1.Deployment, ) error
func DeploymentSelector ¶
func DeploymentSelector(cr *v1alpha1.GitLabNamespace) client.ObjectKey
func GetRBACObjects ¶
func GetRBACObjects(cr *v1alpha1.GitLabNamespace) ([]client.Object, error)
Get all RBAC objects from the embedded go templates above
func GetTenantOperatorName ¶
func GetTenantOperatorName() string
func Group ¶
func Group(clusterConfig *v1alpha1.Cluster, cr *v1alpha1.GitLabNamespace) *tenantOperator.Group
func GroupMutator ¶
func GroupMutator( clusterConfig *v1alpha1.Cluster, cr *v1alpha1.GitLabNamespace, current *tenantOperator.Group, ) error
func GroupSelector ¶
func GroupSelector(cr *v1alpha1.GitLabNamespace) client.ObjectKey
func NamespaceMutator ¶
func NamespaceMutator(cr *v1alpha1.GitLabNamespace, current *v1.Namespace) error
func NamespaceSelector ¶
func NamespaceSelector(cr *v1alpha1.GitLabNamespace) client.ObjectKey
func ServiceAccount ¶
func ServiceAccount(clusterConfig *v1alpha1.Cluster, cr *v1alpha1.GitLabNamespace) *v1.ServiceAccount
func ServiceAccountMutator ¶
func ServiceAccountMutator( clusterConfig *v1alpha1.Cluster, cr *v1alpha1.GitLabNamespace, current *v1.ServiceAccount, ) error
func Tenant ¶
func Tenant( cluster *v1alpha1.Cluster, cr *v1alpha1.GitLabNamespace, ) *tenantOperator.Tenant
func TenantMutator ¶
func TenantMutator( cluster *v1alpha1.Cluster, cr *v1alpha1.GitLabNamespace, current *tenantOperator.Tenant, ) error
func TenantSelector ¶
func TenantSelector(cr *v1alpha1.GitLabNamespace) client.ObjectKey
Types ¶
type ClickhouseAssetsT ¶
type GitLabNamespaceReconciler ¶
func NewGitLabNamespaceReconciler ¶
func NewGitLabNamespaceReconciler(teardown bool, logger logr.Logger) *GitLabNamespaceReconciler
func (*GitLabNamespaceReconciler) Reconcile ¶
func (i *GitLabNamespaceReconciler) Reconcile( state *GitLabNamespaceState, cr *v1alpha1.GitLabNamespace, ) common.DesiredState
type GitLabNamespaceState ¶
type GitLabNamespaceState struct { Tenant *tenantOperator.Tenant Group *tenantOperator.Group // Track all remaining groups in tenant so we // can tear down the tenant if no more groups exist TenantGroups *tenant.GroupsState Operator *v1.Deployment Namespace *corev1.Namespace Cluster *v1alpha1.Cluster ClickHouseAssets *ClickhouseAssetsT // contains filtered or unexported fields }
func NewGitLabNamespaceState ¶
func NewGitLabNamespaceState() *GitLabNamespaceState
func (*GitLabNamespaceState) ClickHouseQuotasInfo ¶
func (i *GitLabNamespaceState) ClickHouseQuotasInfo(subsystem SubsystemName) (map[string]string, error)
func (*GitLabNamespaceState) ClickHouseUserInfo ¶
func (i *GitLabNamespaceState) ClickHouseUserInfo(subsystem SubsystemName) (*url.Userinfo, error)
Get the Clickhouse user and password
func (*GitLabNamespaceState) GetClickhouseEndpoints ¶
func (i *GitLabNamespaceState) GetClickhouseEndpoints() *config.ClickHouseEndpoints
func (*GitLabNamespaceState) GetClusterState ¶
func (i *GitLabNamespaceState) GetClusterState() *v1alpha1.Cluster
func (*GitLabNamespaceState) Read ¶
func (i *GitLabNamespaceState) Read( ctx context.Context, cr *v1alpha1.GitLabNamespace, client client.Client, ) error
func (*GitLabNamespaceState) TenantEmpty ¶
func (i *GitLabNamespaceState) TenantEmpty() bool
TenantEmpty returns true if no groups exist for the tenant
type ReconcileGitLabNamespace ¶
type ReconcileGitLabNamespace struct { // This client, initialized using mgr.Client() above, is a split client // that reads objects from the cache and writes to the apiserver Client client.Client Scheme *runtime.Scheme Transport *http.Transport Recorder record.EventRecorder Log logr.Logger StatusPoller *polling.StatusPoller }
ReconcileGitLabNamespace reconciles a GitLabNamespace object
func (*ReconcileGitLabNamespace) Reconcile ¶
func (r *ReconcileGitLabNamespace) Reconcile( ctx context.Context, request reconcile.Request, ) (result ctrl.Result, err error)
Reconcile: The Controller will requeue the Request to be processed again if the returned error is non-nil or Result.Requeue is true. Upon completion, we just requeue the Request explicitly to be reconciled every minute thereafter.
One valid use-case of the repeated reconcile(s) of the underlying `GitlabNamespace` object is the need for updating a `Tenant` to inherit changes in `ClusterSpec.GOUI`. Since `Cluster“ updates do not trigger `GitlabNamespace` and by proxy `Tenant` reconciliation, th controller attempts to reconcile all underlying objects every X period of time.
func (*ReconcileGitLabNamespace) SetupWithManager ¶
func (r *ReconcileGitLabNamespace) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type SubsystemName ¶
type SubsystemName string
const ( JaegerSubsystemName SubsystemName = "jaeger" ErrorTrackingSubsystemName SubsystemName = "errortracking" )