pkg

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PointerTo

func PointerTo[T any](v T) *T

PointerTo returns a pointer to the given value.

func SetupDynamicClient

func SetupDynamicClient(kubeconfig *string) (dynamic.Interface, error)

SetupDynamicClient sets up a dynamic client

func SetupLogging

func SetupLogging(o io.Writer) *logrus.Logger

SetupLogging sets up the logging for the router daemon

func UpdateStatusField

func UpdateStatusField(obj *unstructured.Unstructured, field string, value interface{}) error

UpdateStatusField updates a field in the status of an object.

Types

type FixtureLoader

type FixtureLoader struct {
	Dynamic dynamic.Interface
	Log     *logrus.Logger
}

FixtureLoader loads fixtures

func SetupFixtureLoader

func SetupFixtureLoader(dynamic dynamic.Interface, log *logrus.Logger) *FixtureLoader

SetupFixtureLoader sets up a FixtureLoader

func (*FixtureLoader) CopyStatus

func (f *FixtureLoader) CopyStatus(src, dst *unstructured.Unstructured) error

CopyStatus copies the status from one object to another.

func (*FixtureLoader) CreateResourceDynamically

func (f *FixtureLoader) CreateResourceDynamically(ctx context.Context,
	r *ResourceInfo, obj unstructured.Unstructured) error

CreateResourceDynamically creates a resource in the cluster

func (*FixtureLoader) GetResourceDynamically

func (f *FixtureLoader) GetResourceDynamically(ctx context.Context, r *ResourceInfo) (*unstructured.Unstructured,
	error)

GetResourceDynamically returns a resource from the cluster

func (*FixtureLoader) StatusFieldLoad

func (f *FixtureLoader) StatusFieldLoad(ctx context.Context, ri *ResourceInfo, obj unstructured.Unstructured, field string) error

StatusFieldLoad gets the resouce from the cluster, copies the status from the given object to the object from the cluster and updates the resource in the cluster

func (*FixtureLoader) StatusLoad

StatusLoad gets the resouce from the cluster, copies the status from the given object to the object from the cluster and updates the resource in the cluster

func (*FixtureLoader) UpdateResourceStatusDynamically

func (f *FixtureLoader) UpdateResourceStatusDynamically(ctx context.Context,
	r *ResourceInfo, obj unstructured.Unstructured) error

UpdateResourceStatusDynamically updates a resource in the cluster. Note: it doesn't retry on conflict errors.

type ResourceInfo

type ResourceInfo struct {
	GVR            schema.GroupVersionResource
	NamespacedName types.NamespacedName
}

ResourceInfo holds the information about a resource

func GetResourceInfo

func GetResourceInfo(obj unstructured.Unstructured) *ResourceInfo

GetResourceInfo returns a ResourceInfo object for the given object

Jump to

Keyboard shortcuts

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