util

package
v0.0.0-...-c55d01b Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PanicLevel int = iota - 3
	ErrorLevel
	WarnLevel
	InfoLevel
	DebugLevel
)

Variables

This section is empty.

Functions

func AddFinalizer

func AddFinalizer(ctx context.Context, c client.Client, object client.Object, logger logr.Logger) error

func CheckIfRunning

func CheckIfRunning(ctx context.Context, cl client.Client, statefulSet *appsv1.StatefulSet, expectedReplicas int32) (bool, error)

func CreateOrGet

func CreateOrGet(ctx context.Context, c client.Client, key client.ObjectKey, obj client.Object) error

func DeleteObject

func DeleteObject(ctx context.Context, c client.Client, obj client.Object) error

func DeploymentName

func DeploymentName(podName string) string

func EnrichServiceNodePorts

func EnrichServiceNodePorts(newPorts []corev1.ServicePort, existing []corev1.ServicePort) []corev1.ServicePort

func GetExternalAddress

func GetExternalAddress(svc *corev1.Service) string

func GetExternalAddressesForMC

func GetExternalAddressesForMC(
	ctx context.Context,
	cli client.Client,
	cr ExternalAddresser,
	logger logr.Logger,
) []string

func GetLoadBalancerAddress

func GetLoadBalancerAddress(lb *corev1.LoadBalancerIngress) string

func IsDeveloperModeEnabled

func IsDeveloperModeEnabled() bool

func IsEnterprise

func IsEnterprise(repo string) bool

func IsPhoneHomeEnabled

func IsPhoneHomeEnabled() bool

func Labels

func Labels(cr ExternalAddresser) map[string]string

func ListRelatedServices

func ListRelatedServices(ctx context.Context, cli client.Client, cr ExternalAddresser) (*corev1.ServiceList, error)

func NodeDiscoveryEnabled

func NodeDiscoveryEnabled() bool

func OperatorID

func OperatorID(c *rest.Config) types.UID

func OperatorNamespace

func OperatorNamespace() string

func OperatorVersion

func OperatorVersion() string

func PardotID

func PardotID() string

func RandString

func RandString(length int) string

func WatchedNamespaces

func WatchedNamespaces() []string

Types

type ExternalAddresser

type ExternalAddresser interface {
	metav1.Object
	ExternalAddressEnabled() bool
}

type PodError

type PodError struct {
	Name         string
	Namespace    string
	Message      string
	Reason       string
	PodIp        string
	RestartCount int32
}

func NewPodError

func NewPodError(pod *corev1.Pod) *PodError

func NewPodErrorWithContainerStatus

func NewPodErrorWithContainerStatus(pod *corev1.Pod, status corev1.ContainerStatus) *PodError

func (*PodError) Error

func (e *PodError) Error() string

type PodErrors

type PodErrors []*PodError

func AsPodErrors

func AsPodErrors(err error) (PodErrors, bool)

AsPodErrors tries to transform err to PodErrors and return it with true. If it is not possible nil and false is returned.

func (PodErrors) Error

func (es PodErrors) Error() string

type WatchedNsType

type WatchedNsType string
const (
	WatchedNsTypeAll    WatchedNsType = "All"
	WatchedNsTypeMulti  WatchedNsType = "Multi"
	WatchedNsTypeSingle WatchedNsType = "Single"
	WatchedNsTypeOwn    WatchedNsType = "Own"
)

func WatchedNamespaceType

func WatchedNamespaceType(operatorNamespace string, watchedNamespaces []string) WatchedNsType

Jump to

Keyboard shortcuts

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