resource

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidClient = errors.New("invalid client")

Functions

This section is empty.

Types

type Mock added in v0.5.1

type Mock struct {
	HasResourceResponseMock bool
	MockSleep               func(context.Context) error
	MockWakeUp              func(context.Context) error
	MockOriginalInfoToSave  func() ([]byte, error)
}

func (Mock) GetOriginalInfoToSave added in v0.5.1

func (r Mock) GetOriginalInfoToSave() ([]byte, error)

func (Mock) HasResource added in v0.5.1

func (r Mock) HasResource() bool

func (Mock) Sleep added in v0.5.1

func (r Mock) Sleep(ctx context.Context) error

func (Mock) WakeUp added in v0.5.1

func (r Mock) WakeUp(ctx context.Context) error

type Resource

type Resource interface {
	HasResource() bool
	Sleep(ctx context.Context) error
	WakeUp(ctx context.Context) error
	GetOriginalInfoToSave() ([]byte, error)
}

func GetResourceMock

func GetResourceMock(mock Mock) Resource

type ResourceClient

type ResourceClient struct {
	Client           client.Client
	SleepInfo        *kubegreenv1alpha1.SleepInfo
	Log              logr.Logger
	FieldManagerName string
}

func (ResourceClient) IsClientValid

func (r ResourceClient) IsClientValid() error

func (ResourceClient) Patch

func (r ResourceClient) Patch(ctx context.Context, oldObj, newObj client.Object) error

func (ResourceClient) SSAPatch

func (r ResourceClient) SSAPatch(ctx context.Context, newObj client.Object) error

Server Side Apply patch. Reference: https://kubernetes.io/docs/reference/using-api/server-side-apply/

Jump to

Keyboard shortcuts

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