util

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2020 License: Apache-2.0 Imports: 12 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnstructuredFieldNotFound = fmt.Errorf("field not found")
)

Functions

func GetInfrastructureProviderByName added in v1.0.1

func GetInfrastructureProviderByName(ctx context.Context, c client.Client, name string) (*machinev1.InfrastructureProvider, error)

GetInfrastructureProviderByName finds and return a InfrastructureProvider object using the specified params.

func GetMachineByName

func GetMachineByName(ctx context.Context, c client.Client, namespace, name string) (*machinev1.Machine, error)

GetMachineByName finds and return a Machine object using the specified params.

func GetOwnerInfrastructureProvider added in v1.0.1

func GetOwnerInfrastructureProvider(ctx context.Context, c client.Client, obj metav1.ObjectMeta) (*machinev1.InfrastructureProvider, error)

GetOwnerInfrastructureProvider returns the InfrastructureProvider object owning the current resource.

func GetOwnerMachine

func GetOwnerMachine(ctx context.Context, c client.Client, obj metav1.ObjectMeta) (*machinev1.Machine, error)

GetOwnerMachine returns the Machine object owning the current resource.

func MachineToInfrastructureMapFunc

func MachineToInfrastructureMapFunc(gvk schema.GroupVersionKind) handler.ToRequestsFunc

MachineToInfrastructureMapFunc returns a handler.ToRequestsFunc that watches for Machine events and returns reconciliation requests for an infrastructure provider object.

func UnstructuredUnmarshalField

func UnstructuredUnmarshalField(obj *unstructured.Unstructured, v interface{}, fields ...string) error

UnstructuredUnmarshalField is a wrapper around json and unstructured objects to decode and copy a specific field value into an object.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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