utils

package
v0.9.0-rc.3 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package utils contains set of utils functions

Index

Constants

View Source
const (
	// ResourceNamePromLabel refers to the resource name label key.
	ResourceNamePromLabel = "name"
	// ResourceNamespacePromLabel refers to the resource namespace label key.
	ResourceNamespacePromLabel = "namespace"
)

Variables

This section is empty.

Functions

func BuildInfoLabels

func BuildInfoLabels(obj *metav1.ObjectMeta) ([]string, []string)

BuildInfoLabels build the lists of label keys and values from the ObjectMeta Labels.

func ContainsString

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

ContainsString check if a slice contains a specific string.

func ConvertLabelSelector

func ConvertLabelSelector(logger logr.Logger, inSelector *metav1.LabelSelector) (labels.Selector, error)

ConvertLabelSelector converts a "k8s.io/apimachinery/pkg/apis/meta/v1".LabelSelector as found in manifests spec section into a "k8s.io/apimachinery/pkg/labels".Selector to be used to filter list operations.

func GetLabelsValues

func GetLabelsValues(obj *metav1.ObjectMeta) ([]string, []string)

GetLabelsValues returns name and namespace as label values.

func MaxInt

func MaxInt(val0 int, vals ...int) int

MaxInt returns the larger of x or y.

func MergeResult

func MergeResult(r1, r2 reconcile.Result) reconcile.Result

MergeResult use to merge two reconcile.Result struct.

func MinInt

func MinInt(val0 int, vals ...int) int

MinInt returns the larger of x or y.

func RemoveString

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

RemoveString remove a specifici string from a slice.

Types

This section is empty.

Directories

Path Synopsis
Package affinity contains Pod affinity functions helper.
Package affinity contains Pod affinity functions helper.
Package comparison contains object comparison functions.
Package comparison contains object comparison functions.
Package enqueue contains Object enqueue helpers.
Package enqueue contains Object enqueue helpers.
Package pod contains helper functions around Pod object.
Package pod contains helper functions around Pod object.

Jump to

Keyboard shortcuts

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