persistentvolume

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsInvalidConfig

func IsInvalidConfig(err error) bool

IsInvalidConfig asserts invalidConfigError.

func IsWrongTypeError

func IsWrongTypeError(err error) bool

IsWrongTypeError asserts wrongTypeError.

Types

type Config

type Config struct {
	K8sClient kubernetes.Interface
	Logger    micrologger.Logger
}

Config describes resource configuration.

type RecyclePersistentVolume

type RecyclePersistentVolume struct {
	Name         string
	State        apiv1.PersistentVolumePhase
	RecycleState string
}

RecyclePersistentVolume reflects PersistentVolume with additional RecycleState.

type Resource

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

Resource stores resource configuration.

func New

func New(config Config) (*Resource, error)

New is factory for resource objects.

func (*Resource) ApplyCreateChange

func (r *Resource) ApplyCreateChange(ctx context.Context, obj, deleteState interface{}) error

ApplyCreateChange is not used during persistent volume reconcile.

func (*Resource) ApplyDeleteChange

func (r *Resource) ApplyDeleteChange(ctx context.Context, obj, deleteState interface{}) error

ApplyDeleteChange represents delete patch logic.

func (*Resource) ApplyUpdateChange

func (r *Resource) ApplyUpdateChange(ctx context.Context, obj, updateState interface{}) error

ApplyUpdateChange represents update patch logic. All actions are based on combination of volume state and custom recycle state.

  • ReleasedRecycled - initial state of volume after claim is deleted; volume is recreated at this step
  • AvailableCleaning - volume ready for bounding to cleanup claim
  • BoundCleaning - volume claim is ready for mounting into cleanup job
  • BoundTeardown - waiting for leftovers to be cleaned up
  • ReleasedCleaning - volume claim was succesfully cleaned up, volume can be recreated
  • AvailableRecycled - desired state of the volume

func (*Resource) GetCurrentState

func (r *Resource) GetCurrentState(ctx context.Context, obj interface{}) (interface{}, error)

GetCurrentState returns current state of the recycled persistent volume.

func (*Resource) GetDesiredState

func (r *Resource) GetDesiredState(ctx context.Context, obj interface{}) (interface{}, error)

GetDesiredState returns desired state of the recycled persistent volume.

func (*Resource) Name

func (r *Resource) Name() string

Name returns name of the managed resource.

func (*Resource) NewCreatePatch

func (r *Resource) NewCreatePatch(ctx context.Context, obj, currentState, desiredState interface{}) (*crud.Patch, error)

NewCreatePatch is not used during persistent volume reconcile.

func (*Resource) NewDeletePatch

func (r *Resource) NewDeletePatch(ctx context.Context, obj, currentState, desiredState interface{}) (*crud.Patch, error)

NewDeletePatch returns patch to apply on deleted persistent volume.

func (*Resource) NewUpdatePatch

func (r *Resource) NewUpdatePatch(ctx context.Context, obj, currentState, desiredState interface{}) (*crud.Patch, error)

NewUpdatePatch returns patch to apply on updated persistent volume.

Jump to

Keyboard shortcuts

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