utils

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains added in v0.13.0

func Contains(a []string, x string) bool

Contains tells whether a contains x.

func DeleteDoubleWhiteSpace added in v0.8.0

func DeleteDoubleWhiteSpace(slice []string) []string

DeleteDoubleWhiteSpace returns slice that removing whitespace from a arg slice

func Diff added in v0.13.0

func Diff(x, y interface{}, updateSetting config.UpdateSetting) (string, error)

Diff provides differences between two objects spec

func ExtractAnnotationsFromEvent added in v0.13.0

func ExtractAnnotationsFromEvent(ctx context.Context, dynamicCli dynamic.Interface, mapper meta.RESTMapper, obj *coreV1.Event) (map[string]string, error)

ExtractAnnotationsFromEvent returns annotations of InvolvedObject for the given event

func GVRToString added in v0.13.0

func GVRToString(gvr schema.GroupVersionResource) string

GVRToString converts GVR formats to string

func GetClusterNameFromKubectlCmd added in v0.13.0

func GetClusterNameFromKubectlCmd(cmd string) string

GetClusterNameFromKubectlCmd this will return cluster name from kubectl command

func GetObjectMetaData

func GetObjectMetaData(ctx context.Context, dynamicCli dynamic.Interface, mapper meta.RESTMapper, obj interface{}) (metaV1.ObjectMeta, error)

GetObjectMetaData returns metadata of the given object

func GetObjectTypeMetaData

func GetObjectTypeMetaData(obj interface{}) metaV1.TypeMeta

GetObjectTypeMetaData returns typemetadata of the given object

func GetResourceFromKind added in v0.13.0

func GetResourceFromKind(mapper meta.RESTMapper, gvk schema.GroupVersionKind) (schema.GroupVersionResource, error)

GetResourceFromKind returns resource name for given Kind

func RemoveHyperlink(hyperlink string) string

RemoveHyperlink removes the hyperlink text from url

func StructDumper added in v0.14.0

func StructDumper() litter.Options

StructDumper default dumper for structs

func TransformIntoTypedObject added in v0.13.0

func TransformIntoTypedObject(obj *unstructured.Unstructured, typedObject interface{}) error

TransformIntoTypedObject uses unstructured interface and creates a typed object

Types

This section is empty.

Jump to

Keyboard shortcuts

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