reconcilers

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2023 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SecurityAdminBaseCmdTmpl = `` /* 196-byte string literal not displayed */

	ApplyAllYmlCmdTmpl = `count=0;
until $ADMIN -cacert %s -cert %s -key %s -cd %s -icl -nhnv -h %s -p %v || (( count++ >= 20 ));
do
sleep 20;
done;`

	ApplySingleYmlCmdTmpl = `` /* 127-byte string literal not displayed */

)
View Source
const (
	CaCertKey = "ca.crt"
)

Variables

View Source
var (
	ErrVersionDowngrade = errors.New("version requested is downgrade")
	ErrMajorVersionJump = errors.New("version request is more than 1 major version ahead")
	ErrUnexpectedStatus = errors.New("unexpected upgrade status")
)

Functions

func BuildClusterSvcHostName

func BuildClusterSvcHostName(instance *opsterv1.OpenSearchCluster) string

BuildClusterSvcHostName builds the cluster host name as {svc-name}.{namespace}.svc.{dns-base}

func BuildCmdArg

func BuildCmdArg(instance *opsterv1.OpenSearchCluster, secret *corev1.Secret, log logr.Logger) string

BuildCmdArg builds the command for the securityconfig-update job for each individual ymls present in the securityconfig secret. yml files which are not present in the secret are not applied/updated

func UpdateComponentStatus

func UpdateComponentStatus(
	ctx context.Context,
	k8sClient client.Client,
	instance *opsterv1.OpenSearchCluster,
	status *opsterv1.ComponentStatus,
) error

Types

type ActionGroupReconciler

type ActionGroupReconciler struct {
	client.Client
	ReconcilerOptions
	// contains filtered or unexported fields
}

func NewActionGroupReconciler

func NewActionGroupReconciler(
	ctx context.Context,
	client client.Client,
	recorder record.EventRecorder,
	instance *opsterv1.OpensearchActionGroup,
	opts ...ReconcilerOption,
) *ActionGroupReconciler

func (*ActionGroupReconciler) Delete

func (r *ActionGroupReconciler) Delete() error

func (*ActionGroupReconciler) Reconcile

func (r *ActionGroupReconciler) Reconcile() (retResult ctrl.Result, retErr error)

type ClusterReconciler

type ClusterReconciler struct {
	client.Client
	reconciler.ResourceReconciler
	// contains filtered or unexported fields
}

func NewClusterReconciler

func NewClusterReconciler(
	client client.Client,
	ctx context.Context,
	recorder record.EventRecorder,
	reconcilerContext *ReconcilerContext,
	instance *opsterv1.OpenSearchCluster,
	opts ...reconciler.ResourceReconcilerOption,
) *ClusterReconciler

func (*ClusterReconciler) DeleteResources

func (r *ClusterReconciler) DeleteResources() (ctrl.Result, error)

func (*ClusterReconciler) Reconcile

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

func (*ClusterReconciler) ReconcileSnapshotRepoConfig

func (r *ClusterReconciler) ReconcileSnapshotRepoConfig(username string) (*ctrl.Result, error)

type ComponentReconciler

type ComponentReconciler func() (reconcile.Result, error)

type ConfigurationReconciler

type ConfigurationReconciler struct {
	reconciler.ResourceReconciler
	client.Client
	// contains filtered or unexported fields
}

func NewConfigurationReconciler

func NewConfigurationReconciler(
	client client.Client,
	ctx context.Context,
	recorder record.EventRecorder,
	reconcilerContext *ReconcilerContext,
	instance *opsterv1.OpenSearchCluster,
	opts ...reconciler.ResourceReconcilerOption,
) *ConfigurationReconciler

func (*ConfigurationReconciler) DeleteResources

func (r *ConfigurationReconciler) DeleteResources() (ctrl.Result, error)

func (*ConfigurationReconciler) Reconcile

func (r *ConfigurationReconciler) Reconcile() (ctrl.Result, error)

type DashboardsReconciler

type DashboardsReconciler struct {
	reconciler.ResourceReconciler
	client.Client
	// contains filtered or unexported fields
}

func NewDashboardsReconciler

func NewDashboardsReconciler(
	client client.Client,
	ctx context.Context,
	recorder record.EventRecorder,
	reconcilerContext *ReconcilerContext,
	instance *opsterv1.OpenSearchCluster,
	opts ...reconciler.ResourceReconcilerOption,
) *DashboardsReconciler

func (*DashboardsReconciler) DeleteResources

func (r *DashboardsReconciler) DeleteResources() (ctrl.Result, error)

func (*DashboardsReconciler) Reconcile

func (r *DashboardsReconciler) Reconcile() (ctrl.Result, error)

type NodePoolHash

type NodePoolHash struct {
	Component  string
	ConfigHash string
}

type ReconcilerContext

type ReconcilerContext struct {
	Volumes          []corev1.Volume
	VolumeMounts     []corev1.VolumeMount
	NodePoolHashes   []NodePoolHash
	DashboardsConfig map[string]string
	OpenSearchConfig map[string]string
	// contains filtered or unexported fields
}

func NewReconcilerContext

func NewReconcilerContext(nodepools []opsterv1.NodePool) ReconcilerContext

func (*ReconcilerContext) AddConfig

func (c *ReconcilerContext) AddConfig(key string, value string)

func (*ReconcilerContext) AddDashboardsConfig

func (c *ReconcilerContext) AddDashboardsConfig(key string, value string)

type ReconcilerOption

type ReconcilerOption func(*ReconcilerOptions)

func WithOSClientTransport

func WithOSClientTransport(transport http.RoundTripper) ReconcilerOption

func WithUpdateStatus

func WithUpdateStatus(update bool) ReconcilerOption

type ReconcilerOptions

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

type RoleReconciler

type RoleReconciler struct {
	client.Client
	ReconcilerOptions
	// contains filtered or unexported fields
}

func NewRoleReconciler

func NewRoleReconciler(
	ctx context.Context,
	client client.Client,
	recorder record.EventRecorder,
	instance *opsterv1.OpensearchRole,
	opts ...ReconcilerOption,
) *RoleReconciler

func (*RoleReconciler) Delete

func (r *RoleReconciler) Delete() error

func (*RoleReconciler) Reconcile

func (r *RoleReconciler) Reconcile() (retResult ctrl.Result, retErr error)

type RollingRestartReconciler

type RollingRestartReconciler struct {
	client.Client
	reconciler.ResourceReconciler
	// contains filtered or unexported fields
}

func NewRollingRestartReconciler

func NewRollingRestartReconciler(
	client client.Client,
	ctx context.Context,
	recorder record.EventRecorder,
	reconcilerContext *ReconcilerContext,
	instance *opsterv1.OpenSearchCluster,
	opts ...reconciler.ResourceReconcilerOption,
) *RollingRestartReconciler

func (*RollingRestartReconciler) Reconcile

func (r *RollingRestartReconciler) Reconcile() (ctrl.Result, error)

type ScalerReconciler

type ScalerReconciler struct {
	client.Client
	reconciler.ResourceReconciler
	// contains filtered or unexported fields
}

func NewScalerReconciler

func NewScalerReconciler(
	client client.Client,
	ctx context.Context,
	recorder record.EventRecorder,
	reconcilerContext *ReconcilerContext,
	instance *opsterv1.OpenSearchCluster,
	opts ...reconciler.ResourceReconcilerOption,
) *ScalerReconciler

func (*ScalerReconciler) Reconcile

func (r *ScalerReconciler) Reconcile() (ctrl.Result, error)

type SecurityconfigReconciler

type SecurityconfigReconciler struct {
	reconciler.ResourceReconciler
	client.Client
	// contains filtered or unexported fields
}

func NewSecurityconfigReconciler

func NewSecurityconfigReconciler(
	client client.Client,
	ctx context.Context,
	recorder record.EventRecorder,
	reconcilerContext *ReconcilerContext,
	instance *opsterv1.OpenSearchCluster,
	opts ...reconciler.ResourceReconcilerOption,
) *SecurityconfigReconciler

func (*SecurityconfigReconciler) DeleteResources

func (r *SecurityconfigReconciler) DeleteResources() (ctrl.Result, error)

func (*SecurityconfigReconciler) Reconcile

func (r *SecurityconfigReconciler) Reconcile() (ctrl.Result, error)

type TLSReconciler

type TLSReconciler struct {
	reconciler.ResourceReconciler
	client.Client
	// contains filtered or unexported fields
}

func NewTLSReconciler

func NewTLSReconciler(
	client client.Client,
	ctx context.Context,
	reconcilerContext *ReconcilerContext,
	instance *opsterv1.OpenSearchCluster,
	opts ...reconciler.ResourceReconcilerOption,
) *TLSReconciler

func (*TLSReconciler) DeleteResources

func (r *TLSReconciler) DeleteResources() (ctrl.Result, error)

func (*TLSReconciler) Reconcile

func (r *TLSReconciler) Reconcile() (ctrl.Result, error)

type TenantReconciler

type TenantReconciler struct {
	client.Client
	ReconcilerOptions
	// contains filtered or unexported fields
}

func NewTenantReconciler

func NewTenantReconciler(
	ctx context.Context,
	client client.Client,
	recorder record.EventRecorder,
	instance *opsterv1.OpensearchTenant,
	opts ...ReconcilerOption,
) *TenantReconciler

func (*TenantReconciler) Delete

func (r *TenantReconciler) Delete() error

func (*TenantReconciler) Reconcile

func (r *TenantReconciler) Reconcile() (retResult ctrl.Result, retErr error)

type UpgradeReconciler

type UpgradeReconciler struct {
	client.Client
	reconciler.ResourceReconciler
	// contains filtered or unexported fields
}

func NewUpgradeReconciler

func NewUpgradeReconciler(
	client client.Client,
	ctx context.Context,
	recorder record.EventRecorder,
	reconcilerContext *ReconcilerContext,
	instance *opsterv1.OpenSearchCluster,
	opts ...reconciler.ResourceReconcilerOption,
) *UpgradeReconciler

func (*UpgradeReconciler) Reconcile

func (r *UpgradeReconciler) Reconcile() (ctrl.Result, error)

type UserReconciler

type UserReconciler struct {
	client.Client
	ReconcilerOptions
	// contains filtered or unexported fields
}

func NewUserReconciler

func NewUserReconciler(
	ctx context.Context,
	client client.Client,
	recorder record.EventRecorder,
	instance *opsterv1.OpensearchUser,
	opts ...ReconcilerOption,
) *UserReconciler

func (*UserReconciler) Delete

func (r *UserReconciler) Delete() error

func (*UserReconciler) Reconcile

func (r *UserReconciler) Reconcile() (retResult ctrl.Result, retErr error)

type UserRoleBindingReconciler

type UserRoleBindingReconciler struct {
	client.Client
	ReconcilerOptions
	// contains filtered or unexported fields
}

func (*UserRoleBindingReconciler) Delete

func (r *UserRoleBindingReconciler) Delete() error

func (*UserRoleBindingReconciler) Reconcile

func (r *UserRoleBindingReconciler) Reconcile() (retResult ctrl.Result, retErr error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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