machineautoscaler

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2018 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MachineTargetFinalizer is the finalizer added to MachineAutoscaler
	// instances to allow for cleanup of annotations on target resources.
	MachineTargetFinalizer = "machinetarget.autoscaling.openshift.io"
)

Variables

View Source
var ErrTargetMissingAnnotations = errors.New("missing min or max annotation")

ErrTargetMissingAnnotations is the error returned when a target is missing the min or max annotations.

View Source
var ErrUnsupportedTarget = errors.New("unsupported MachineAutoscaler target")

ErrUnsupportedTarget is the error returned when a target references an object with an unsupported GroupVersionKind.

View Source
var SupportedTargetGVKs = []schema.GroupVersionKind{
	{Group: "cluster.k8s.io", Version: "v1alpha1", Kind: "MachineSet"},
}

SupportedTargetGVKs is the list of GroupVersionKinds supported as targers for a MachineAutocaler instance.

Functions

func SupportedTarget

func SupportedTarget(gvk schema.GroupVersionKind) bool

SupportedTarget indicates whether a GVK is supported as a target.

Types

type MachineTarget

type MachineTarget struct {
	unstructured.Unstructured
}

MachineTarget represents an unstructured target object for a MachineAutoscaler, used to update metadata only.

func (*MachineTarget) GetLimits

func (mt *MachineTarget) GetLimits() (min, max int, err error)

GetLimits returns the target's min and max limits. An error may be returned if the annotations's contents could not be parsed as ints.

func (*MachineTarget) NeedsUpdate

func (mt *MachineTarget) NeedsUpdate(min, max int) bool

NeedsUpdate indicates whether a target needs to be updates to match the given min and max values. An error may be returned if there was an error parsing the current values.

func (*MachineTarget) RemoveLimits

func (mt *MachineTarget) RemoveLimits()

RemoveLimits removes the target's min and max annotations.

func (*MachineTarget) SetLimits

func (mt *MachineTarget) SetLimits(min, max int)

SetLimits sets the target's min and max annotations.

type Reconciler

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

Reconciler reconciles a MachineAutoscaler object

func NewReconciler

func NewReconciler(mgr manager.Manager) *Reconciler

NewReconciler returns a new Reconciler.

func (*Reconciler) AddToManager

func (r *Reconciler) AddToManager(mgr manager.Manager) error

AddToManager adds a new Controller to mgr with r as the reconcile.Reconciler

func (*Reconciler) EnsureFinalizer

func (r *Reconciler) EnsureFinalizer(ma *autoscalingv1alpha1.MachineAutoscaler) error

EnsureFinalizer adds finalizers to the given MachineAutoscaler if necessary.

func (*Reconciler) FinalizeTarget

func (r *Reconciler) FinalizeTarget(target *MachineTarget) error

FinalizeTarget handles finalizers for the given target.

func (*Reconciler) GetTarget

GetTarget fetches the object targeted by the given MachineAutoscaler.

func (*Reconciler) Reconcile

func (r *Reconciler) Reconcile(request reconcile.Request) (reconcile.Result, error)

Reconcile reads that state of the cluster for a MachineAutoscaler object and makes changes based on the state read and what is in the MachineAutoscaler.Spec

func (*Reconciler) RemoveFinalizer

func (r *Reconciler) RemoveFinalizer(ma *autoscalingv1alpha1.MachineAutoscaler) error

RemoveFinalizer removes this packages's finalizers from the given MachineAutoscaler instance.

func (*Reconciler) UpdateTarget

func (r *Reconciler) UpdateTarget(target *MachineTarget, min, max int) error

UpdateTarget updates the min and max annotations on the given target.

Jump to

Keyboard shortcuts

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