utils

package
v0.0.0-...-5af6bcd Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AppLabel       = "app.kubernetes.io/name"
	InstanceLabel  = "app.kubernetes.io/instance"
	ManagedByLabel = "app.kubernetes.io/managed-by"
	ComponentLabel = "app.kubernetes.io/component"
	VersionLabel   = "app.kubernetes.io/version"
	PartOfLabel    = "app.kubernetes.io/part-of"

	DefaultManagedByValue = "observability-operator"
)
View Source
const (
	DOMAIN_IMAGE_PATTERN = `^[a-zA-Z0-9-]+\.[a-zA-Z]{2,}(:[0-9]+)?$`
	IPV6_IMAGE_PATTERN   = `^\[[0-9a-fA-F:]+\](:[0-9]+)?$`
	IPV4_IMAGE_PATTERN   = `^(\d{1,3}\.){3}\d{1,3}(:[0-9]+)?$`
)

Variables

View Source
var (
	DOMAIN_IMAGE_REGEX = regexp.MustCompile(DOMAIN_IMAGE_PATTERN)
	IPV4_IMAGE_REGEX   = regexp.MustCompile(IPV4_IMAGE_PATTERN)
	IPV6_IMAGE_REGEX   = regexp.MustCompile(IPV6_IMAGE_PATTERN)
	PATHS              = "/"
)
View Source
var SelectorIgnoredLabels = []string{ManagedByLabel, VersionLabel, PartOfLabel}

Functions

func AppInstanceLabels

func AppInstanceLabels(instance, template, version string) map[string]string

func ComponentLabels

func ComponentLabels(instance, template, version, component string) map[string]string

func HasOnlySubDirectory

func HasOnlySubDirectory(parent, name string) (bool, error)

func IsNewerThan

func IsNewerThan(version, previous string) bool

func ShouldIgnoredInSelector

func ShouldIgnoredInSelector(key string) bool

func StringsContain

func StringsContain(values []string, search string) bool

StringsContain returns true if the search value is within the input values.

func StringsMap

func StringsMap(values []string) map[string]bool

StringsMap returns a map where keys are input values.

func UpdateImageRegistry

func UpdateImageRegistry(registry, image string) string

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