util

package
v0.18.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	IngressConfigGlobalName = "globalConfig"
)

Variables

This section is empty.

Functions

func AreStringSlicesIdentical

func AreStringSlicesIdentical(a, b []string) bool

func BoolPointer

func BoolPointer(b bool) *bool

BoolPointer generates bool pointer from bool

func ConstructEListenerLabelName added in v0.15.0

func ConstructEListenerLabelName(ingressConfigName, eListenerName string) string

ConstructEListenerLabelName construct an eListener label name based on ingress config name and listener name

func ConvertConfigEntryListToProperties added in v0.15.0

func ConvertConfigEntryListToProperties(config []sarama.ConfigEntry) (*properties.Properties, error)

ConvertConfigEntryListToProperties function takes []sarama.ConfigEntry and coverts it to Properties object

func ConvertPropertiesToMapStringPointer added in v0.15.0

func ConvertPropertiesToMapStringPointer(pp *properties.Properties) map[string]*string

ConvertPropertiesToMapStringPointer converts a Properties object to map[string]*string

func ConvertStringToInt32

func ConvertStringToInt32(s string) int32

ConvertStringToInt32 converts the given string to int32

func CreateLogger added in v0.13.0

func CreateLogger(debug bool, development bool) logr.Logger

func GenerateEnvoyResourceName added in v0.18.0

func GenerateEnvoyResourceName(resourceNameFormat string, resourceNameWithScopeFormat string, extListener v1beta1.ExternalListenerConfig, ingressConfig v1beta1.IngressConfig,
	ingressConfigName, clusterName string) string

func GetBrokerIdsFromStatusAndSpec added in v0.14.0

func GetBrokerIdsFromStatusAndSpec(brokerStatuses map[string]v1beta1.BrokerState, brokers []v1beta1.Broker, log logr.Logger) []int

returns the union of the ids of the configured (Spec.Brokers) and the running (BrokerState) brokers

func GetBrokerImage

func GetBrokerImage(brokerConfig *v1beta1.BrokerConfig, clusterImage string) string

GetBrokerImage returns the used broker image

func GetIngressConfigs added in v0.15.0

func GetIngressConfigs(kafkaClusterSpec v1beta1.KafkaClusterSpec,
	eListenerConfig v1beta1.ExternalListenerConfig) (map[string]v1beta1.IngressConfig, string, error)

GetIngressConfigs compose the ingress configuration for a given externalListener

func GetRandomString

func GetRandomString(length int) (string, error)

getRandomString returns a random string containing uppercase, lowercase and number characters with the length given

func Int32Pointer

func Int32Pointer(i int32) *int32

Int32Pointer generates int32 pointer from int32

func Int64Pointer

func Int64Pointer(i int64) *int64

Int64Pointer generates int64 pointer from int64

func IntPointer

func IntPointer(i int) *int

IntPointer generates int pointer from int

func IntstrPointer

func IntstrPointer(i int) *intstr.IntOrString

IntstrPointer generate IntOrString pointer from int

func IsIngressConfigInUse added in v0.15.0

func IsIngressConfigInUse(iConfigName, defaultConfigName string, cluster *v1beta1.KafkaCluster, log logr.Logger) bool

IsIngressConfigInUse returns true if the provided ingressConfigName is bound to the given broker

func IsSSLEnabledForInternalCommunication

func IsSSLEnabledForInternalCommunication(l []v1beta1.InternalListenerConfig) (enabled bool)

IsSSLEnabledForInternalCommunication checks if ssl is enabled for internal communication

func MapStringStringPointer

func MapStringStringPointer(in map[string]string) (out map[string]*string)

MapStringStringPointer generates a map[string]*string

func Max added in v0.13.0

func Max(x, y int) int

computes the max between 2 ints

func MergeAnnotations

func MergeAnnotations(annotations ...map[string]string) map[string]string

func MergeLabels

func MergeLabels(l ...map[string]string) map[string]string

MergeLabels merges two given labels

func QuantityPointer

func QuantityPointer(q resource.Quantity) *resource.Quantity

QuantityPointer generates Quantity pointer from Quantity

func ShouldIncludeBroker added in v0.15.0

func ShouldIncludeBroker(brokerConfig *v1beta1.BrokerConfig, status v1beta1.KafkaClusterStatus, brokerID int,
	defaultIngressConfigName, ingressConfigName string) bool

ShouldIncludeBroker returns true if the broker should be included as a resource on external listener resources

func StringPointer

func StringPointer(s string) *string

StringPointer generates string pointer from string

func StringSliceContains

func StringSliceContains(list []string, s string) bool

StringSliceContains returns true if list contains s

func StringSliceRemove

func StringSliceRemove(list []string, s string) []string

StringSliceRemove will remove s from list

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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