internal

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: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// GitlabType represents resource of type Gitlab.
	GitlabType = "gitlab"
)

Variables

This section is empty.

Functions

func AsDeployment

func AsDeployment(obj client.Object) (*appsv1.Deployment, error)

func AsIngress

func AsIngress(obj client.Object) (*networkingv1.Ingress, error)

func CertManagerEnabled

func CertManagerEnabled(adapter gitlab.CustomResourceAdapter) bool

CertManager returns `true` if CertManager is enabled, and `false` if not.

func CertificateIssuer

func CertificateIssuer(adapter gitlab.CustomResourceAdapter) *certmanagerv1.Issuer

CertificateIssuer create a certificate generator.

func ExporterServiceMonitor

func ExporterServiceMonitor(cr *gitlabv1beta1.GitLab) *monitoringv1.ServiceMonitor

ExporterServiceMonitor returns the GitLab exporter service monitor.

func ExposePrometheusCluster

func ExposePrometheusCluster(cr *gitlabv1beta1.GitLab) *corev1.Service

ExposePrometheusCluster creates a service for Prometheus.

func GetIssuerConfig

func GetIssuerConfig(adapter gitlab.CustomResourceAdapter) certmanagerv1.IssuerConfig

GetIssuerConfig gets the ACME issuer to use from GitLab resource.

func GetPodTemplateSpec

func GetPodTemplateSpec(obj client.Object) (*corev1.PodTemplateSpec, error)

func GitalyServiceMonitor

func GitalyServiceMonitor(cr *gitlabv1beta1.GitLab) *monitoringv1.ServiceMonitor

GitalyServiceMonitor returns the Gitaly service monitor.

func IsOpenshift

func IsOpenshift() bool

IsOpenshift check if API has the API route.openshift.io/v1, then it is considered an openshift environment.

func Label

func Label(resource, component, resourceType string) map[string]string

Label function returns uniform labels for resources.

func PopulateAttachedSecrets

func PopulateAttachedSecrets(template v1.PodTemplateSpec) map[string]map[string]struct{}

PopulateAttachedSecrets populates all the Secrets that are attached to a ReplicaSet. nolint:nestif,gocognit // This function is a bit complicated, but breaking it up may not increase legibility.

func PostgresqlServiceMonitor

func PostgresqlServiceMonitor(cr *gitlabv1beta1.GitLab) *monitoringv1.ServiceMonitor

PostgresqlServiceMonitor returns the Postgres service monitor.

func PrometheusCluster

func PrometheusCluster(cr *gitlabv1beta1.GitLab) *monitoringv1.Prometheus

PrometheusCluster returns a prometheus cluster object.

func PrometheusClusterEnabled

func PrometheusClusterEnabled(adapter gitlab.CustomResourceAdapter) bool

PrometheusEnabled returns `true` if Prometheus is enabled, and `false` if not.

func RedisServiceMonitor

func RedisServiceMonitor(cr *gitlabv1beta1.GitLab) *monitoringv1.ServiceMonitor

RedisServiceMonitor returns the Redis service monitor.

func SecretChecksum

func SecretChecksum(secret v1.Secret, keys map[string]struct{}) string

SecretChecksum returns a checksum for a given Secret.

func ServiceAccount

func ServiceAccount(name, namespace string) *corev1.ServiceAccount

ServiceAccount returns service account to be used by pods.

func ToggleDeploymentPause

func ToggleDeploymentPause(obj client.Object, pause bool) error

func WebserviceServiceMonitor

func WebserviceServiceMonitor(cr *gitlabv1beta1.GitLab) *monitoringv1.ServiceMonitor

WebserviceServiceMonitor returns the Webservice service monitor.

Types

type EndpointTLS

type EndpointTLS struct {
	// contains filtered or unexported fields
}

EndpointTLS informs which services require to be secured using generated TLS certificates.

func RequiresCertManagerCertificate

func RequiresCertManagerCertificate(adapter gitlab.CustomResourceAdapter) EndpointTLS

RequiresCertManagerCertificate function returns true an administrator did not provide a TLS ceritificate for an endpoint.

func (EndpointTLS) Any

func (ep EndpointTLS) Any() bool

Any returns true if any ingress requires a cert-manager certificate.

func (EndpointTLS) GitLab

func (ep EndpointTLS) GitLab() bool

GitLab returns true if GitLab endpoint requires a cert-manager provisioned certificate.

func (EndpointTLS) Minio

func (ep EndpointTLS) Minio() bool

Minio returns true if Minio endpoint requires a cert-manager provisioned certificate.

func (EndpointTLS) Registry

func (ep EndpointTLS) Registry() bool

Registry returns true if Registry endpoint requires a cert-manager provisioned certificate.

type KubeConfig

type KubeConfig struct {
	Config *rest.Config
	Error  error
}

KubeConfig returns kubernetes client configuration.

func KubernetesConfig

func KubernetesConfig() KubeConfig

KubernetesConfig returns kubernetes client config.

func (KubeConfig) NewKubernetesClient

func (k KubeConfig) NewKubernetesClient() (*kubernetes.Clientset, error)

NewKubernetesClient returns a client that can be used to interact with the kubernetes api.

Jump to

Keyboard shortcuts

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