Documentation ¶
Index ¶
- Variables
- func AsOwner(r client.Object, controller ...bool) metav1.OwnerReference
- func CleanerNanoid(n int) string
- func Contains[T comparable](arr []T, item T) bool
- func ContainsAll[T comparable](arr []T, items []T) bool
- func ContainsAllWithPredicate[T comparable, K comparable](arr []T, items []T, predicate func(item T) K) bool
- func ContainsFinalizers(obj client.Object, finalizers ...string) bool
- func DefaultIfNil[T any](v *T) T
- func DeleteAndWait[T client.Object](ctx context.Context, logger logging.Logger, kcli client.Client, resources ...T) error
- func Exec(command ...string) (err error, stdout *bytes.Buffer, stderr *bytes.Buffer)
- func Filter[T comparable](from []T, items []T, filterFunc func(fromItem T, targetItem T) bool) []T
- func FilterObservabilityAnnotations(ann map[string]string) map[string]string
- func ForceDelete[T client.Object](ctx context.Context, logger logging.Logger, kcli client.Client, resources ...T) error
- func GVK(obj client.Object) metav1.GroupVersionKind
- func HasOwner(obj client.Object) bool
- func IfThenElse[T any](cond bool, v T, y T) T
- func IfThenElseFn[T any](cond bool, v1 func() T, v2 func() T) T
- func IntoMap(value any, targetMap any) error
- func IsOwner(obj client.Object, ownerRef metav1.OwnerReference) bool
- func JsonConvert[T any](from any) (T, error)
- func Kubectl(args ...string) (stdout *bytes.Buffer, err error)
- func KubectlApply(ctx context.Context, cli client.Client, obj client.Object) error
- func KubectlApplyExec(ctx context.Context, stdin ...[]byte) (err error)
- func KubectlDelete(namespace, resourceRef string) error
- func KubectlGet(namespace string, resourceRef string) ([]byte, error)
- func MapContains[T comparable](destination map[string]T, source map[string]T) bool
- func MapEqual[K comparable, V comparable](first map[K]V, second map[K]V) bool
- func MapFilter[K string, V any](m map[K]V, filters ...func(k K, v V) bool) map[K]V
- func MapFilterWithPrefix[K string, V any](m map[K]V, keyPrefix string) map[K]V
- func MapHasKey[K comparable, V any](m map[K]V, key K) bool
- func MapJoin[K comparable, V any](first *map[K]V, second map[K]V)
- func MapKeys[K comparable, V any](m map[K]V) []K
- func MapMerge[K comparable, V any](source ...map[K]V) map[K]V
- func MapSet[T any](m *map[string]T, key string, value T)
- func MapValues[K comparable, V any](m map[K]V) []V
- func Md5(b []byte) string
- func NN(namespace, name string) types.NamespacedName
- func New[T any](v T) *T
- func NewUnstructured(t metav1.TypeMeta, m ...metav1.ObjectMeta) *unstructured.Unstructured
- func ParseFromMap[T any, K any](m map[string]K) (*T, error)
- func ParseFromSecret[T any](secret *corev1.Secret) (*T, error)
- func ParseFromSecretData[T any](m map[string][]byte) (*T, error)
- func ParseGVK(apiVersion string, kind string) schema.GroupVersionKind
- func Ptr[T any](v T) *T
- func RegularPlural(singular string) string
- func RolloutRestart(c client.Client, kind Restartable, namespace string, labels map[string]string) error
- func Sha1Sum(b []byte) string
- func ToBase64StringFromJson(v interface{}) (string, error)
- type JsonFeatures
- type Restartable
Constants ¶
This section is empty.
Variables ¶
View Source
var Json = &jsonFeatures{}
Functions ¶
func CleanerNanoid ¶
func Contains ¶
func Contains[T comparable](arr []T, item T) bool
func ContainsAll ¶
func ContainsAll[T comparable](arr []T, items []T) bool
func ContainsAllWithPredicate ¶
func ContainsAllWithPredicate[T comparable, K comparable](arr []T, items []T, predicate func(item T) K) bool
func DefaultIfNil ¶
func DefaultIfNil[T any](v *T) T
func DeleteAndWait ¶
func Filter ¶
func Filter[T comparable](from []T, items []T, filterFunc func(fromItem T, targetItem T) bool) []T
func ForceDelete ¶ added in v1.1.0
func IfThenElse ¶
func IfThenElseFn ¶
func JsonConvert ¶
func KubectlApply ¶
func KubectlDelete ¶
func MapContains ¶
func MapContains[T comparable](destination map[string]T, source map[string]T) bool
MapContains checks if `destination` contains all keys from `source`
func MapEqual ¶
func MapEqual[K comparable, V comparable](first map[K]V, second map[K]V) bool
func MapFilterWithPrefix ¶ added in v1.1.0
func MapHasKey ¶
func MapHasKey[K comparable, V any](m map[K]V, key K) bool
func MapJoin ¶ added in v1.1.0
func MapJoin[K comparable, V any](first *map[K]V, second map[K]V)
func MapKeys ¶
func MapKeys[K comparable, V any](m map[K]V) []K
func MapMerge ¶ added in v1.0.2
func MapMerge[K comparable, V any](source ...map[K]V) map[K]V
func MapValues ¶
func MapValues[K comparable, V any](m map[K]V) []V
func NN ¶
func NN(namespace, name string) types.NamespacedName
func NewUnstructured ¶
func NewUnstructured(t metav1.TypeMeta, m ...metav1.ObjectMeta) *unstructured.Unstructured
func ParseFromSecretData ¶ added in v1.1.0
func RegularPlural ¶
RegularPlural is used to pluralize group of k8s CRDs from kind It is copied from https://github.com/kubernetes-sigs/kubebuilder/blob/afce6a0e8c2a6d5682be07bbe502e728dd619714/pkg/model/resource/utils.go#L71
func RolloutRestart ¶
func ToBase64StringFromJson ¶
Types ¶
type JsonFeatures ¶
type Restartable ¶
type Restartable string
const ( Deployment Restartable = "deployment" StatefulSet Restartable = "statefulset" )
Click to show internal directories.
Click to hide internal directories.