infrastructure

package
v0.0.0-...-7801012 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (

	// InfinispanSecretUsernameKey is the secret username key set in the linked secret
	InfinispanSecretUsernameKey = "username"
	// InfinispanSecretPasswordKey is the secret password key set in the linked secret
	InfinispanSecretPasswordKey = "password"

	// InfinispanIdentityFileName is the name of YAML file containing list of Infinispan credentials
	InfinispanIdentityFileName = "identities.yaml"

	// InfinispanKind CRD Kind for Infinispan server (as defined by Infinispan Operator)
	InfinispanKind = "Infinispan"

	// InfinispanInstanceName is the default name for Infinispan managed by KogitoInfra
	InfinispanInstanceName = "kogito-infinispan"
)
View Source
const (

	// KafkaKind refers to Kafka Kind as defined by Strimzi
	KafkaKind = "Kafka"

	// KafkaInstanceName is the default name for the Kafka cluster managed by KogitoInfra
	KafkaInstanceName = "kogito-kafka"
)
View Source
const (
	// MongoDBOperatorName is the MongoDB Operator default name
	MongoDBOperatorName = "mongodb-kubernetes-operator"

	// DefaultMongoDBAuthDatabase is the default authentication database in MongoDB
	DefaultMongoDBAuthDatabase = "admin"
	// DefaultMongoDBPasswordSecretRef is the default key for the secret reference in MongoDB
	DefaultMongoDBPasswordSecretRef = "password"

	// MongoDBKind refers to MongoDB Kind
	MongoDBKind = "MongoDB"

	// MongoDBAppSecretAuthDatabaseKey is the secret authentication database key set in the linked secret for an application
	MongoDBAppSecretAuthDatabaseKey = "auth-database"
	// MongoDBAppSecretDatabaseKey is the secret database key set in the linked secret for an application
	MongoDBAppSecretDatabaseKey = "database"
	// MongoDBAppSecretUsernameKey is the secret username key set in the linked secret for an application
	MongoDBAppSecretUsernameKey = "username"
	// MongoDBAppSecretPasswordKey is the secret password key set in the linked secret for an application
	MongoDBAppSecretPasswordKey = "password"
)
View Source
const (
	// KeycloakKind refers to Keycloak Kind
	KeycloakKind = "Keycloak"
)

Variables

View Source
var (
	// InfinispanAPIVersion CRD API group version for Infinispan server (as defined by Infinispan Operator)
	InfinispanAPIVersion = ispn.SchemeGroupVersion.String()
)
View Source
var (
	// KafkaAPIVersion refers to kafka APIVersion
	KafkaAPIVersion = v1beta2.SchemeGroupVersion.String()
)
View Source
var (
	// KeycloakAPIVersion refers to kafka APIVersion
	KeycloakAPIVersion = v1alpha1.SchemeGroupVersion.String()
)
View Source
var (
	// MongoDBAPIVersion refers to MongoDB APIVersion
	MongoDBAPIVersion = mongodb.SchemeBuilder.GroupVersion.String()
)

Functions

func CreateFakeClient

func CreateFakeClient(objects []runtime.Object, imageObjs []runtime.Object, buildObjs []runtime.Object) *kogitocli.Client

CreateFakeClient will create a fake client for mock test on Kubernetes env, use cases that depends on OpenShift should use CreateFakeClientOnOpenShift Deprecated: use NewFakeClientBuilder().Build() instead.

func CreateFakeClientOnOpenShift

func CreateFakeClientOnOpenShift(objects []runtime.Object, imageObjs []runtime.Object, buildObjs []runtime.Object) *kogitocli.Client

CreateFakeClientOnOpenShift same as CreateFakeClientWithDisco setting openshift flag to true Deprecated: use NewFakeClientBuilder().OnOpenShift().Build() instead.

func IsKafkaResource

func IsKafkaResource(apiVersion, kind string) bool

IsKafkaResource checks if provided KogitoInfra instance is for kafka resource

func ResolveKafkaServerURI

func ResolveKafkaServerURI(kafka *v1beta2.Kafka) string

ResolveKafkaServerURI returns the uri of the kafka instance

func ToRuntimeObjects

func ToRuntimeObjects(resources ...client.Object) []runtime.Object

ToRuntimeObjects converts RHSysUtils array KubernetesResource into k8s runtime.Object array

Types

type FakeClientBuilder

type FakeClientBuilder interface {
	AddK8sObjects(objects ...runtime.Object) FakeClientBuilder
	AddImageObjects(imageObjs ...runtime.Object) FakeClientBuilder
	AddBuildObjects(buildObjs ...runtime.Object) FakeClientBuilder
	OnOpenShift() FakeClientBuilder
	SupportPrometheus() FakeClientBuilder
	SupportOLM() FakeClientBuilder
	Build() *kogitocli.Client
}

FakeClientBuilder create client object for tests

func NewFakeClientBuilder

func NewFakeClientBuilder() FakeClientBuilder

NewFakeClientBuilder provides new object FakeClientBuilder to build a FakeClient. Usage: NewFakeClientBuilder().AddK8sObjects(obj1, obj2).Build()

type InfinispanCredential

type InfinispanCredential struct {
	Username string `yaml:"username"`
	Password string `yaml:"password"`
}

InfinispanCredential holds the information to authenticate into an infinispan server

type InfinispanHandler

type InfinispanHandler interface {
	FetchInfinispanInstance(key types.NamespacedName) (*ispn.Infinispan, error)
	IsInfinispanAvailable() bool
	FetchInfinispanInstanceURI(key types.NamespacedName) (string, error)
	GetInfinispanCredential(infinispanInstance *ispn.Infinispan) (*InfinispanCredential, error)
}

InfinispanHandler ...

func NewInfinispanHandler

func NewInfinispanHandler(context operator.Context) InfinispanHandler

NewInfinispanHandler ...

type InfinispanIdentity

type InfinispanIdentity struct {
	Credentials []InfinispanCredential `yaml:"credentials"`
}

InfinispanIdentity is the struct for the secret holding the credential for the Infinispan server

type KafkaHandler

type KafkaHandler interface {
	IsStrimziAvailable() bool
	FetchKafkaInstance(key types.NamespacedName) (*v1beta2.Kafka, error)
	FetchKafkaTopic(key types.NamespacedName) (*v1beta2.KafkaTopic, error)
	CreateKafkaTopic(topicName, kafkaName, kafkaNamespace string) (*v1beta2.KafkaTopic, error)
	ResolveKafkaServerURI(kafka *v1beta2.Kafka) (string, error)
}

KafkaHandler ...

func NewKafkaHandler

func NewKafkaHandler(context operator.Context) KafkaHandler

NewKafkaHandler ...

type KeycloakHandler

type KeycloakHandler interface {
	IsKeycloakAvailable() bool
}

KeycloakHandler ...

func NewKeycloakHandler

func NewKeycloakHandler(context operator.Context) KeycloakHandler

NewKeycloakHandler ...

type MongoDBHandler

type MongoDBHandler interface {
	IsMongoDBAvailable() bool
	IsMongoDBOperatorAvailable(namespace string) (bool, error)
	FetchMongoDBInstance(key types.NamespacedName) (*mongodb.MongoDBCommunity, error)
}

MongoDBHandler ...

func NewMongoDBHandler

func NewMongoDBHandler(context operator.Context) MongoDBHandler

NewMongoDBHandler ...

Directories

Path Synopsis
Package grafana contains grafana API versions.
Package grafana contains grafana API versions.
v1alpha1
Package v1alpha1 contains API Schema definitions for the integreatly v1alpha1 API group +k8s:deepcopy-gen=package,register +groupName=integreatly.org
Package v1alpha1 contains API Schema definitions for the integreatly v1alpha1 API group +k8s:deepcopy-gen=package,register +groupName=integreatly.org
Package infinispan contains infinispan API versions.
Package infinispan contains infinispan API versions.
v1
Package v1 contains API Schema definitions for the infinispan v1 API group +k8s:deepcopy-gen=package,register +groupName=infinispan.org
Package v1 contains API Schema definitions for the infinispan v1 API group +k8s:deepcopy-gen=package,register +groupName=infinispan.org
Package kafka contains kafka API versions.
Package kafka contains kafka API versions.
v1beta2
Package v1beta2 contains API Schema definitions for the kafka v1beta2 API group +k8s:deepcopy-gen=package,register +groupName=kafka.strimzi.io +kubebuilder:skip
Package v1beta2 contains API Schema definitions for the kafka v1beta2 API group +k8s:deepcopy-gen=package,register +groupName=kafka.strimzi.io +kubebuilder:skip
Package keycloak contains keycloak API versions.
Package keycloak contains keycloak API versions.
v1alpha1
Package v1alpha1 contains API Schema definitions for the keycloak v1alpha1 API group +k8s:deepcopy-gen=package,register +groupName=keycloak.org
Package v1alpha1 contains API Schema definitions for the keycloak v1alpha1 API group +k8s:deepcopy-gen=package,register +groupName=keycloak.org
Package mongodb contains mongodb API versions.
Package mongodb contains mongodb API versions.
v1
Package v1 contains API Schema definitions for the mongodb v1 API group +k8s:deepcopy-gen=package,register +groupName=mongodbcommunity.mongodb.com +versionName=v1
Package v1 contains API Schema definitions for the mongodb v1 API group +k8s:deepcopy-gen=package,register +groupName=mongodbcommunity.mongodb.com +versionName=v1

Jump to

Keyboard shortcuts

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