gitlab

package
v0.11.7 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2022 License: Apache-2.0, MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GlobalPraefectVirtualStorages              = "global.praefect.virtualStorages"
	GlobalPraefectReplaceInternalGitalyEnabled = "global.praefect.replaceInternalGitaly"
)
View Source
const (
	GitLabMailroomEnabled = "gitlab.mailroom.enabled"
	IncomingEmailEnabled  = "global.appConfig.incomingEmail.enabled"
	IncomingEmailSecret   = "global.appConfig.incomingEmail.password.secret" //nolint:golint,gosec
)
View Source
const (
	// Known object kinds.
	ConfigMapKind               = "ConfigMap"
	CronJobKind                 = "CronJob"
	DeploymentKind              = "Deployment"
	HorizontalPodAutoscalerKind = "HorizontalPodAutoscaler"
	IngressKind                 = "Ingress"
	JobKind                     = "Job"
	PersistentVolumeClaimKind   = "PersistentVolumeClaim"
	SecretKind                  = "Secret"
	ServiceKind                 = "Service"
	StatefulSetKind             = "StatefulSet"

	// GitlabComponentName is the com mon name of GitLab.
	GitLabComponentName = "gitlab"

	// GitLabShellComponentName is the common name of GitLab Shell.
	GitLabShellComponentName = "gitlab-shell"

	// MigrationsComponentName is the common name of Migrations.
	MigrationsComponentName = "migrations"

	// GitLabExporterComponentName is the common name of GitLab Exporter.
	GitLabExporterComponentName = "gitlab-exporter"

	// RegistryComponentName is the common name of the Registry.
	RegistryComponentName = "registry"

	// WebserviceComponentName is the common name of Webservice.
	WebserviceComponentName = "webservice"

	// SharedSecretsComponentName is the common name of Shared Secrets.
	SharedSecretsComponentName = "shared-secrets"

	// GitalyComponentName is the common name of Gitaly.
	GitalyComponentName = "gitaly"

	// SidekiqComponentName is the common name of Sidekiq.
	SidekiqComponentName = "sidekiq"

	// RedisComponentName is the common name of Redis.
	RedisComponentName = "redis"

	// PostgresComponentName is the common name of PostgreSQL.
	PostgresComponentName = "postgresql"

	// NGINXComponentName is the common name of NGINX Ingress.
	NGINXComponentName = "nginx-ingress"

	// NGINXDefaultBackendComponentName is the common name of NGINX DefaultBackend.
	NGINXDefaultBackendComponentName = "defaultbackend"

	// PagesComponentName is the common name of GitLab Pages.
	PagesComponentName = "gitlab-pages"

	// PraefectComponentName is the common name of Praefect.
	PraefectComponentName = "praefect"

	// MailroomComponentName is the common name of Mailroom.
	MailroomComponentName = "mailroom"

	// KasComponentName is the common name of KAS.
	KasComponentName = "kas"

	// ToolboxComponentName is the common name of Toolbox.
	ToolboxComponentName = "toolbox"

	// MinioComponentName is the common name of MinIO.
	MinioComponentName = "minio"
)
View Source
const (
	GlobalGitalyEnabled = "global.gitaly.enabled"
)
View Source
const (
	GlobalPraefectEnabled = "global.praefect.enabled"
)

Variables

This section is empty.

Functions

func CreateMockGitLab

func CreateMockGitLab(releaseName, namespace string, values support.Values) *gitlabv1beta1.GitLab

func ExporterConfigMaps

func ExporterConfigMaps(adapter CustomResourceAdapter, template helm.Template) []client.Object

ExporterConfigMaps returns the ConfigMaps for the GitLab Exporter component.

func ExporterDeployment

func ExporterDeployment(template helm.Template) client.Object

ExporterDeployment returns the Deployment for the GitLab Exporter component.

func ExporterEnabled

func ExporterEnabled(adapter CustomResourceAdapter) bool

ExporterEnabled returns `true` if enabled and `false` if not.

func ExporterService

func ExporterService(template helm.Template) client.Object

ExporterService returns the Service for the GitLab Exporter component.

func GetTemplate

func GetTemplate(adapter CustomResourceAdapter) (helm.Template, error)

GetTemplate ensures that only one instance of Helm template exists per deployment and it is rendered only when needed, e.g. it has changed.

func GitalyConfigMap

func GitalyConfigMap(template helm.Template) client.Object

GitalyConfigMap returns the ConfigMap of Gitaly component.

func GitalyEnabled

func GitalyEnabled(adapter CustomResourceAdapter) bool

GitalyEnabled returns `true` if enabled and `false` if not.

func GitalyPraefectConfigMap

func GitalyPraefectConfigMap(template helm.Template) client.Object

GitalyPraefectConfigMap returns the Gitaly ConfigMap of Praefect component.

func GitalyPraefectServices

func GitalyPraefectServices(template helm.Template) []client.Object

GitalyPraefectServices returns the Gitaly Services of Praefect component.

func GitalyPraefectStatefulSets

func GitalyPraefectStatefulSets(template helm.Template) []client.Object

GitalyPraefectStatefulSets returns the Gitaly StatefulSets of Praefect component.

func GitalyService

func GitalyService(template helm.Template) client.Object

GitalyService returns the Service of Gitaly component.

func GitalyStatefulSet

func GitalyStatefulSet(template helm.Template) client.Object

GitalyStatefulSet returns the StatefulSet of Gitaly component.

func KasConfigMap

func KasConfigMap(template helm.Template) client.Object

func KasDeployment

func KasDeployment(template helm.Template) client.Object

func KasEnabled

func KasEnabled(adapter CustomResourceAdapter) bool

KasEnabled returns `true` if KAS is enabled, and `false` if not. By default it returns `false`.

func KasIngress

func KasIngress(template helm.Template) client.Object

func KasService

func KasService(template helm.Template) client.Object

func MailroomConfigMap

func MailroomConfigMap(adapter CustomResourceAdapter, template helm.Template) client.Object

MailroomConfigMapsreturns the ConfigMaps for the Mailroom component.

func MailroomDeployment

func MailroomDeployment(template helm.Template) client.Object

MailroomDeployment returns the Deployment for the Mailroom component.

func MailroomEnabled

func MailroomEnabled(adapter CustomResourceAdapter) bool

MailroomEnabled returns `true` if enabled and `false` if not.

func MigrationsConfigMap

func MigrationsConfigMap(adapter CustomResourceAdapter, template helm.Template) client.Object

MigrationsConfigMap returns the ConfigMaps of Migrations component.

func MigrationsEnabled

func MigrationsEnabled(adapter CustomResourceAdapter) bool

MigrationsEnabled returns `true` if enabled and `false` if not.

func MigrationsJob

func MigrationsJob(adapter CustomResourceAdapter, template helm.Template) (client.Object, error)

MigrationsJob returns the Job for Migrations component.

func MinioConfigMap

func MinioConfigMap(adapter CustomResourceAdapter, template helm.Template) client.Object

MinioConfigMap returns the ConfigMap of the Minio component.

func MinioDeployment

func MinioDeployment(adapter CustomResourceAdapter, template helm.Template) client.Object

MinioDeployment returns the Deployment of the Minio component.

func MinioEnabled

func MinioEnabled(adapter CustomResourceAdapter) bool

MinioEnabled returns `true` if enabled, and `false` if not.

func MinioIngress

func MinioIngress(adapter CustomResourceAdapter, template helm.Template) client.Object

MinioIngress returns the Ingress of the Minio component.

func MinioJob

func MinioJob(adapter CustomResourceAdapter, template helm.Template) client.Object

MinioJob returns the Job of the Minio component.

func MinioPersistentVolumeClaim

func MinioPersistentVolumeClaim(adapter CustomResourceAdapter, template helm.Template) client.Object

MinioPersistentVolumeClaim returns the PersistentVolumeClaim of the Minio component.

func MinioService

func MinioService(adapter CustomResourceAdapter, template helm.Template) client.Object

MinioService returns the Service of the Minio component.

func NGINXAnnotations

func NGINXAnnotations() map[string]string

NGINXAnnotations returns the annotations for Ingress objects.

func NGINXConfigMaps

func NGINXConfigMaps(adapter CustomResourceAdapter, template helm.Template) []client.Object

NGINXConfigMaps returns the ConfigMaps of the NGINX component.

func NGINXDeployments

func NGINXDeployments(adapter CustomResourceAdapter, template helm.Template) []client.Object

NGINXDeployments returns the Deployments of the NGINX Component.

func NGINXEnabled

func NGINXEnabled(adapter CustomResourceAdapter) bool

NGINXEnabled returns `true` if NGINX is enabled and `false` if not.

func NGINXServices

func NGINXServices(adapter CustomResourceAdapter, template helm.Template) []client.Object

NGINXServices returns the Services of the NGINX Component.

func PagesConfigMap

func PagesConfigMap(adapter CustomResourceAdapter, template helm.Template) client.Object

PagesConfigMap returns the ConfigMap for the GitLab Pages component.

func PagesDeployment

func PagesDeployment(template helm.Template) client.Object

PagesDeployment returns the Deployment for the GitLab Pages component.

func PagesEnabled

func PagesEnabled(adapter CustomResourceAdapter) bool

PagesEnabled returns `true` if enabled and `false` if not.

func PagesIngress

func PagesIngress(template helm.Template) client.Object

PagesIngress returns the Ingress for the GitLab Pages component.

func PagesService

func PagesService(template helm.Template) client.Object

PagesService returns the Service for the GitLab Pages component.

func PostgresConfigMap

func PostgresConfigMap(adapter CustomResourceAdapter, template helm.Template) client.Object

PostgresConfigMap returns the ConfigMap of the PostgreSQL component.

func PostgresEnabled

func PostgresEnabled(adapter CustomResourceAdapter) bool

PostgresEnabled returns `true` if `PostgreSQL` is enabled, and `false` if not.

func PostgresServices

func PostgresServices(adapter CustomResourceAdapter, template helm.Template) []client.Object

PostgresServices returns the Services of the Postgres component.

func PostgresStatefulSet

func PostgresStatefulSet(adapter CustomResourceAdapter, template helm.Template) client.Object

PostgresStatefulSet returns the StatefulSet of the PostgreSQL component.

func PraefectConfigMap

func PraefectConfigMap(template helm.Template) client.Object

PraefectConfigMap returns the ConfigMap of Praefect component.

func PraefectEnabled

func PraefectEnabled(adapter CustomResourceAdapter) bool

PraefectEnabled returns `true` if enabled and `false` if not.

func PraefectReplaceInternalGitalyEnabled

func PraefectReplaceInternalGitalyEnabled(adapter CustomResourceAdapter) bool

PraefectReplaceInternalGitalyEnabled returns `true` if enabled and `false` if not.

func PraefectService

func PraefectService(template helm.Template) client.Object

PraefectService returns the Service of GitLab Praefect component.

func PraefectStatefulSet

func PraefectStatefulSet(template helm.Template) client.Object

PraefectStatefulSet returns the StatefulSet of Praefect component.

func RedisConfigMaps

func RedisConfigMaps(adapter CustomResourceAdapter, template helm.Template) []client.Object

RedisConfigMaps returns the ConfigMaps of the Redis component.

func RedisEnabled

func RedisEnabled(adapter CustomResourceAdapter) bool

RedisEnabled returns `true` if Redis is enabled, and `false` if not.

func RedisServices

func RedisServices(adapter CustomResourceAdapter, template helm.Template) []client.Object

RedisServices returns the Services of the Redis component.

func RedisStatefulSet

func RedisStatefulSet(template helm.Template) client.Object

RedisStatefulSet returns the Statefulset of the Redis component.

func RedisSubqueues

func RedisSubqueues() [5]string

RedisSubqueues is the array of possible Redis subqueues.

func RegistryConfigMap

func RegistryConfigMap(adapter CustomResourceAdapter, template helm.Template) client.Object

RegistryConfigMap returns the ConfigMap of the Registry component.

func RegistryDeployment

func RegistryDeployment(template helm.Template) client.Object

RegistryDeployment returns the Deployment of the Registry component.

func RegistryEnabled

func RegistryEnabled(adapter CustomResourceAdapter) bool

RegistryEnabled returns `true` if the registry is enabled, and `false` if not.

func RegistryIngress

func RegistryIngress(template helm.Template) client.Object

RegistryIngress returns the Ingress of the Registry component.

func RegistryService

func RegistryService(template helm.Template) client.Object

RegistryService returns the Service of the Registry component.

func SelfSignedCertsJob

func SelfSignedCertsJob(adapter CustomResourceAdapter, template helm.Template) (client.Object, error)

SelfSignedCertsJob returns the Job for Self Signed Certificates component.

func SharedSecretsConfigMap

func SharedSecretsConfigMap(adapter CustomResourceAdapter, template helm.Template) (client.Object, error)

SharedSecretsConfigMap returns the ConfigMaps of Shared Secret component.

func SharedSecretsJob

func SharedSecretsJob(adapter CustomResourceAdapter, template helm.Template) (client.Object, error)

SharedSecretsJob returns the Job for Shared Secret component.

func SharedSecretsResources

func SharedSecretsResources(adapter CustomResourceAdapter, template helm.Template) (client.Object, client.Object, error)

SharedSecretsResources returns Kubernetes resources for running shared secrets job.

func ShellConfigMaps

func ShellConfigMaps(adapter CustomResourceAdapter, template helm.Template) []client.Object

ShellConfigMaps returns the ConfigMaps of GitLab Shell component.

func ShellDeployment

func ShellDeployment(template helm.Template) client.Object

ShellDeployment returns the Deployment of GitLab Shell component.

func ShellEnabled

func ShellEnabled(adapter CustomResourceAdapter) bool

ShellEnabled returns `true` if enabled, and `false` if not.

func ShellService

func ShellService(template helm.Template) client.Object

ShellService returns the Service of GitLab Shell component.

func ShellSshDaemon

func ShellSshDaemon(adapter CustomResourceAdapter) string

ShellSshDaemon returns the SSH daemon of GitLab Shell component.

func SidekiqConfigMaps

func SidekiqConfigMaps(template helm.Template) []client.Object

SidekiqConfigMaps returns the ConfigMaps of the Sidekiq component.

func SidekiqDeployments

func SidekiqDeployments(template helm.Template) []client.Object

SidekiqDeployments returns the Deployments of the Sidekiq component.

func SidekiqEnabled

func SidekiqEnabled(adapter CustomResourceAdapter) bool

SidekiqEnabled returns `true` if Sidekiq is enabled, and `false` if not.

func ToolboxConfigMap

func ToolboxConfigMap(adapter CustomResourceAdapter, template helm.Template) client.Object

ToolboxConfigMap returns the ConfigMaps of the Toolbox component.

func ToolboxCronJob

func ToolboxCronJob(adapter CustomResourceAdapter, template helm.Template) client.Object

ToolboxCronJob returns the CronJob of the Toolbox component.

func ToolboxCronJobEnabled

func ToolboxCronJobEnabled(adapter CustomResourceAdapter) bool

ToolboxCronJobEnabled returns `true` if Toolbox CronJob is enabled, and `false` if not.

func ToolboxCronJobPersistenceEnabled

func ToolboxCronJobPersistenceEnabled(adapter CustomResourceAdapter) bool

ToolboxCronJobPersistenceEnabled returns `true` if Toolbox CronJob persistence is enabled, and `false` if not.

func ToolboxCronJobPersistentVolumeClaim

func ToolboxCronJobPersistentVolumeClaim(adapter CustomResourceAdapter, template helm.Template) client.Object

ToolboxPersistentVolumeClaim returns the PersistentVolumeClaim of the Toolbox component.

func ToolboxDeployment

func ToolboxDeployment(adapter CustomResourceAdapter, template helm.Template) client.Object

ToolboxDeployment returns the Deployment of the Toolbox component.

func ToolboxEnabled

func ToolboxEnabled(adapter CustomResourceAdapter) bool

ToolboxEnabled returns `true` if Toolbox is enabled, and `false` if not.

func WebserviceConfigMaps

func WebserviceConfigMaps(template helm.Template) []client.Object

WebserviceConfigMaps returns the ConfigMaps for the Webservice component.

func WebserviceDeployments

func WebserviceDeployments(template helm.Template) []client.Object

WebserviceDeployments returns the Deployments for the Webservice component.

func WebserviceEnabled

func WebserviceEnabled(adapter CustomResourceAdapter) bool

WebserviceEnabled returns `true` if Webservice is enabled, and `false` if not.

func WebserviceIngresses

func WebserviceIngresses(template helm.Template) []client.Object

WebserviceIngresses returns the Ingresses for the Webservice component.

func WebserviceServices

func WebserviceServices(template helm.Template) []client.Object

WebserviceServices returns the Services for the Webservice component.

Types

type CustomResourceAdapter

type CustomResourceAdapter interface {
	// Resource returns the reference to the underlaying Custom Resource.
	Resource() *gitlabv1beta1.GitLab

	// Hash generates a hash based on the key parts of a GitLab Custom Resource. The hash can be used
	// to identify changes to the underlaying resource. For example this is useful when rendering a
	// Helm template.
	Hash() string

	// Reference returns a fully qualified name of the associated GitLab Custom Resource. As opposed
	// to Hash this value does not change.
	Reference() string

	// Namespace returns the namespace in which the GitLab instance must be deployed. When Operator
	// is scoped to
	// a namespace this must be equal to the namespace of the Operator.
	Namespace() string

	// ReleaseName returns the name of the GitLab instance that must be deployed. This will be used
	// as a qualifier to distinguish between multiple GitLab instances in a namespace.
	ReleaseName() string

	// ChartVersion returns the version of GitLab chart that must be used to deploy this GitLab
	// instance.
	ChartVersion() string

	// StatusVersion returns the version of the GitLab chart that the GitLab
	// Custom Resource is actively running.
	StatusVersion() string

	// IsUpgrade returns `true` if StatusVersion is set and is not equal to
	// ChartVersion. Otherwise, it returns `false`.
	IsUpgrade() bool

	// Values returns the set of values that will be used the render GitLab chart.
	Values() support.Values

	// ResetValues re-initializes the values of the adapter with the values of
	// GitLab resource and Operator defaults.
	ResetValues(resource *gitlabv1beta1.GitLab)

	// UpdateValues coalesces all the values in the Chart with the current values.
	// This is to ensure that Chart default values are populated as well.
	UpdateValues(chart *chart.Chart) error
}

CustomResourceAdapter is a wrapper for GitLab Custom Resource. It provides a convenient interface to interact with the GitLab instances and guards the controller from its structural changes.

This adapter is immutable and will not update itself after initialization. Therefore, it must be created when GitLab Custom Resource changes, e.g. in reconcile loop.

func CreateMockAdapter

func CreateMockAdapter(mockGitLab *gitlabv1beta1.GitLab) CustomResourceAdapter

func NewCustomResourceAdapter

func NewCustomResourceAdapter(gitlab *gitlabv1beta1.GitLab) CustomResourceAdapter

NewCustomResourceAdapter returns a new adapter for the provided GitLab instance.

Jump to

Keyboard shortcuts

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