utils

package
v0.0.0-...-41dce0b Latest Latest
Warning

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

Go to latest
Published: May 1, 2020 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// RtObjectMap is a map of resource name to respective runtime object
	RtObjectMap map[string]runtime.Object
	// ResourceGetterMap is a map of resource name to resource Getter interface
	ResourceGetterMap map[string]cache.Getter
	// AllowedEventKindsMap is a map to filter valid event kinds
	AllowedEventKindsMap map[EventKind]bool
	// KubeClient is a global kubernetes client to communicate to apiserver
	KubeClient kubernetes.Interface
)

Functions

func GetClient

func GetClient() kubernetes.Interface

GetClient returns a k8s clientset to the request from inside of cluster

func GetClientOutOfCluster

func GetClientOutOfCluster(apiServerHost, kubeconfigPath string) kubernetes.Interface

GetClientOutOfCluster returns a k8s clientset to the request from outside of cluster

func GetObjectMetaData

func GetObjectMetaData(obj interface{}) metaV1.ObjectMeta

GetObjectMetaData returns metadata of the given object

func GetObjectTypeMetaData

func GetObjectTypeMetaData(obj interface{}) metaV1.TypeMeta

GetObjectTypeMetaData returns typemetadata of the given object

func Init

func Init(config config.Config)

func InitConfig

func InitConfig()

func Retry

func Retry(f func() error, describe string, attempts int, sleep int) error

Types

type EventKind

type EventKind struct {
	Resource  string
	Namespace string
}

EventKind used in AllowedEventKindsMap to filter event kinds

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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