helpers

package
v0.28.2 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TrueStr string = "true"
)

Variables

This section is empty.

Functions

func AsSHA256

func AsSHA256(o interface{}) string

AsSHA256 does a sha 256 hash on an object and returns the result

func BoolPtr

func BoolPtr(val bool) *bool

BoolPtr returns a bool pointer to the specified boolean value

func BoolTrue

func BoolTrue(val *bool) bool

BoolTrue returns true if the pointer is nil or true

func ContainsElement

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

ContainsElement returns true if 's' is an element in the list

func GetDefaultHumioCoreImageFromEnvVar

func GetDefaultHumioCoreImageFromEnvVar() string

GetDefaultHumioCoreImageFromEnvVar returns the user-defined default image for humio-core containers

func GetDefaultHumioHelperImageFromEnvVar

func GetDefaultHumioHelperImageFromEnvVar() string

GetDefaultHumioHelperImageFromEnvVar returns the user-defined default image for helper containers

func GetE2ELicenseFromEnvVar

func GetE2ELicenseFromEnvVar() string

GetE2ELicenseFromEnvVar returns the E2E license set as an environment variable

func GetTypeName

func GetTypeName(myvar interface{}) string

GetTypeName returns the name of the type of object which is obtained by using reflection

func Int32Ptr

func Int32Ptr(val int32) *int32

Int32Ptr returns a int pointer to the specified int32 value

func Int32PtrToFloat64Ptr

func Int32PtrToFloat64Ptr(val *int32) *float64

func Int64Ptr

func Int64Ptr(val int64) *int64

Int64Ptr returns a int64 pointer to the specified int64 value

func MapToSortedString

func MapToSortedString(m map[string]string) string

MapToSortedString prettifies a string map, so it's more suitable for readability when logging. The output is constructed by sorting the slice.

func NewLogger

func NewLogger() (*uberzap.Logger, error)

NewLogger returns a JSON logger with references to the origin of the log entry. All log entries also includes a field "ts" containing the timestamp in RFC3339 format.

func PreserveKindCluster

func PreserveKindCluster() bool

PreserveKindCluster returns true if the intention is to not delete kind cluster after test execution. This is to allow reruns of tests to be performed where resources can be reused.

func RemoveElement

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

RemoveElement returns a list where the element 's' has been removed

func StringPtr

func StringPtr(val string) *string

StringPtr returns a string pointer to the specified string value

func TLSEnabled

func TLSEnabled(hc *humiov1alpha1.HumioCluster) bool

TLSEnabled returns whether we a cluster should configure TLS or not

func UseCertManager

func UseCertManager() bool

UseCertManager returns whether the operator will use cert-manager

func UseDummyImage

func UseDummyImage() bool

UseDummyImage returns whether we are using a dummy image replacement instead of real container images

func UseEnvtest

func UseEnvtest() bool

UseEnvtest returns whether the Kubernetes API is provided by envtest

Types

type Cluster

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

func (Cluster) Config

func (c Cluster) Config() *humioapi.Config

Config returns the configuration that is currently set

func (Cluster) Name

func (c Cluster) Name() string

Name returns the name of the Humio cluster

func (Cluster) Url

func (c Cluster) Url(ctx context.Context, k8sClient client.Client) (*url.URL, error)

type ClusterInterface

type ClusterInterface interface {
	Url(context.Context, client.Client) (*url.URL, error)
	Name() string
	Config() *humioapi.Config
	// contains filtered or unexported methods
}

func NewCluster

func NewCluster(ctx context.Context, k8sClient client.Client, managedClusterName, externalClusterName, namespace string, certManagerEnabled bool, withPersonalAPIToken bool, withBootstrapToken bool) (ClusterInterface, error)

Jump to

Keyboard shortcuts

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