controller

package
v0.0.0-...-d0fe179 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DbUsernameName = "USERNAME"
	DbPasswordName = "PASSWORD"
)
View Source
const (
	DefaultLog4jProperties = `` /* 3086-byte string literal not displayed */

	HiveMetastoreLog4jName = "hive-log4j2.properties"
)
View Source
const (
	S3AccessKeyName = "ACCESS_KEY"
	S3SecretKeyName = "SECRET_KEY"
)
View Source
const HiveSiteName = "hive-site.xml"

Variables

This section is empty.

Functions

func CreateOrUpdate

func CreateOrUpdate(ctx context.Context, c client.Client, obj client.Object) (bool, error)

func HiveDataPVCName

func HiveDataPVCName(cr *hivev1alpha1.HiveMetastore, roleGroupName string) string

func HiveEnvSecretName

func HiveEnvSecretName(cr *hivev1alpha1.HiveMetastore) string

func HiveSiteSecretName

func HiveSiteSecretName(cr *hivev1alpha1.HiveMetastore, roleGroupName string) string

func MergeObjects

func MergeObjects(left interface{}, right interface{}, exclude []string)

MergeObjects merge right to left, if field not in left, it will be added from right, else skip. Node: If variable is a pointer, it will be modified directly.

func MetastoreLog4jConfigMapName

func MetastoreLog4jConfigMapName(cr *hivev1alpha1.HiveMetastore, roleGroupName string) string

Types

type BaseRoleGroupResourceReconciler

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

func (*BaseRoleGroupResourceReconciler) GetLabels

func (r *BaseRoleGroupResourceReconciler) GetLabels() map[string]string

func (*BaseRoleGroupResourceReconciler) GetNameWithSuffix

func (r *BaseRoleGroupResourceReconciler) GetNameWithSuffix(name string) string

func (*BaseRoleGroupResourceReconciler) Name

type ClusterReconciler

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

func NewClusterReconciler

func NewClusterReconciler(client client.Client, scheme *runtime.Scheme, cr *hivev1alpha1.HiveMetastore) *ClusterReconciler

func (*ClusterReconciler) Reconcile

func (r *ClusterReconciler) Reconcile(ctx context.Context) (ctrl.Result, error)

func (*ClusterReconciler) ReconcileMetastore

func (r *ClusterReconciler) ReconcileMetastore(ctx context.Context) (ctrl.Result, error)

type DatabaseConfiguration

type DatabaseConfiguration struct {
	ResourceClient ResourceClient
	// contains filtered or unexported fields
}

func NewDatabaseConfiguration

func NewDatabaseConfiguration(cr *hivev1alpha1.HiveMetastore, resourceClient ResourceClient) *DatabaseConfiguration

func (*DatabaseConfiguration) Enabled

func (d *DatabaseConfiguration) Enabled() bool

func (*DatabaseConfiguration) ExistingDatabase

func (d *DatabaseConfiguration) ExistingDatabase() bool

func (*DatabaseConfiguration) GetCredential

func (d *DatabaseConfiguration) GetCredential(name string) (*DatabaseCredential, error)

func (*DatabaseConfiguration) GetRefDatabase

func (d *DatabaseConfiguration) GetRefDatabase() (commonsv1alph1.Database, error)

func (*DatabaseConfiguration) GetRefDatabaseConnection

func (d *DatabaseConfiguration) GetRefDatabaseConnection(name string) (commonsv1alph1.DatabaseConnection, error)

func (*DatabaseConfiguration) GetRefDatabaseName

func (d *DatabaseConfiguration) GetRefDatabaseName() string

type DatabaseCredential

type DatabaseCredential struct {
	Username string `json:"USERNAME"`
	Password string `json:"PASSWORD"`
}

type DatabaseParams

type DatabaseParams struct {
	Driver   string
	Username string
	Password string
	Host     string
	Port     string
	DbName   string
}

type DeploymentReconciler

type DeploymentReconciler struct {
	*BaseRoleGroupResourceReconciler
}

func NewReconcileDeployment

func NewReconcileDeployment(
	client client.Client,
	schema *runtime.Scheme,
	cr *hivev1alpha1.HiveMetastore,
	roleName string,
	roleGroupName string,
	roleGroup *hivev1alpha1.RoleGroupSpec,
	stop bool,
) *DeploymentReconciler

func (*DeploymentReconciler) CheckPodsSatisfied

func (r *DeploymentReconciler) CheckPodsSatisfied(ctx context.Context) (bool, error)

func (*DeploymentReconciler) EnabledDataPVC

func (r *DeploymentReconciler) EnabledDataPVC() bool

func (*DeploymentReconciler) EnabledEnvSecret

func (r *DeploymentReconciler) EnabledEnvSecret() bool

func (*DeploymentReconciler) EnabledLogging

func (r *DeploymentReconciler) EnabledLogging() bool

func (*DeploymentReconciler) Image

func (*DeploymentReconciler) NameSpace

func (r *DeploymentReconciler) NameSpace() string

func (*DeploymentReconciler) Reconcile

func (r *DeploymentReconciler) Reconcile(ctx context.Context) (ctrl.Result, error)

func (*DeploymentReconciler) RoleGroupConfig

func (r *DeploymentReconciler) RoleGroupConfig() *hivev1alpha1.ConfigSpec

type EnvSecret

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

func NewEnvSecret

func NewEnvSecret(ctx context.Context, client client.Client, scheme *runtime.Scheme, cr *hivev1alpha1.HiveMetastore) *EnvSecret

func (*EnvSecret) Labels

func (r *EnvSecret) Labels() map[string]string

func (*EnvSecret) NameSpace

func (r *EnvSecret) NameSpace() string

func (*EnvSecret) Reconcile

func (r *EnvSecret) Reconcile(ctx context.Context) (ctrl.Result, error)

type HiveMetastoreReconciler

type HiveMetastoreReconciler struct {
	client.Client
	Scheme *runtime.Scheme
}

HiveMetastoreReconciler reconciles a HiveMetastore object

func (*HiveMetastoreReconciler) Reconcile

func (r *HiveMetastoreReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*HiveMetastoreReconciler) ReconciliationPaused

func (r *HiveMetastoreReconciler) ReconciliationPaused(ctx context.Context, instance *hivev1alpha1.HiveMetastore) bool

func (*HiveMetastoreReconciler) SetupWithManager

func (r *HiveMetastoreReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type HiveSiteSecret

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

func NewHiveSiteSecret

func NewHiveSiteSecret(
	ctx context.Context,
	client client.Client,
	scheme *runtime.Scheme,
	cr *hivev1alpha1.HiveMetastore,
	roleGroupName string,
	roleGroup *hivev1alpha1.RoleGroupSpec,
) *HiveSiteSecret

func (*HiveSiteSecret) Labels

func (r *HiveSiteSecret) Labels() map[string]string

func (*HiveSiteSecret) NameSpace

func (r *HiveSiteSecret) NameSpace() string

func (*HiveSiteSecret) Reconcile

func (r *HiveSiteSecret) Reconcile(ctx context.Context) (ctrl.Result, error)

type MetastoreLoggingRecociler

type MetastoreLoggingRecociler struct {
	BaseRoleGroupResourceReconciler
}

func NewLog4jConfigMapRecociler

func NewLog4jConfigMapRecociler(
	client client.Client,
	scheme *runtime.Scheme,
	cr *hivev1alpha1.HiveMetastore,
	roleName string,
	roleGroupName string,
	roleGroup *hivev1alpha1.RoleGroupSpec,
) *MetastoreLoggingRecociler

func (*MetastoreLoggingRecociler) Enable

func (r *MetastoreLoggingRecociler) Enable() bool

func (*MetastoreLoggingRecociler) Name

func (*MetastoreLoggingRecociler) Reconcile

type MetastoreRole

type MetastoreRole struct {
	Role *hivev1alpha1.RoleSpec
	// contains filtered or unexported fields
}

func NewMetastoreRole

func NewMetastoreRole(
	client client.Client,
	scheme *runtime.Scheme,
	cr *hivev1alpha1.HiveMetastore,
	role *hivev1alpha1.RoleSpec,
) *MetastoreRole

func (*MetastoreRole) EnabledClusterConfig

func (r *MetastoreRole) EnabledClusterConfig() bool

func (*MetastoreRole) GetLabels

func (r *MetastoreRole) GetLabels() map[string]string

func (*MetastoreRole) MergeFromRole

func (r *MetastoreRole) MergeFromRole(roleGroup *hivev1alpha1.RoleGroupSpec) *hivev1alpha1.RoleGroupSpec

func (*MetastoreRole) Name

func (r *MetastoreRole) Name() string

func (*MetastoreRole) Reconcile

func (r *MetastoreRole) Reconcile(ctx context.Context) (ctrl.Result, error)

type PDBReconciler

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

func NewReconcilePDB

func NewReconcilePDB(
	client client.Client,
	schema *runtime.Scheme,
	cr *hivev1alpha1.HiveMetastore,

	name string,
	labels map[string]string,
	pdb *hivev1alpha1.PodDisruptionBudgetSpec,
) *PDBReconciler

func (*PDBReconciler) Reconcile

func (r *PDBReconciler) Reconcile(ctx context.Context) (ctrl.Result, error)

type PVCReconciler

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

func NewPVCReconciler

func NewPVCReconciler(
	client client.Client,
	scheme *runtime.Scheme,
	cr *hivev1alpha1.HiveMetastore,
	roleGroupName string,
	roleGroup *hivev1alpha1.RoleGroupSpec,
) *PVCReconciler

func (*PVCReconciler) Enabled

func (r *PVCReconciler) Enabled() bool

func (*PVCReconciler) Labels

func (r *PVCReconciler) Labels() map[string]string

func (*PVCReconciler) NameSpace

func (r *PVCReconciler) NameSpace() string

func (*PVCReconciler) Reconcile

func (r *PVCReconciler) Reconcile(ctx context.Context) (ctrl.Result, error)

type ResourceClient

type ResourceClient struct {
	Ctx       context.Context
	Client    client.Client
	Namespace string
	Log       logr.Logger
}

func (*ResourceClient) Get

func (r *ResourceClient) Get(obj client.Object) error

type RoleGroupPDBReconciler

type RoleGroupPDBReconciler struct {
	PDBReconciler
	BaseRoleGroupResourceReconciler
}

func NewReconcileRoleGroupPDB

func NewReconcileRoleGroupPDB(
	client client.Client,
	schema *runtime.Scheme,
	cr *hivev1alpha1.HiveMetastore,

	roleName string,
	roleGroupName string,
	roleGroup *hivev1alpha1.RoleGroupSpec,
) *RoleGroupPDBReconciler

type RoleLabels

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

func (*RoleLabels) GetLabels

func (r *RoleLabels) GetLabels() map[string]string

type S3Configuration

type S3Configuration struct {
	ResourceClient ResourceClient
	// contains filtered or unexported fields
}

func NewS3Configuration

func NewS3Configuration(cr *hivev1alpha1.HiveMetastore, resourceClient ResourceClient) *S3Configuration

func (*S3Configuration) Enabled

func (s *S3Configuration) Enabled() bool

func (*S3Configuration) ExistingS3Bucket

func (s *S3Configuration) ExistingS3Bucket() bool

func (*S3Configuration) GetCredential

func (s *S3Configuration) GetCredential(name string) (*S3Credential, error)

func (*S3Configuration) GetRefBucket

func (s *S3Configuration) GetRefBucket() (*commonsv1alpha1.S3Bucket, error)

func (*S3Configuration) GetRefBucketName

func (s *S3Configuration) GetRefBucketName() string

func (*S3Configuration) GetRefConnection

func (s *S3Configuration) GetRefConnection(name string) (*commonsv1alpha1.S3Connection, error)

func (*S3Configuration) GetS3ParamsFromInline

func (s *S3Configuration) GetS3ParamsFromInline() (*S3Params, error)

func (*S3Configuration) GetS3ParamsFromResource

func (s *S3Configuration) GetS3ParamsFromResource() (*S3Params, error)

type S3Credential

type S3Credential struct {
	AccessKey string `json:"ACCESS_KEY"`
	SecretKey string `json:"SECRET_KEY"`
}

type S3Params

type S3Params struct {
	AccessKey string
	SecretKey string
	Endpoint  string
	Bucket    string
	Region    string
	SSL       bool
	PathStyle bool
}

type SecretReconciler

type SecretReconciler interface {
	Reconcile(ctx context.Context) (ctrl.Result, error)

	Name() string
	Labels() map[string]string
	NameSpace() string
	// contains filtered or unexported methods
}

type ServiceReconciler

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

func NewReconcileService

func NewReconcileService(
	client client.Client,
	schema *runtime.Scheme,
	cr *hivev1alpha1.HiveMetastore,
	roleGroup *hivev1alpha1.RoleGroupSpec,
	roleGroupName string,
) *ServiceReconciler

func (*ServiceReconciler) Labels

func (r *ServiceReconciler) Labels() map[string]string

func (*ServiceReconciler) Name

func (r *ServiceReconciler) Name() string

func (*ServiceReconciler) NameSpace

func (r *ServiceReconciler) NameSpace() string

func (*ServiceReconciler) Reconcile

func (r *ServiceReconciler) Reconcile(ctx context.Context) (ctrl.Result, error)

Jump to

Keyboard shortcuts

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