resources

package
v1.21.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: May 23, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const UpdateJobName = "mattermost-update-check"

Variables

This section is empty.

Functions

func CopyServiceEmptyAutoAssignedFields added in v1.16.0

func CopyServiceEmptyAutoAssignedFields(desired, actual *corev1.Service)

CopyServiceEmptyAutoAssignedFields copies fields from an existing service that are populated automatically by Kubernetes when not provided to avoid issues with changing immutable fields.

func PrepareMattermostJobTemplate

func PrepareMattermostJobTemplate(name, namespace string, baseDeployment *appsv1.Deployment, updateJobSpec *mmv1beta.UpdateJob) *batchv1.Job

Types

type Object

type Object interface {
	runtime.Object
	v1.Object
}

Object combines the interfaces that all Kubernetes objects must implement.

type ResourceHelper

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

ResourceHelper provides helper methods to create, updated and fetch different resources.

func NewResourceHelper

func NewResourceHelper(client client.Client, scheme *runtime.Scheme) *ResourceHelper

func (*ResourceHelper) Create

func (r *ResourceHelper) Create(owner v1.Object, desired Object, reqLogger logr.Logger) error

Create creates the provided resource and sets the owner

func (*ResourceHelper) CreateDeploymentIfNotExists

func (r *ResourceHelper) CreateDeploymentIfNotExists(owner v1.Object, deployment *appsv1.Deployment, reqLogger logr.Logger) error

func (*ResourceHelper) CreateIngressClassIfNotExists added in v1.20.0

func (r *ResourceHelper) CreateIngressClassIfNotExists(owner v1.Object, ingressClass *networkingv1.IngressClass, reqLogger logr.Logger) error

func (*ResourceHelper) CreateIngressIfNotExists

func (r *ResourceHelper) CreateIngressIfNotExists(owner v1.Object, ingress *networkingv1.Ingress, reqLogger logr.Logger) error

func (*ResourceHelper) CreateMinioInstanceIfNotExists

func (r *ResourceHelper) CreateMinioInstanceIfNotExists(owner v1.Object, instance *minioOperator.MinIOInstance, logger logr.Logger) error

func (*ResourceHelper) CreateMySQLClusterIfNotExists

func (r *ResourceHelper) CreateMySQLClusterIfNotExists(owner v1.Object, cluster *mysqlv1alpha1.MysqlCluster, reqLogger logr.Logger) error

func (*ResourceHelper) CreateOrUpdateMinioSecret

func (r *ResourceHelper) CreateOrUpdateMinioSecret(owner v1.Object, desired *corev1.Secret, logger logr.Logger) error

func (*ResourceHelper) CreatePvcIfNotExists added in v1.20.0

func (r *ResourceHelper) CreatePvcIfNotExists(owner v1.Object, pvc *corev1.PersistentVolumeClaim, reqLogger logr.Logger) error

func (*ResourceHelper) CreateRoleBindingIfNotExists

func (r *ResourceHelper) CreateRoleBindingIfNotExists(owner v1.Object, roleBinding *rbacv1.RoleBinding, reqLogger logr.Logger) error

func (*ResourceHelper) CreateRoleIfNotExists

func (r *ResourceHelper) CreateRoleIfNotExists(owner v1.Object, role *rbacv1.Role, reqLogger logr.Logger) error

func (*ResourceHelper) CreateServiceAccountIfNotExists

func (r *ResourceHelper) CreateServiceAccountIfNotExists(owner v1.Object, serviceAccount *corev1.ServiceAccount, reqLogger logr.Logger) error

func (*ResourceHelper) CreateServiceIfNotExists

func (r *ResourceHelper) CreateServiceIfNotExists(owner v1.Object, service *corev1.Service, reqLogger logr.Logger) error

func (*ResourceHelper) DeleteIngress added in v1.16.0

func (r *ResourceHelper) DeleteIngress(key types.NamespacedName, reqLogger logr.Logger) error

func (*ResourceHelper) DeleteIngressClass added in v1.20.0

func (r *ResourceHelper) DeleteIngressClass(key types.NamespacedName, reqLogger logr.Logger) error

func (*ResourceHelper) DeleteService added in v1.19.0

func (r *ResourceHelper) DeleteService(key types.NamespacedName, reqLogger logr.Logger) error

func (*ResourceHelper) FetchMattermostUpdateJob

func (r *ResourceHelper) FetchMattermostUpdateJob(namespace string) (*batchv1.Job, error)

FetchMattermostUpdateJob gets update job

func (*ResourceHelper) GetMinioService

func (r *ResourceHelper) GetMinioService(mmName, mmNamespace string) (string, error)

func (*ResourceHelper) GetOrCreateMySQLSecrets

func (r *ResourceHelper) GetOrCreateMySQLSecrets(owner v1.Object, name string, reqLogger logr.Logger) (*corev1.Secret, error)

func (*ResourceHelper) LaunchMattermostUpdateJob

func (r *ResourceHelper) LaunchMattermostUpdateJob(
	owner metav1.Object,
	jobNamespace string,
	baseDeployment *appsv1.Deployment,
	reqLogger logr.Logger,
	updateJobSpec *mmv1beta.UpdateJob,
) error

func (*ResourceHelper) RestartMattermostUpdateJob

func (r *ResourceHelper) RestartMattermostUpdateJob(
	owner metav1.Object,
	currentJob *batchv1.Job,
	deployment *appsv1.Deployment,
	reqLogger logr.Logger,
	updateJobSpec *mmv1beta.UpdateJob,
) error

RestartMattermostUpdateJob removes existing update job if it exists and creates new one.

func (*ResourceHelper) Update

func (r *ResourceHelper) Update(current, desired Object, reqLogger logr.Logger) error

Jump to

Keyboard shortcuts

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