util

package
v1.9.0-release Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoolPointer

func BoolPointer(b bool) *bool

BoolPointer generates bool pointer from bool.

func ConvertMapStringToMapStringPointer

func ConvertMapStringToMapStringPointer(inputMap map[string]string) map[string]*string

ConvertMapStringToMapStringPointer converts a simple map[string]string to map[string]*string.

func ConvertStringToInt32

func ConvertStringToInt32(s string) int32

ConvertStringToInt32 converts the given string to int32.

func ExtractSecretsResourceVersion

func ExtractSecretsResourceVersion(secrets []*corev1.Secret) []v1.SecretResourceVersion

func GetEnvWithDefault

func GetEnvWithDefault(key string, fallback string) string

func GetK8sVersion

func GetK8sVersion() (major *int, minor *int, err error)

func GetNodeConfig

func GetNodeConfig(node v1.Node, clusterSpec v1.NifiClusterSpec) (*v1.NodeConfig, error)

GetNodeConfig compose the nodeConfig for a given nifi node.

func GetNodeImage

func GetNodeImage(nodeConfig *v1.NodeConfig, clusterImage string) string

GetNodeImage returns the used node image.

func GetRequeueInterval

func GetRequeueInterval(interval int, offset int) time.Duration

func Hash

func Hash(s string) string

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 IsK8sPrior1_21

func IsK8sPrior1_21() bool

func IsSSLEnabledForInternalCommunication

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

IsSSLEnabledForInternalCommunication checks if ssl is enabled for internal communication.

func IsSecretResourceVersionUpdated

func IsSecretResourceVersionUpdated(secrets []*corev1.Secret, secretsResourceVersion []v1.SecretResourceVersion) bool

func MapStringStringPointer

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

MapStringStringPointer generates a map[string]*string.

func Max

func Max(x, y int) int

computes the max between 2 ints.

func MaxSlice32

func MaxSlice32(s []int32) (int32, error)

computes the max in a int32 slice.

func MergeAnnotations

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

func MergeHostAliases

func MergeHostAliases(globalAliases []corev1.HostAlias, overrideAliases []corev1.HostAlias) []corev1.HostAlias

MergeHostAliases takes two host alias lists and merges them. For IP conflicts, the latter/second list takes precedence.

func MergeLabels

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

MergeLabels merges two given labels.

func MinSlice32

func MinSlice32(s []int32) (int32, error)

computes the max in a int32 slice.

func MonitoringAnnotations

func MonitoringAnnotations(port int) map[string]string

MonitoringAnnotations returns specific prometheus annotations.

func MustConvertToInt

func MustConvertToInt(str string, name string) int

func NifiUserSliceContains

func NifiUserSliceContains(list []*v1.NifiUser, u *v1.NifiUser) bool

NifiUserSliceContains returns true if list contains s.

func NodesToIdList

func NodesToIdList(nodes []v1.Node) (ids []int32)

func NodesToIdMap

func NodesToIdMap(nodes []v1.Node) (nodeMap map[int32]v1.Node)

func ParsePropertiesFormat

func ParsePropertiesFormat(properties string) map[string]string

ParsePropertiesFormat parses the properties format configuration into map[string]string.

func StringPointer

func StringPointer(s string) *string

StringPointer generates string pointer from string.

func StringSliceCompare

func StringSliceCompare(list1 []string, list2 []string) bool

StringSliceCompare returns true if the two lists of string are the same.

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.

func StringSliceStrictCompare

func StringSliceStrictCompare(list1 []string, list2 []string) bool

StringSliceStrictCompare returns true if the two lists of string are the same with the order taking into account.

func SubtractNodes

func SubtractNodes(originalNodes []v1.Node, nodesToRemove []v1.Node) (results []v1.Node)

SubtractNodes removes nodesToRemove from the originalNodes list by the node's Ids and returns the result.

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