helpers

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MongoFinalizerName = "mongo.task.finalizers.operator.kube-stager.io"
	MysqlFinalizerName = "mysql.task.finalizers.operator.kube-stager.io"
	SiteFinalizerName  = "stagingsite.site.finalizers.operator.kube-stager.io"
)

Variables

This section is empty.

Functions

func GetKeysFromStringBoolMap

func GetKeysFromStringBoolMap(v map[string]bool) []string

func GetTemplateVariables added in v0.2.2

func GetTemplateVariables(templates ...TemplateValueGetter) []string

func GetUnresolvedTemplatesFromString

func GetUnresolvedTemplatesFromString(s string) []string

func MakeObjectName

func MakeObjectName(baseName string, suffixes ...string) string

func RemoveStringFromSlice

func RemoveStringFromSlice(slice []string, s string) (result []string)

func ReplaceTemplateVariablesInIngressSpec

func ReplaceTemplateVariablesInIngressSpec(
	spec networkingv1.IngressSpec,
	templates ...TemplateValueGetter,
) (networkingv1.IngressSpec, error)

func ReplaceTemplateVariablesInPodSpec

func ReplaceTemplateVariablesInPodSpec(spec corev1.PodSpec, templates ...TemplateValueGetter) (corev1.PodSpec, error)

func ReplaceTemplateVariablesInServiceSpec

func ReplaceTemplateVariablesInServiceSpec(
	spec corev1.ServiceSpec,
	templates ...TemplateValueGetter,
) (corev1.ServiceSpec, error)

func ReplaceTemplateVariablesInString

func ReplaceTemplateVariablesInString(s string, templates ...TemplateValueGetter) string

func ReplaceTemplateVariablesInStringMap

func ReplaceTemplateVariablesInStringMap(
	stringMap map[string]string,
	entityType string,
	templates ...TemplateValueGetter,
) (map[string]string, error)

func SanitiseAndShortenDbValue

func SanitiseAndShortenDbValue(value string, maxLength int) string

func SanitiseDbValue

func SanitiseDbValue(value string) string

func ShortenHumanReadableValue

func ShortenHumanReadableValue(value string, maxLength int) string

func SliceContainsString

func SliceContainsString(slice []string, s string) bool

Types

type StringMapTemplateValueGetter

type StringMapTemplateValueGetter struct {
	StringMap map[string]string
}

func (StringMapTemplateValueGetter) GetTemplateValues

func (r StringMapTemplateValueGetter) GetTemplateValues() map[string]string

type TemplateValueGetter

type TemplateValueGetter interface {
	GetTemplateValues() map[string]string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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