Documentation ¶
Index ¶
- Variables
- func ApplyAll(ctx context.Context, cl client.Client, updates map[client.Object]Updater) error
- func Atoi32(s string) (int32, error)
- func B64Decode(s *core.Secret, key string) (string, error)
- func BoolPtr(b bool) *bool
- func Contains(list []string, s string) bool
- func CopySecret(ctx context.Context, client client.Client, srcSecretRef types.NamespacedName, ...) (*core.Secret, error)
- func FalsePtr() *bool
- func GetCustomLabeler(labels map[string]string, nn types.NamespacedName, baseResource client.Object) func(metav1.Object)
- func GetKindFromObj(scheme *runtime.Scheme, object runtime.Object) (schema.GroupVersionKind, error)
- func Int32(i int) (int32, error)
- func Int32Ptr(n int) *int32
- func Int64Ptr(n int64) *int64
- func IntMax(listStrInts []string) (string, error)
- func IntMin(listStrInts []string) (string, error)
- func IntPtr(i int) *int
- func ListMerge(listStrs []string) (string, error)
- func MakeLabeler(nn types.NamespacedName, labels map[string]string, obj client.Object) func(metav1.Object)
- func MakeOwnerReference(i client.Object) metav1.OwnerReference
- func MakePVC(pvc *core.PersistentVolumeClaim, nn types.NamespacedName, ...)
- func MakeService(service *core.Service, nn types.NamespacedName, labels map[string]string, ...)
- func RandHexString(n int) string
- func RandPassword(n int, charset ...string) (string, error)
- func RandString(n int) string
- func RandStringLower(n int) string
- func StringPtr(str string) *string
- func TruePtr() *bool
- func UpdateAllOrErr(ctx context.Context, cl client.Client, nn types.NamespacedName, ...) (map[client.Object]Updater, error)
- func UpdateAnnotations(obj MetaMutator, desiredAnnotations ...map[string]string)
- func UpdateLabels(obj MetaMutator, desiredLabels ...map[string]string)
- type MetaMutator
- type Updater
Constants ¶
This section is empty.
Variables ¶
var Log logr.Logger = logr.Discard()
Log is a null logger instance.
Functions ¶
func Atoi32 ¶
Atoi32 converts string to int32 in a safe way. You get error when the value is out of the 32-bit range.
This is a wrapper function of strconv.ParseInt.
func CopySecret ¶
func CopySecret(ctx context.Context, client client.Client, srcSecretRef types.NamespacedName, dstSecretRef types.NamespacedName) (*core.Secret, error)
CopySecret will return a *core.Secret that is copied from a source NamespaceName and intended to be applied into a destination NamespacedName
func GetCustomLabeler ¶
func GetCustomLabeler(labels map[string]string, nn types.NamespacedName, baseResource client.Object) func(metav1.Object)
// GetCustomLabeler takes a set of labels and returns a labeler function that // will apply those labels to a reource.
func GetKindFromObj ¶
GetKindFromObj retrieves GVK associated with registered runtime.Object
func Int32 ¶
Int32 converts int to int32 in a safe way. You get error when the value is out of the 32-bit range.
func MakeLabeler ¶
func MakeLabeler(nn types.NamespacedName, labels map[string]string, obj client.Object) func(metav1.Object)
MakeLabeler creates a function that will label objects with metadata from the given namespaced name and labels
func MakeOwnerReference ¶
func MakeOwnerReference(i client.Object) metav1.OwnerReference
func MakePVC ¶
func MakePVC(pvc *core.PersistentVolumeClaim, nn types.NamespacedName, labels map[string]string, size string, baseResource client.Object)
// MakePVC takes a PVC object and applies the correct ownership and labels to it.
func MakeService ¶
func MakeService(service *core.Service, nn types.NamespacedName, labels map[string]string, ports []core.ServicePort, baseResource client.Object, nodePort bool)
// MakeService takes a service object and applies the correct ownership and labels to it.
func RandHexString ¶ added in v0.8.0
RandString generates a random string of hexadecimal characters of length n
func RandPassword ¶ added in v0.5.6
RandString generates a random string of length n
func RandStringLower ¶ added in v0.5.4
RandStringLower generates a random string of length n
func UpdateAllOrErr ¶
func UpdateAllOrErr(ctx context.Context, cl client.Client, nn types.NamespacedName, obj ...client.Object) (map[client.Object]Updater, error)
UpdateAllOrErr queries the client for a range of objects and returns updater objects for each.
func UpdateAnnotations ¶ added in v0.5.4
func UpdateAnnotations(obj MetaMutator, desiredAnnotations ...map[string]string)
func UpdateLabels ¶ added in v0.5.8
func UpdateLabels(obj MetaMutator, desiredLabels ...map[string]string)
Types ¶
type MetaMutator ¶ added in v0.5.8
type Updater ¶
type Updater bool
Updater is a bool type object with functions attached that control when a resource should be created or applied.
func UpdateOrErr ¶
UpdateOrErr returns an update object if the err supplied is nil.