Documentation ¶
Index ¶
- Constants
- func ConvertToResourceRequirements(resources *trinov1alpha1.ResourcesSpec) *corev1.ResourceRequirements
- func CreateCatalogConfigmapName(instanceName string) string
- func CreateRoleGroupLoggingConfigMapName(instanceName string, role string, groupName string) string
- func CreateSchemaConfigmapName(instanceName string) string
- func CreateServiceName(instanceName string, roleName string, groupName string) string
- func GetExchangeManagerSpec(cfg *trinov1alpha1.RoleGroupSpec) *trinov1alpha1.ExchangeManagerSpec
- func MergeObjects(left interface{}, right interface{}, exclude []string)
- func OverrideEnvVars(origin *[]corev1.EnvVar, override map[string]string)
- func ReconcilerDoHandler(ctx context.Context, reconcilers []ResourceReconciler) (ctrl.Result, error)
- type BaseResourceReconciler
- type BaseRoleGroupReconciler
- type BaseRoleReconciler
- type ConditionsGetter
- type ConfigurationOverride
- type ConfigurationStyleReconciler
- type GeneralResourceStyleReconciler
- type InstanceAttributes
- type LoggingRecociler
- type MultiConfigurationStyleReconciler
- type MultiResourceReconcilerBuilder
- type PDBReconciler
- type ResourceBuilder
- type ResourceBuilderType
- type ResourceClient
- type ResourceHandler
- type ResourceNameGenerator
- type ResourceReconciler
- type Role
- type RoleConfigSpec
- type RoleGroupRecociler
- type RoleLabels
- type RoleLoggingDataBuilder
- type RoleReconciler
- type WorkloadOverride
- type WorkloadStyleReconciler
Constants ¶
const LogCfgName = "log.properties"
Variables ¶
This section is empty.
Functions ¶
func ConvertToResourceRequirements ¶
func ConvertToResourceRequirements(resources *trinov1alpha1.ResourcesSpec) *corev1.ResourceRequirements
func CreateRoleGroupLoggingConfigMapName ¶
CreateRoleGroupLoggingConfigMapName create role group logging config-map name
func CreateServiceName ¶
func GetExchangeManagerSpec ¶
func GetExchangeManagerSpec(cfg *trinov1alpha1.RoleGroupSpec) *trinov1alpha1.ExchangeManagerSpec
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 ReconcilerDoHandler ¶
Types ¶
type BaseResourceReconciler ¶
type BaseResourceReconciler[T client.Object, G any] struct { Instance T Scheme *runtime.Scheme Client client.Client GroupName string MergedLabels map[string]string MergedCfg G }
func NewBaseResourceReconciler ¶
func NewBaseResourceReconciler[T client.Object, G any]( scheme *runtime.Scheme, instance T, client client.Client, groupName string, mergedLabels map[string]string, mergedCfg G) *BaseResourceReconciler[T, G]
NewBaseResourceReconciler new a BaseResourceReconciler
func (*BaseResourceReconciler[T, G]) ReconcileResource ¶
func (b *BaseResourceReconciler[T, G]) ReconcileResource( ctx context.Context, builder ResourceBuilderType) (ctrl.Result, error)
type BaseRoleGroupReconciler ¶
type BaseRoleGroupReconciler[T client.Object] struct { Scheme *runtime.Scheme Instance T Client client.Client GroupName string RoleLabels map[string]string Log logr.Logger Reconcilers []ResourceReconciler }
func (*BaseRoleGroupReconciler[T]) ReconcileGroup ¶
ReconcileGroup ReconcileRole implements the Role interface
type BaseRoleReconciler ¶
type BaseRoleReconciler[T client.Object] struct { Scheme *runtime.Scheme Instance T Client client.Client Log logr.Logger Labels map[string]string Role Role }
func (*BaseRoleReconciler[T]) GetLabels ¶
func (r *BaseRoleReconciler[T]) GetLabels() map[string]string
type ConditionsGetter ¶
type ConfigurationOverride ¶
type ConfigurationStyleReconciler ¶
type ConfigurationStyleReconciler[T client.Object, G any] struct { GeneralResourceStyleReconciler[T, G] }
ConfigurationStyleReconciler configuration style reconciler this reconciler is used to reconcile the configuration style resources such as configMap, secret, etc. it will do the following things: 1. apply the resource Additional: 1. configuration override support
func (*ConfigurationStyleReconciler[T, G]) DoReconcile ¶
func (s *ConfigurationStyleReconciler[T, G]) DoReconcile( ctx context.Context, resource client.Object, instance ResourceHandler, ) (ctrl.Result, error)
type GeneralResourceStyleReconciler ¶
type GeneralResourceStyleReconciler[T client.Object, G any] struct { BaseResourceReconciler[T, G] }
GeneralResourceStyleReconciler general style resource reconcile this reconciler is used to reconcile the general style resources such as configMap, secret, svc, etc.
func (*GeneralResourceStyleReconciler[T, G]) DoReconcile ¶
func (s *GeneralResourceStyleReconciler[T, G]) DoReconcile( ctx context.Context, resource client.Object, _ ResourceHandler, ) (ctrl.Result, error)
type InstanceAttributes ¶
type InstanceAttributes interface { RoleConfigSpec GetClusterConfig() any }
type LoggingRecociler ¶
type LoggingRecociler struct { GeneralResourceStyleReconciler[*trinov1alpha1.TrinoCluster, any] RoleLoggingDataBuilder RoleLoggingDataBuilder // contains filtered or unexported fields }
func NewLoggingReconciler ¶
func NewLoggingReconciler( scheme *runtime.Scheme, instance *trinov1alpha1.TrinoCluster, client client.Client, groupName string, mergedLabels map[string]string, mergedCfg any, logDataBuilder RoleLoggingDataBuilder, role Role, ) *LoggingRecociler
NewLoggingReconciler new logging reconcile
type MultiConfigurationStyleReconciler ¶
type MultiConfigurationStyleReconciler[T client.Object, G any] struct { BaseResourceReconciler[T, G] }
MultiConfigurationStyleReconciler multi configuration object reconciler
func NewMultiConfigurationStyleReconciler ¶
func NewMultiConfigurationStyleReconciler[T client.Object, G any]( scheme *runtime.Scheme, instance T, client client.Client, groupName string, mergedLabels map[string]string, mergedCfg G, ) *MultiConfigurationStyleReconciler[T, G]
NewMultiConfigurationStyleReconciler newMultiConfigurationStyleReconciler new a MultiConfigurationStyleReconciler
func (*MultiConfigurationStyleReconciler[T, G]) ReconcileResource ¶
func (s *MultiConfigurationStyleReconciler[T, G]) ReconcileResource( ctx context.Context, builder ResourceBuilderType) (ctrl.Result, error)
ReconcileResource implement ResourceReconcile interface
type MultiResourceReconcilerBuilder ¶
type MultiResourceReconcilerBuilder interface {
Build(ctx context.Context) ([]ResourceBuilder, error)
}
MultiResourceReconcilerBuilder multi resource builder it will build multi resources for example, it will build more than one configMap currently, it is used to build the configMap see MultiConfigurationStyleReconciler
type PDBReconciler ¶
type PDBReconciler[T client.Object] struct { GeneralResourceStyleReconciler[T, any] // contains filtered or unexported fields }
func NewReconcilePDB ¶
func NewReconcilePDB[T client.Object]( client client.Client, schema *runtime.Scheme, cr T, labels map[string]string, name string, pdb *trinov1alpha1.PodDisruptionBudgetSpec, ) *PDBReconciler[T]
type ResourceBuilder ¶
type ResourceBuilderType ¶
type ResourceBuilderType struct { Single ResourceBuilder Multi MultiResourceReconcilerBuilder }
ResourceBuilderType union type for resource builder it will build the single resource or multi resources
func NewMultiResourceBuilder ¶
func NewMultiResourceBuilder(builder MultiResourceReconcilerBuilder) ResourceBuilderType
func NewSingleResourceBuilder ¶
func NewSingleResourceBuilder(builder ResourceBuilder) ResourceBuilderType
type ResourceClient ¶
type ResourceHandler ¶
type ResourceNameGenerator ¶
func NewResourceNameGenerator ¶
func NewResourceNameGenerator(instanceName, roleName, groupName string) *ResourceNameGenerator
NewResourceNameGenerator new a ResourceNameGenerator
func (*ResourceNameGenerator) GenerateResourceName ¶
func (r *ResourceNameGenerator) GenerateResourceName(extraSuffix string) string
GenerateResourceName generate resource Name
type ResourceReconciler ¶
type RoleConfigSpec ¶
type RoleGroupRecociler ¶
type RoleGroupRecociler interface { ReconcileGroup(ctx context.Context) (ctrl.Result, error) MergeLabels(mergedGroupCfg any) map[string]string MergeGroupConfigSpec() any RegisterResource() }
RoleGroupRecociler RoleReconcile role reconciler interface all role reconciler should implement this interface
type RoleLabels ¶
func (*RoleLabels[T]) GetLabels ¶
func (r *RoleLabels[T]) GetLabels() map[string]string
type RoleLoggingDataBuilder ¶
type RoleReconciler ¶
type WorkloadOverride ¶
type WorkloadStyleReconciler ¶
type WorkloadStyleReconciler[T client.Object, G any] struct { BaseResourceReconciler[T, G] // contains filtered or unexported fields }
WorkloadStyleReconciler deployment style reconciler this reconciler is used to reconcile the deployment style resources such as deployment, statefulSet, etc. it will do the following things: 1. apply the resource 2. check if the resource is satisfied 3. if not, return requeue 4. if satisfied, return nil Additional:
command and env override can support
func (*WorkloadStyleReconciler[T, G]) CheckPodsSatisfied ¶
func (s *WorkloadStyleReconciler[T, G]) CheckPodsSatisfied(ctx context.Context) (bool, error)
func (*WorkloadStyleReconciler[T, G]) DoReconcile ¶
func (s *WorkloadStyleReconciler[T, G]) DoReconcile( ctx context.Context, resource client.Object, instance ResourceHandler, ) (ctrl.Result, error)