namer

package
v1.0.16 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CrToSS added in v0.20.0

func CrToSS(crName string) string

func PodBelongsToStatefulset added in v0.20.1

func PodBelongsToStatefulset(pod *types.NamespacedName, ssName *types.NamespacedName) (error, bool, int)

This function returns whether a pod belongs to a statefulset and if so, also returns the pod's number attached to its name It depends on the naming convention between a statefulset and its pods: The pods always take the form <ssName>-<n>, where <ssName> is the owning statefulset name and <n> is a non-negative numerical number. for example if a statefulset's name is "ex-aao-ss", it's pod name should be "ex-aao-ss-0", or "ex-aao-ss-1" and so on so forth. Note: the statefulset and pod must be in the same namespace.

func SSToCr added in v0.20.1

func SSToCr(ssName string) string

Types

type NamerData

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

func (*NamerData) Base

func (n *NamerData) Base(baseName string) *NamerData

func (*NamerData) Generate

func (n *NamerData) Generate()

func (*NamerData) Name

func (n *NamerData) Name() string

func (*NamerData) Prefix

func (n *NamerData) Prefix(namePrefix string) *NamerData

func (*NamerData) SetName added in v1.0.11

func (n *NamerData) SetName(override string)

func (*NamerData) Suffix

func (n *NamerData) Suffix(nameSuffix string) *NamerData

type NamerInterface

type NamerInterface interface {
	Name() string
	Base(baseName string) *NamerData
	Prefix(namePrefix string) *NamerData
	Suffix(nameSuffix string) *NamerData
	Generate()
}

Jump to

Keyboard shortcuts

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