controllers

package
v0.1.0-alpha Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2022 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsSha256

func AsSha256(o interface{}) string

func CallSolaceSempApi

func CallSolaceSempApi(
	s *scalablev1alpha1.SolaceScalable,
	apiPath string,
	ctx context.Context,
) (string, bool, error)

func CleanJsonResponse

func CleanJsonResponse(s string, r string) []int32

func Contains

func Contains(s []string, str string) bool

func CreateIngressConsoleRules

func CreateIngressConsoleRules(s *scalablev1alpha1.SolaceScalable) []v1.IngressRule

func DeletePubSubSvc

func DeletePubSubSvc(svcList *corev1.ServiceList, foundExtraPubSubSvc *corev1.Service, pubSubSvcNames *[]string, r *SolaceScalableReconciler, ctx context.Context) error

func GetDefaultHaProxyConf

func GetDefaultHaProxyConf(servicePorts []corev1.ServicePort) *[]corev1.ServicePort

func GetEnv

func GetEnv(s *scalablev1alpha1.SolaceScalable, selector string) string

func GetSolaceOpenPorts

func GetSolaceOpenPorts(s *scalablev1alpha1.SolaceScalable, ctx context.Context) ([]int32, error)

func IngressConsole

func IngressConsole(
	s *scalablev1alpha1.SolaceScalable,
	labels map[string]string,
) *v1.Ingress

func NewtcpConfigmap

func NewtcpConfigmap(
	s *scalablev1alpha1.SolaceScalable,
	data map[string]string,
	nature string,
	labels map[string]string,
) *v1.ConfigMap

func PersistentVolume

func PersistentVolume(s *scalablev1alpha1.SolaceScalable,
	replicaNbr string,
	labels map[string]string,
) *corev1.PersistentVolume

func Statefulset

func Statefulset(s *scalablev1alpha1.SolaceScalable, labels map[string]string) *v1.StatefulSet

func StringInSlice

func StringInSlice(a string, list []string) bool

func SvcConsole

func SvcConsole(s *scalablev1alpha1.SolaceScalable, counter int) *corev1.Service

func SvcPubSub

func SvcPubSub(s *scalablev1alpha1.SolaceScalable,
	m SolaceMergedResp,
	p int32,
	pubSub string,
	labels map[string]string,
) *corev1.Service

func Unique

func Unique(intSlice []int32) []int32

Types

type SolaceClientUsernameResp

type SolaceClientUsernameResp struct {
	ClientUsername string  `json:"clientUsername"`
	Enabled        bool    `json:"enabled"`
	MsgVpnName     string  `json:"msgVpnName"`
	Ports          []int32 `json:"ports"`
}

clientUsernames response struct

type SolaceClientUsernamesResp

type SolaceClientUsernamesResp struct {
	Data []SolaceClientUsernameResp `json:"data"`
}

func (*SolaceClientUsernamesResp) MergeSolaceResponses

type SolaceMergedResp

type SolaceMergedResp struct {
	MsgVpnName     string  `json:"msgVpnName"`
	ClientUsername string  `json:"clientUsername"`
	Ports          []int32 `json:"ports"`
}

merged datas

type SolaceMergedResps

type SolaceMergedResps struct {
	Data []SolaceMergedResp `json:"data"`
}

type SolaceMsgVpnResp

type SolaceMsgVpnResp struct {
	MsgVpnName                             string `json:"msgVpnName"`
	ServiceAmqpPlainTextListenPort         int    `json:"serviceAmqpPlainTextListenPort"`
	ServiceAmqpTlsListenPort               int    `json:"serviceAmqpTlsListenPort"`
	ServiceMqttPlainTextListenPort         int    `json:"serviceMqttPlainTextListenPort"`
	ServiceMqttTlsListenPort               int    `json:"serviceMqttTlsListenPort"`
	ServiceMqttTlsWebSocketListenPort      int    `json:"serviceMqttTlsWebSocketListenPort"`
	ServiceMqttWebSocketListenPort         int    `json:"serviceMqttWebSocketListenPort"`
	ServiceRestIncomingPlainTextListenPort int    `json:"serviceRestIncomingPlainTextListenPort"`
	ServiceRestIncomingTlsListenPort       int    `json:"serviceRestIncomingTlsListenPort"`
}

message vpns response struct

type SolaceMsgVpnsResp

type SolaceMsgVpnsResp struct {
	Data []SolaceMsgVpnResp `json:"data"`
}

func (*SolaceMsgVpnsResp) GetSolaceClientUsernames

type SolaceScalableReconciler

type SolaceScalableReconciler struct {
	client.Client
	Scheme *runtime.Scheme
}

SolaceScalableReconciler reconciles a SolaceScalable object

func (*SolaceScalableReconciler) CreatePubSubSvc

func (r *SolaceScalableReconciler) CreatePubSubSvc(s *scalablev1alpha1.SolaceScalable,
	pubSubOpenPorts *[]SolaceMergedResp,
	enabledMsgVpns *SolaceMsgVpnsResp,
	nature string,
	ctx context.Context,
) (*[]string, *map[string]string, error)

pubsub SVC creation

func (*SolaceScalableReconciler) CreateSolaceConsoleIngress

func (r *SolaceScalableReconciler) CreateSolaceConsoleIngress(
	solaceScalable *scalablev1alpha1.SolaceScalable,
	ctx context.Context,
) error

func (*SolaceScalableReconciler) CreateSolaceConsoleSvc

func (r *SolaceScalableReconciler) CreateSolaceConsoleSvc(svc *corev1.Service, ctx context.Context) error

create console service

func (*SolaceScalableReconciler) CreateSolaceLocalPv

func (r *SolaceScalableReconciler) CreateSolaceLocalPv(
	s *scalablev1alpha1.SolaceScalable,
	instanceId int,
	ctx context.Context,
) error

func (*SolaceScalableReconciler) CreateSolaceTcpConfigmap

func (r *SolaceScalableReconciler) CreateSolaceTcpConfigmap(
	data *map[string]string,
	nature string,
	solaceScalable *scalablev1alpha1.SolaceScalable,
	ctx context.Context,
) (*v1.ConfigMap, *v1.ConfigMap, error)

create tcp ingress configmap

func (*SolaceScalableReconciler) CreateStatefulSet

func (r *SolaceScalableReconciler) CreateStatefulSet(
	ss *v1.StatefulSet,
	ctx context.Context,
) (*v1.StatefulSet, error)

Check if the statefulset already exists

func (*SolaceScalableReconciler) DeleteSolaceConsoleSvc

func (r *SolaceScalableReconciler) DeleteSolaceConsoleSvc(
	solaceScalable *scalablev1alpha1.SolaceScalable,
	ctx context.Context,
) error

delete unused console services

func (*SolaceScalableReconciler) GetExistingHaProxySvc

func (r *SolaceScalableReconciler) GetExistingHaProxySvc(
	solaceScalable *scalablev1alpha1.SolaceScalable,
	serviceName string,
	ctx context.Context,
) (*corev1.Service, error)

func (*SolaceScalableReconciler) Reconcile

func (r *SolaceScalableReconciler) Reconcile(ctx context.Context, request ctrl.Request) (ctrl.Result, error)

func (*SolaceScalableReconciler) SetupWithManager

func (r *SolaceScalableReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

func (*SolaceScalableReconciler) UpdateDefaultHaproxyConfigmap

func (r *SolaceScalableReconciler) UpdateDefaultHaproxyConfigmap(
	FoundHaproxyConfigMap *v1.ConfigMap,
	configMap *v1.ConfigMap,
	solaceScalable *scalablev1alpha1.SolaceScalable,
	ctx context.Context,
	hashStore *map[string]string,
) error

update default haproxy configmap

func (*SolaceScalableReconciler) UpdateHAProxySvc

func (r *SolaceScalableReconciler) UpdateHAProxySvc(
	hashStore *map[string]string,
	FoundHaproxySvc *corev1.Service,
	ctx context.Context,
) error

func (*SolaceScalableReconciler) UpdateSolaceTcpConfigmap

func (r *SolaceScalableReconciler) UpdateSolaceTcpConfigmap(
	f *v1.ConfigMap,
	configMap *v1.ConfigMap,
	solaceScalable *scalablev1alpha1.SolaceScalable,
	ctx context.Context,
	hashStore *map[string]string,
) error

update tcp ingress configmap

func (*SolaceScalableReconciler) UpdateStatefulSet

func (r *SolaceScalableReconciler) UpdateStatefulSet(
	ss *v1.StatefulSet,
	foundSs *v1.StatefulSet,
	ctx context.Context,
	hashStore *map[string]string,
) error

Update the found object and write the result back if there are any changes

Jump to

Keyboard shortcuts

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