resources

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2021 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

func PrepareMattermostJobTemplate

func PrepareMattermostJobTemplate(name, namespace string, baseDeployment *appsv1.Deployment) *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) CreateIngressIfNotExists

func (r *ResourceHelper) CreateIngressIfNotExists(owner v1.Object, ingress *v1beta1.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 *mysqlOperator.MysqlCluster, reqLogger logr.Logger) error

func (*ResourceHelper) CreateOrUpdateMinioSecret

func (r *ResourceHelper) CreateOrUpdateMinioSecret(owner v1.Object, desired *corev1.Secret, logger 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) 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(
	jobNamespace string,
	baseDeployment *appsv1.Deployment,
) error

func (*ResourceHelper) RestartMattermostUpdateJob

func (r *ResourceHelper) RestartMattermostUpdateJob(
	currentJob *batchv1.Job,
	deployment *appsv1.Deployment,
) 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