v2alpha5activemqartemis

package
v0.20.1 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2021 License: Apache-2.0 Imports: 52 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CreatingK8sResources   = "creating_k8s_resources"
	ConfiguringEnvironment = "configuring_broker_environment"
	CreatingContainer      = "creating_container"
	ContainerRunning       = "running"
	Scaling                = "scaling"
)

Names of states

View Source
const (
	NotCreatedID           = -1
	CreatingK8sResourcesID = 0
	//ConfiguringEnvironment = "configuring_broker_environment"
	//CreatingContainer      = "creating_container"
	ContainerRunningID          = 1
	ScalingID                   = 2
	NumActiveMQArtemisFSMStates = 3
)

IDs of states

View Source
const (
	None                   = 0
	CreatedHeadlessService = 1 << 0
	//CreatedPersistentVolumeClaim = 1 << 1
	CreatedStatefulSet           = 1 << 1
	CreatedConsoleJolokiaService = 1 << 2
	CreatedMuxProtocolService    = 1 << 3
	CreatedPingService           = 1 << 4
	CreatedRouteOrIngress        = 1 << 5
	CreatedCredentialsSecret     = 1 << 6
	CreatedNettySecret           = 1 << 7

	Complete = CreatedHeadlessService |

		CreatedConsoleJolokiaService |
		CreatedMuxProtocolService |
		CreatedStatefulSet |
		CreatedPingService |
		CreatedRouteOrIngress |
		CreatedCredentialsSecret |
		CreatedNettySecret
)

Completion of CreatingK8sResources state

View Source
const (
	ActiveMQArtemisFSMID = 0
)

Machine id

Variables

This section is empty.

Functions

func Add

func Add(mgr manager.Manager) error

Add creates a new ActiveMQArtemis Controller and adds it to the Manager. The Manager will set fields on the Controller and Start it when the Manager is Started.

func AddBrokerConfigHandler

func AddBrokerConfigHandler(namespacedName types.NamespacedName, handler ActiveMQArtemisConfigHandler)

func GetDeployedStatefuleSetNames

func GetDeployedStatefuleSetNames(targetCrNames []types.NamespacedName) []types.NamespacedName

get the statefulset names

func GetPodStatus

func GetPodStatus(cr *brokerv2alpha5.ActiveMQArtemis, client client.Client, namespacedName types.NamespacedName) olm.DeploymentStatus

func ID

func ID() int

func MajorMinorMicro

func MajorMinorMicro(productVersion string) (major, minor, micro string)

func MakeEnvVarArrayForCR

func MakeEnvVarArrayForCR(fsm *ActiveMQArtemisFSM) []corev1.EnvVar

func MakeVolumeMounts

func MakeVolumeMounts(fsm *ActiveMQArtemisFSM) []corev1.VolumeMount

func MakeVolumes

func MakeVolumes(fsm *ActiveMQArtemisFSM) []corev1.Volume

func NewPersistentVolumeClaimArrayForCR

func NewPersistentVolumeClaimArrayForCR(cr *brokerv2alpha5.ActiveMQArtemis, arrayLength int) *[]corev1.PersistentVolumeClaim

func NewPodTemplateSpecForCR

func NewPodTemplateSpecForCR(fsm *ActiveMQArtemisFSM) corev1.PodTemplateSpec

func NewStatefulSetForCR

func NewStatefulSetForCR(fsm *ActiveMQArtemisFSM) *appsv1.StatefulSet

func RemoveBrokerConfigHandler

func RemoveBrokerConfigHandler(namespacedName types.NamespacedName)

func UpdatePodForSecurity added in v0.20.1

func UpdatePodForSecurity(securityHandlerNamespacedName types.NamespacedName, handler ActiveMQArtemisConfigHandler)

func UpdatePodStatus

func UpdatePodStatus(cr *brokerv2alpha5.ActiveMQArtemis, client client.Client, ssNamespacedName types.NamespacedName) error

TODO: Test namespacedName to ensure it's the right namespacedName

Types

type ActiveMQArtemisConfigHandler

type ActiveMQArtemisConfigHandler interface {
	IsApplicableFor(brokerNamespacedName types.NamespacedName) bool
	Config(initContainers []corev1.Container, outputDirRoot string, yacfgProfileVersion string, yacfgProfileName string) (value []string)
}

func GetBrokerConfigHandler

func GetBrokerConfigHandler(brokerNamespacedName types.NamespacedName) (handler ActiveMQArtemisConfigHandler)

type ActiveMQArtemisFSM

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

func MakeActiveMQArtemisFSM

func MakeActiveMQArtemisFSM(instance *brokerv2alpha5.ActiveMQArtemis, _namespacedName types.NamespacedName, r *ReconcileActiveMQArtemis) *ActiveMQArtemisFSM

Need to deep-copy the instance?

func (*ActiveMQArtemisFSM) Add

func (amqbfsm *ActiveMQArtemisFSM) Add(s *fsm.IState)

func (*ActiveMQArtemisFSM) Enter

func (amqbfsm *ActiveMQArtemisFSM) Enter(startStateID int) error

func (*ActiveMQArtemisFSM) Exit

func (amqbfsm *ActiveMQArtemisFSM) Exit() error

func (*ActiveMQArtemisFSM) GetConsoleSecretName

func (amqbfsm *ActiveMQArtemisFSM) GetConsoleSecretName() string

func (*ActiveMQArtemisFSM) GetCredentialsSecretName

func (amqbfsm *ActiveMQArtemisFSM) GetCredentialsSecretName() string

func (*ActiveMQArtemisFSM) GetHeadlessServiceName

func (amqbfsm *ActiveMQArtemisFSM) GetHeadlessServiceName() string

func (*ActiveMQArtemisFSM) GetNettySecretName

func (amqbfsm *ActiveMQArtemisFSM) GetNettySecretName() string

func (*ActiveMQArtemisFSM) GetPingServiceName

func (amqbfsm *ActiveMQArtemisFSM) GetPingServiceName() string

func (*ActiveMQArtemisFSM) GetPodInvalid added in v0.20.1

func (amqbfsm *ActiveMQArtemisFSM) GetPodInvalid() bool

func (*ActiveMQArtemisFSM) GetStatefulSetName

func (amqbfsm *ActiveMQArtemisFSM) GetStatefulSetName() string

func (*ActiveMQArtemisFSM) GetStatefulSetNamespacedName

func (amqbfsm *ActiveMQArtemisFSM) GetStatefulSetNamespacedName() types.NamespacedName

func (*ActiveMQArtemisFSM) MakeNamers

func (amqbfsm *ActiveMQArtemisFSM) MakeNamers() *Namers

func (*ActiveMQArtemisFSM) Remove

func (amqbfsm *ActiveMQArtemisFSM) Remove(s *fsm.IState)

func (*ActiveMQArtemisFSM) SetPodInvalid added in v0.20.1

func (amqbfsm *ActiveMQArtemisFSM) SetPodInvalid(isInvalid bool)

func (*ActiveMQArtemisFSM) Update

func (amqbfsm *ActiveMQArtemisFSM) Update() (error, int)

func (*ActiveMQArtemisFSM) UpdateCustomResource

func (amqbfsm *ActiveMQArtemisFSM) UpdateCustomResource(newRc *brokerv2alpha5.ActiveMQArtemis)

type ActiveMQArtemisIReconciler

type ActiveMQArtemisIReconciler interface {
	Process(fsm *ActiveMQArtemisFSM, client client.Client, scheme *runtime.Scheme, firstTime bool) uint32
	ProcessStatefulSet(fsm *ActiveMQArtemisFSM, client client.Client, log logr.Logger, firstTime bool) (*appsv1.StatefulSet, bool)
	ProcessCredentials(fsm *ActiveMQArtemisFSM, client client.Client, scheme *runtime.Scheme, currentStatefulSet *appsv1.StatefulSet) uint32
	ProcessDeploymentPlan(fsm *ActiveMQArtemisFSM, client client.Client, scheme *runtime.Scheme, currentStatefulSet *appsv1.StatefulSet, firstTime bool) uint32
	ProcessAcceptorsAndConnectors(fsm *ActiveMQArtemisFSM, client client.Client, scheme *runtime.Scheme, currentStatefulSet *appsv1.StatefulSet) uint32
	ProcessConsole(fsm *ActiveMQArtemisFSM, client client.Client, scheme *runtime.Scheme, currentStatefulSet *appsv1.StatefulSet)
	ProcessResources(fsm *ActiveMQArtemisFSM, client client.Client, scheme *runtime.Scheme, currentStatefulSet *appsv1.StatefulSet) uint8
	ProcessAddressSettings(customResource *brokerv2alpha5.ActiveMQArtemis, client client.Client) bool
}

type ActiveMQArtemisReconciler

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

func (*ActiveMQArtemisReconciler) Process

func (reconciler *ActiveMQArtemisReconciler) Process(fsm *ActiveMQArtemisFSM, client client.Client, scheme *runtime.Scheme, firstTime bool) (uint32, uint8)

func (*ActiveMQArtemisReconciler) ProcessAcceptorsAndConnectors

func (reconciler *ActiveMQArtemisReconciler) ProcessAcceptorsAndConnectors(fsm *ActiveMQArtemisFSM, client client.Client, scheme *runtime.Scheme, currentStatefulSet *appsv1.StatefulSet) uint32

func (*ActiveMQArtemisReconciler) ProcessAddressSettings

func (reconciler *ActiveMQArtemisReconciler) ProcessAddressSettings(customResource *brokerv2alpha5.ActiveMQArtemis, prevCustomResource *brokerv2alpha5.ActiveMQArtemis, client client.Client) bool

func (*ActiveMQArtemisReconciler) ProcessConsole

func (reconciler *ActiveMQArtemisReconciler) ProcessConsole(fsm *ActiveMQArtemisFSM, client client.Client, scheme *runtime.Scheme, currentStatefulSet *appsv1.StatefulSet) uint32

func (*ActiveMQArtemisReconciler) ProcessCredentials

func (reconciler *ActiveMQArtemisReconciler) ProcessCredentials(fsm *ActiveMQArtemisFSM, client client.Client, scheme *runtime.Scheme, currentStatefulSet *appsv1.StatefulSet) uint32

func (*ActiveMQArtemisReconciler) ProcessDeploymentPlan

func (reconciler *ActiveMQArtemisReconciler) ProcessDeploymentPlan(fsm *ActiveMQArtemisFSM, client client.Client, scheme *runtime.Scheme, currentStatefulSet *appsv1.StatefulSet, firstTime bool) uint32

func (*ActiveMQArtemisReconciler) ProcessResources

func (reconciler *ActiveMQArtemisReconciler) ProcessResources(fsm *ActiveMQArtemisFSM, client client.Client, scheme *runtime.Scheme, currentStatefulSet *appsv1.StatefulSet) uint8

func (*ActiveMQArtemisReconciler) ProcessStatefulSet

func (reconciler *ActiveMQArtemisReconciler) ProcessStatefulSet(fsm *ActiveMQArtemisFSM, client client.Client, log logr.Logger, firstTime bool) (*appsv1.StatefulSet, bool)

type ContainerRunningState

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

This is the state we should be in whenever kubernetes resources are stable and only configuration is changing

func MakeContainerRunningState

func MakeContainerRunningState(_parentFSM *ActiveMQArtemisFSM, _namespacedName types.NamespacedName) ContainerRunningState

func NewContainerRunningState

func NewContainerRunningState(_parentFSM *ActiveMQArtemisFSM, _namespacedName types.NamespacedName) *ContainerRunningState

func (*ContainerRunningState) Enter

func (rs *ContainerRunningState) Enter(previousStateID int) error

func (*ContainerRunningState) Exit

func (rs *ContainerRunningState) Exit() error

func (*ContainerRunningState) ID

func (rs *ContainerRunningState) ID() int

func (*ContainerRunningState) Update

func (rs *ContainerRunningState) Update() (error, int)

type CreatingK8sResourcesState

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

This is the state we should be in whenever something happens that requires a change to the kubernetes resources

func MakeCreatingK8sResourcesState

func MakeCreatingK8sResourcesState(_parentFSM *ActiveMQArtemisFSM, _namespacedName types.NamespacedName) CreatingK8sResourcesState

func NewCreatingK8sResourcesState

func NewCreatingK8sResourcesState(_parentFSM *ActiveMQArtemisFSM, _namespacedName types.NamespacedName) *CreatingK8sResourcesState

func (*CreatingK8sResourcesState) Enter

func (rs *CreatingK8sResourcesState) Enter(previousStateID int) error

func (*CreatingK8sResourcesState) Exit

func (rs *CreatingK8sResourcesState) Exit() error

func (*CreatingK8sResourcesState) ID

func (rs *CreatingK8sResourcesState) ID() int

func (*CreatingK8sResourcesState) Update

func (rs *CreatingK8sResourcesState) Update() (error, int)

type Namers

type Namers struct {
	SsGlobalName                  string
	SsNameBuilder                 namer.NamerData
	SvcHeadlessNameBuilder        namer.NamerData
	SvcPingNameBuilder            namer.NamerData
	PodsNameBuilder               namer.NamerData
	SecretsCredentialsNameBuilder namer.NamerData
	SecretsConsoleNameBuilder     namer.NamerData
	SecretsNettyNameBuilder       namer.NamerData
}

type ReconcileActiveMQArtemis

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

ReconcileActiveMQArtemis reconciles a ActiveMQArtemis object

func (*ReconcileActiveMQArtemis) Reconcile

Reconcile reads that state of the cluster for a ActiveMQArtemis object and makes changes based on the state read and what is in the ActiveMQArtemis.Spec TODO(user): Modify this Reconcile function to implement your Controller logic. This example creates a Pod as an example Note: The Controller will requeue the Request to be processed again if the returned error is non-nil or Result.Requeue is true, otherwise upon completion it will remove the work from the queue.

type ScalingState

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

func MakeScalingState

func MakeScalingState(_parentFSM *ActiveMQArtemisFSM, _namespacedName types.NamespacedName) ScalingState

func (*ScalingState) Enter

func (ss *ScalingState) Enter(previousStateID int) error

func (*ScalingState) Exit

func (ss *ScalingState) Exit() error

func (*ScalingState) ID

func (ss *ScalingState) ID() int

func (*ScalingState) Update

func (ss *ScalingState) Update() (error, int)

type ValueInfo

type ValueInfo struct {
	Value   string
	AutoGen bool
}

Jump to

Keyboard shortcuts

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