common

package
v1.0.16 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2023 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Overview

Copyright 2021.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2021.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	ImageNamePrefix        = "RELATED_IMAGE_ActiveMQ_Artemis_Broker_"
	BrokerImageKey         = "Kubernetes"
	InitImageKey           = "Init"
	DefaultDeploymentSize  = int32(1)
	RouteKind              = "Route"
	OpenShiftAPIServerKind = "OpenShiftAPIServer"
	DEFAULT_RESYNC_PERIOD  = 30 * time.Second
	// comments push this over the edge a little when dealing with white space
	// as en env var it can be disabled by setting to "" or can be improved!
	JaasConfigSyntaxMatchRegExDefault = `` /* 206-byte string literal not displayed */
)

extra kinds

View Source
const (
	DeployedConditionZeroSizeMessage       = "Pods not scheduled. Deployment size is 0"
	ConfigAppliedConditionOutOfSyncMessage = "Waiting for the Broker to acknowledge changes"
	NotReadyConditionMessage               = "Some conditions are not met"
	ImageVersionConflictMessage            = "Version and Images cannot be specified at the same time"
	ImageDependentPairMessage              = "Init image and broker image must both be configured as an interdependent pair"
	PDBNonNilSelectorMessage               = "PodDisruptionBudget's selector should not be specified"
)

Variables

View Source
var ClusterDomain *string

Functions

func CompareRequiredResources

func CompareRequiredResources(res1 *corev1.ResourceRequirements, res2 *corev1.ResourceRequirements) bool

func DetectOpenshift added in v1.0.16

func DetectOpenshift() (bool, error)

func DetermineCompactVersionToUse added in v1.0.16

func DetermineCompactVersionToUse(customResource *brokerv1beta1.ActiveMQArtemis) (string, error)

func DetermineImageToUse added in v1.0.16

func DetermineImageToUse(customResource *brokerv1beta1.ActiveMQArtemis, imageTypeKey string) string

func FromJson

func FromJson(jsonStr *string, obj interface{}) error

func GetClusterDomain added in v1.0.12

func GetClusterDomain() string

func GetDeployedResources added in v1.0.16

func GetDeployedResources(instance *brokerv1beta1.ActiveMQArtemis, client rtclient.Client) (map[reflect.Type][]rtclient.Object, error)

func GetDeploymentSize added in v1.0.16

func GetDeploymentSize(cr *brokerv1beta1.ActiveMQArtemis) int32

func GetJaasConfigSyntaxMatchRegEx added in v1.0.9

func GetJaasConfigSyntaxMatchRegEx() string

func GetManager

func GetManager() manager.Manager

func GetReconcileResyncPeriod

func GetReconcileResyncPeriod() time.Duration

func GetSingleStatefulSetStatus added in v1.0.16

func GetSingleStatefulSetStatus(ss *appsv1.StatefulSet, cr *brokerv1beta1.ActiveMQArtemis) olm.DeploymentStatus

func Int32ToPtr added in v1.0.8

func Int32ToPtr(v int32) *int32

func IsConditionPresentAndEqual added in v1.0.6

func IsConditionPresentAndEqual(conditions []metav1.Condition, condition metav1.Condition) bool

func NewTrue

func NewTrue() *bool

func ProcessStatus added in v1.0.16

func ProcessStatus(cr *brokerv1beta1.ActiveMQArtemis, client rtclient.Client, namespacedName types.NamespacedName, namer Namers, reconcileError error)

func ResolveBrokerVersion added in v1.0.8

func ResolveBrokerVersion(versions []semver.Version, desired string) *semver.Version

func ResolveBrokerVersionFromCR added in v1.0.16

func ResolveBrokerVersionFromCR(cr *brokerv1beta1.ActiveMQArtemis) (string, error)

func ResolveImage added in v1.0.16

func ResolveImage(customResource *brokerv1beta1.ActiveMQArtemis, key string) string

func ResolveWatchNamespaceForManager

func ResolveWatchNamespaceForManager(oprNamespace string, watchNamespace string) (bool, []string)

Given the operator's namespace and a string representation of it's WATCH_NAMESPACE value, this method returns whether the operator is watching its own(single) namespace, or watching multiple namespaces, or all namespace For watching single: it returns (true, nil) For watching multiple: it returns (false, [n]string) where n > 0 For watching all: it returns (false, nil)

func ResourceExists

func ResourceExists(dc discovery.DiscoveryInterface, apiGroupVersion, kind string) (bool, error)

func SetManager

func SetManager(mgr manager.Manager)

func SetReadyCondition added in v1.0.6

func SetReadyCondition(conditions *[]metav1.Condition)

func ToJson

func ToJson(obj interface{}) (string, error)

func ValidateBrokerVersion added in v1.0.16

func ValidateBrokerVersion(customResource *brokerv1beta1.ActiveMQArtemis) *metav1.Condition

Types

type ActiveMQArtemisConfigHandler

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

type AutoDetector

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

func NewAutoDetect

func NewAutoDetect(mgr manager.Manager) (*AutoDetector, error)

New creates a new auto-detect runner

func (*AutoDetector) DetectOpenshift

func (b *AutoDetector) DetectOpenshift() error

type BufferWriter added in v1.0.14

type BufferWriter struct {
	Buffer *bytes.Buffer
}

func (BufferWriter) Write added in v1.0.14

func (w BufferWriter) Write(p []byte) (int, error)

type Namers added in v1.0.16

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
	LabelBuilder                  selectors.LabelerData
	GLOBAL_DATA_PATH              string
}

type StateManager

type StateManager struct {
	*sync.Mutex
	// contains filtered or unexported fields
}

func GetStateManager

func GetStateManager() *StateManager

func (*StateManager) Clear

func (sm *StateManager) Clear()

func (*StateManager) GetState

func (sm *StateManager) GetState(key string) interface{}

func (*StateManager) SetState

func (sm *StateManager) SetState(key string, value interface{})

Jump to

Keyboard shortcuts

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