utils

package
v0.5.34 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertMapInterfaceMapString

func ConvertMapInterfaceMapString(v interface{}) interface{}

ConvertMapInterfaceMapString converts map[interface{}]interface{} => map[string]interface{}

It will also convert []interface{} => []string

func CreateK8sResource

func CreateK8sResource(
	client dynamic.Interface,
	group,
	version,
	resource string,
	object interface{},
	force bool,
) error

CreateK8sResource takes a dynamic client and resource info and tries to create that resource.

If a resource already exists and has the label controller set to "meshery" then it will try to update the resource.

If a resource exists but does not have the label then the function will return an error however if force parameter is set to true then it will replace that resource with a new resource with the appropriate labels

It will add labels to the resources:

"controller": "meshery"
"source" : "pattern"

func CreateNamespace

func CreateNamespace(client dynamic.Interface, namespace string) error

func DeleteK8sResource

func DeleteK8sResource(
	client dynamic.Interface,
	group,
	version,
	resource,
	namespace,
	name string,
) error

DeleteK8sResouce deletes the given kubernetes resource

func RecursiveCastMapStringInterfaceToMapStringInterface

func RecursiveCastMapStringInterfaceToMapStringInterface(in map[string]interface{}) map[string]interface{}

RecursiveCastMapStringInterfaceToMapStringInterface will convert a map[string]interface{} recursively => map[string]interface{}

Types

This section is empty.

Jump to

Keyboard shortcuts

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