Documentation ¶
Index ¶
- Constants
- func CreateMockGitLab(releaseName, namespace string, values support.Values) *gitlabv1beta1.GitLab
- func ExporterConfigMaps(adapter CustomResourceAdapter, template helm.Template) []client.Object
- func ExporterDeployment(template helm.Template) client.Object
- func ExporterEnabled(adapter CustomResourceAdapter) bool
- func ExporterService(template helm.Template) client.Object
- func GetTemplate(adapter CustomResourceAdapter) (helm.Template, error)
- func GitalyConfigMap(template helm.Template) client.Object
- func GitalyEnabled(adapter CustomResourceAdapter) bool
- func GitalyPraefectConfigMap(template helm.Template) client.Object
- func GitalyPraefectServices(template helm.Template) []client.Object
- func GitalyPraefectStatefulSets(template helm.Template) []client.Object
- func GitalyService(template helm.Template) client.Object
- func GitalyStatefulSet(template helm.Template) client.Object
- func KasConfigMap(template helm.Template) client.Object
- func KasDeployment(template helm.Template) client.Object
- func KasEnabled(adapter CustomResourceAdapter) bool
- func KasIngress(template helm.Template) client.Object
- func KasService(template helm.Template) client.Object
- func MailroomConfigMap(adapter CustomResourceAdapter, template helm.Template) client.Object
- func MailroomDeployment(template helm.Template) client.Object
- func MailroomEnabled(adapter CustomResourceAdapter) bool
- func MigrationsConfigMap(adapter CustomResourceAdapter, template helm.Template) client.Object
- func MigrationsEnabled(adapter CustomResourceAdapter) bool
- func MigrationsJob(adapter CustomResourceAdapter, template helm.Template) (client.Object, error)
- func MinioConfigMap(adapter CustomResourceAdapter, template helm.Template) client.Object
- func MinioDeployment(adapter CustomResourceAdapter, template helm.Template) client.Object
- func MinioEnabled(adapter CustomResourceAdapter) bool
- func MinioIngress(adapter CustomResourceAdapter, template helm.Template) client.Object
- func MinioJob(adapter CustomResourceAdapter, template helm.Template) client.Object
- func MinioPersistentVolumeClaim(adapter CustomResourceAdapter, template helm.Template) client.Object
- func MinioService(adapter CustomResourceAdapter, template helm.Template) client.Object
- func NGINXAnnotations() map[string]string
- func NGINXConfigMaps(adapter CustomResourceAdapter, template helm.Template) []client.Object
- func NGINXDeployments(adapter CustomResourceAdapter, template helm.Template) []client.Object
- func NGINXEnabled(adapter CustomResourceAdapter) bool
- func NGINXServices(adapter CustomResourceAdapter, template helm.Template) []client.Object
- func PagesConfigMap(adapter CustomResourceAdapter, template helm.Template) client.Object
- func PagesDeployment(template helm.Template) client.Object
- func PagesEnabled(adapter CustomResourceAdapter) bool
- func PagesIngress(template helm.Template) client.Object
- func PagesService(template helm.Template) client.Object
- func PostgresConfigMap(adapter CustomResourceAdapter, template helm.Template) client.Object
- func PostgresEnabled(adapter CustomResourceAdapter) bool
- func PostgresServices(adapter CustomResourceAdapter, template helm.Template) []client.Object
- func PostgresStatefulSet(adapter CustomResourceAdapter, template helm.Template) client.Object
- func PraefectConfigMap(template helm.Template) client.Object
- func PraefectEnabled(adapter CustomResourceAdapter) bool
- func PraefectReplaceInternalGitalyEnabled(adapter CustomResourceAdapter) bool
- func PraefectService(template helm.Template) client.Object
- func PraefectStatefulSet(template helm.Template) client.Object
- func RedisConfigMaps(adapter CustomResourceAdapter, template helm.Template) []client.Object
- func RedisEnabled(adapter CustomResourceAdapter) bool
- func RedisServices(adapter CustomResourceAdapter, template helm.Template) []client.Object
- func RedisStatefulSet(template helm.Template) client.Object
- func RedisSubqueues() [5]string
- func RegistryConfigMap(adapter CustomResourceAdapter, template helm.Template) client.Object
- func RegistryDeployment(template helm.Template) client.Object
- func RegistryEnabled(adapter CustomResourceAdapter) bool
- func RegistryIngress(template helm.Template) client.Object
- func RegistryService(template helm.Template) client.Object
- func SelfSignedCertsJob(adapter CustomResourceAdapter, template helm.Template) (client.Object, error)
- func SharedSecretsConfigMap(adapter CustomResourceAdapter, template helm.Template) (client.Object, error)
- func SharedSecretsJob(adapter CustomResourceAdapter, template helm.Template) (client.Object, error)
- func SharedSecretsResources(adapter CustomResourceAdapter, template helm.Template) (client.Object, client.Object, error)
- func ShellConfigMaps(adapter CustomResourceAdapter, template helm.Template) []client.Object
- func ShellDeployment(template helm.Template) client.Object
- func ShellEnabled(adapter CustomResourceAdapter) bool
- func ShellService(template helm.Template) client.Object
- func ShellSshDaemon(adapter CustomResourceAdapter) string
- func SidekiqConfigMaps(template helm.Template) []client.Object
- func SidekiqDeployments(template helm.Template) []client.Object
- func SidekiqEnabled(adapter CustomResourceAdapter) bool
- func ToolboxConfigMap(adapter CustomResourceAdapter, template helm.Template) client.Object
- func ToolboxCronJob(adapter CustomResourceAdapter, template helm.Template) client.Object
- func ToolboxCronJobEnabled(adapter CustomResourceAdapter) bool
- func ToolboxCronJobPersistenceEnabled(adapter CustomResourceAdapter) bool
- func ToolboxCronJobPersistentVolumeClaim(adapter CustomResourceAdapter, template helm.Template) client.Object
- func ToolboxDeployment(adapter CustomResourceAdapter, template helm.Template) client.Object
- func ToolboxEnabled(adapter CustomResourceAdapter) bool
- func WebserviceConfigMaps(template helm.Template) []client.Object
- func WebserviceDeployments(template helm.Template) []client.Object
- func WebserviceEnabled(adapter CustomResourceAdapter) bool
- func WebserviceIngresses(template helm.Template) []client.Object
- func WebserviceServices(template helm.Template) []client.Object
- type CustomResourceAdapter
Constants ¶
const ( GlobalPraefectVirtualStorages = "global.praefect.virtualStorages" GlobalPraefectReplaceInternalGitalyEnabled = "global.praefect.replaceInternalGitaly" )
const ( GitLabMailroomEnabled = "gitlab.mailroom.enabled" IncomingEmailEnabled = "global.appConfig.incomingEmail.enabled" IncomingEmailSecret = "global.appConfig.incomingEmail.password.secret" //nolint:golint,gosec )
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 = "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" )
const (
GlobalGitalyEnabled = "global.gitaly.enabled"
)
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 ¶
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 ¶
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 ¶
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 ¶
GitalyPraefectConfigMap returns the Gitaly ConfigMap of Praefect component.
func GitalyPraefectServices ¶
GitalyPraefectServices returns the Gitaly Services of Praefect component.
func GitalyPraefectStatefulSets ¶
GitalyPraefectStatefulSets returns the Gitaly StatefulSets of Praefect component.
func GitalyService ¶
GitalyService returns the Service of Gitaly component.
func GitalyStatefulSet ¶
GitalyStatefulSet returns the StatefulSet of Gitaly component.
func KasEnabled ¶
func KasEnabled(adapter CustomResourceAdapter) bool
KasEnabled returns `true` if KAS is enabled, and `false` if not. By default it returns `false`.
func MailroomConfigMap ¶
func MailroomConfigMap(adapter CustomResourceAdapter, template helm.Template) client.Object
MailroomConfigMapsreturns the ConfigMaps for the Mailroom component.
func MailroomDeployment ¶
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 ¶
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 ¶
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 ¶
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 ¶
PagesIngress returns the Ingress for the GitLab Pages component.
func PagesService ¶
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 ¶
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 ¶
PraefectService returns the Service of GitLab Praefect component.
func PraefectStatefulSet ¶
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 ¶
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 ¶
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 ¶
RegistryIngress returns the Ingress of the Registry component.
func RegistryService ¶
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 ¶
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 ¶
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 ¶
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 ¶
SidekiqConfigMaps returns the ConfigMaps of the Sidekiq component.
func SidekiqDeployments ¶
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 ¶
WebserviceConfigMaps returns the ConfigMaps for the Webservice component.
func WebserviceDeployments ¶
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 ¶
WebserviceIngresses returns the Ingresses 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.