utils

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Btoi added in v0.8.0

func Btoi(b bool) int

Btoi converts boolean to int

func CRDInstalled added in v0.9.0

func CRDInstalled(discovery client.IDiscovery) bool

CRDInstalled to check if the CRD is installed or not

func Contains

func Contains(list []string, element string) bool

Contains Check if strint is contained in a list of string

func JSONsubsetValue

func JSONsubsetValue(a interface{}, b interface{}) bool

JSONsubsetValue checks if JSON a is contained in JSON b

func JoinPatches added in v0.8.0

func JoinPatches(patches [][]byte) []byte

JoinPatches joins array of serialized JSON patches to the single JSONPatch array

func NewKubeClient added in v0.8.0

func NewKubeClient(config *rest.Config) (kubernetes.Interface, error)

NewKubeClient returns a new kubernetes client

func NewKubeInformerFactory

func NewKubeInformerFactory(cfg *rest.Config) kubeinformers.SharedInformerFactory

NewKubeInformerFactory returns a kubeinformer

func SkipFilteredResources added in v0.7.0

func SkipFilteredResources(kind, namespace, name string, filterK8Resources []K8Resource) bool

SkipFilteredResources checks if the resource is to be skipped based on filtered kinds

func SkipFilteredResourcesReq added in v0.7.0

func SkipFilteredResourcesReq(request *v1beta1.AdmissionRequest, filterK8Resources []K8Resource) bool

SkipFilteredResourcesReq checks if request is to be skipped based on filtered kinds

Types

type K8Resource added in v0.7.0

type K8Resource struct {
	Kind      string //TODO: as we currently only support one GVK version, we use the kind only. But if we support multiple GVK, then GV need to be added
	Namespace string
	Name      string
}

func ParseKinds added in v0.7.0

func ParseKinds(list string) []K8Resource

ParseKinds parses the kinds if a single string contains comma seperated kinds {"1,2,3","4","5"} => {"1","2","3","4","5"}

Jump to

Keyboard shortcuts

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