resourcebuilder

package
v0.0.0-...-a45fa12 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2019 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Mapper is default ResourceMapper.
	Mapper = NewResourceMapper()
)

Functions

func WaitForJobCompletion

func WaitForJobCompletion(ctx context.Context, client batchclientv1.JobsGetter, job *batchv1.Job) error

WaitForJobCompletion waits for job to complete.

Types

type Interface

type Interface interface {
	WithModifier(MetaV1ObjectModifierFunc) Interface
	WithMode(Mode) Interface
	Do(context.Context) error
}

func New

func New(mapper *ResourceMapper, rest *rest.Config, m lib.Manifest) (Interface, error)

New returns Interface using the mapping stored in mapper for m Manifest.

type MetaV1ObjectModifierFunc

type MetaV1ObjectModifierFunc func(metav1.Object)

type Mode

type Mode int

Mode is how this builder is being used.

const (
	UpdatingMode Mode = iota
	ReconcilingMode
	InitializingMode
)

type NewInteraceFunc

type NewInteraceFunc func(rest *rest.Config, m lib.Manifest) Interface

NewInteraceFunc returns an Interface. It requires rest Config that can be used to create a client and the Manifest.

type ResourceMapper

type ResourceMapper struct {
	// contains filtered or unexported fields
}

ResourceMapper maps {Group, Version} to a function that returns Interface and an error.

func NewResourceMapper

func NewResourceMapper() *ResourceMapper

NewResourceMapper returns a new map. This is required a we cannot push to uninitialized map.

func (*ResourceMapper) AddToMap

func (rm *ResourceMapper) AddToMap(irm *ResourceMapper)

AddToMap adds all keys from caller to input. Locks the input ResourceMapper before adding the keys from caller.

func (*ResourceMapper) Exists

func (rm *ResourceMapper) Exists(gvk schema.GroupVersionKind) bool

Exist returns true when gvk is known.

func (*ResourceMapper) RegisterGVK

func (rm *ResourceMapper) RegisterGVK(gvk schema.GroupVersionKind, f NewInteraceFunc)

RegisterGVK adds GVK to NewInteraceFunc mapping. It does not lock before adding the mapping.

type RetryLaterError

type RetryLaterError struct {
	Message string
}

RetryLaterError instructs the resource can't be reconciled right now, so retry later.

func (*RetryLaterError) Error

func (e *RetryLaterError) Error() string

Jump to

Keyboard shortcuts

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