resourcebuilder

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2019 License: Apache-2.0 Imports: 29 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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