Documentation
¶
Index ¶
- Variables
- func DefaultControllerRateLimiter[T comparable]() workqueue.TypedRateLimiter[T]
- func DeleteItemFromSlice[t any](x []t, index int) []t
- func Diff(expected, current any) string
- func DiffMapString(expected, current map[string]string, excludeKeys []string) string
- func DiffOwnerReferences(owner client.Object, object client.Object) (diff string, err error)
- func Get(m map[string]any, key string) (value any, err error)
- func GetKubeClientTimeoutFromEnv() (timeout time.Duration, err error)
- func GetLogrusFormatterFromEnv() logrus.Formatter
- func GetLogrusLogLevelFromEnv() logrus.Level
- func GetWatchNamespaceFromEnv() (ns string, err error)
- func GetZapFormatterFromDev() zapcore.Encoder
- func GetZapLogLevelFromEnv() zapcore.Level
- func HasCRD(kclient kubernetes.Interface, groupVersion schema.GroupVersion) bool
- func Merge(dst any, srcs ...any) (err error)
- func PrintVersion(logger logr.Logger, metricsAddr, probeAddr string)
- func RandomString(length int) string
- func StringToSlice(value, separator string) (result []string)
- func ToObject[srcType client.Object, dstType client.Object](o srcType) (res dstType)
- func ToSlice[srcType any](sList []*srcType) (res []srcType)
- func ToSliceOfObject[srcType client.Object, dstType client.Object](sList []srcType) (res []dstType)
- func ToSlicePtr[srcType any](sList []srcType) (res []*srcType)
- func UnZipBase64Decode(original string, originalObject any) error
- func ZipAndBase64Encode(originalObject any) (string, error)
Constants ¶
This section is empty.
Variables ¶
var ErrKeyNotFound error = errors.Sentinel("Key not found in map")
Functions ¶
func DefaultControllerRateLimiter ¶
func DefaultControllerRateLimiter[T comparable]() workqueue.TypedRateLimiter[T]
DefaultControllerRateLimiter is default rate limit to avoid burst the kubeapi-server
func DeleteItemFromSlice ¶
DeleteItemFromSlice is a generic function to remove item from a slice
func DiffMapString ¶
DiffMapString permit to diff map[string]string
func DiffOwnerReferences ¶ added in v2.0.9
DiffOwnerReferences permit to diff owner references
func GetZapFormatterFromDev ¶
func GetZapLogLevelFromEnv ¶
func HasCRD ¶
func HasCRD(kclient kubernetes.Interface, groupVersion schema.GroupVersion) bool
HasCRD checks if the Kubernetes server supports the given groupVersion for CustomResourceDefinition.
Parameters: - kclient: A pointer to a Kubernetes clientset. - groupVersion: The groupVersion of the CustomResourceDefinition to check.
Returns: - bool: True if the server supports the given groupVersion, false otherwise.
func Merge ¶
Merge permit to merge unlimited same interface. The last src is the higher priority If some src are nil, it skip it It return error if dst is nil
func PrintVersion ¶
func RandomString ¶
RandomString generates a random string from a subset of characters
func StringToSlice ¶
StringToSlice permit to convert string with separator to slice Is like strings.Split with trimSpaces each items
func ToSlice ¶ added in v2.0.1
func ToSlice[srcType any](sList []*srcType) (res []srcType)
ToSlice convert slice of pointer object to slice of object
func ToSliceOfObject ¶
ToSliceOfObject permit to convert any slice of object to slice of client.Object Slice must not contain pointer
func ToSlicePtr ¶ added in v2.0.1
func ToSlicePtr[srcType any](sList []srcType) (res []*srcType)
ToSlicePtr convert slice of object to slice of pointer object
func UnZipBase64Decode ¶
func ZipAndBase64Encode ¶
Types ¶
This section is empty.