utils

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2018 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetGitTrackObjectCondition

GetGitTrackObjectCondition returns the condition with the provided type.

func NewGitTrackObjectCondition

func NewGitTrackObjectCondition(condType farosv1alpha1.GitTrackObjectConditionType, status v1.ConditionStatus, reason ConditionReason, message string) *farosv1alpha1.GitTrackObjectCondition

NewGitTrackObjectCondition creates a new GitTrackObject condition.

func RemoveGitTrackObjectCondition

func RemoveGitTrackObjectCondition(status *farosv1alpha1.GitTrackObjectStatus, condType farosv1alpha1.GitTrackObjectConditionType)

RemoveGitTrackObjectCondition removes the GitTrackObject condition with the provided type.

func SetGitTrackObjectCondition

func SetGitTrackObjectCondition(status *farosv1alpha1.GitTrackObjectStatus, condition farosv1alpha1.GitTrackObjectCondition)

SetGitTrackObjectCondition updates the GitTrackObject to include the provided condition. If the condition that we are about to add already exists and has the same status and reason then we are not going to update.

Types

type ConditionReason

type ConditionReason string

ConditionReason represents a valid condition reason

const (
	// ChildAppliedSuccess represents the condition reason when no error occurs
	// applying the child object
	ChildAppliedSuccess ConditionReason = "ChildAppliedSuccess"

	// ErrorAddingOwnerReference represents the condition reason when the child's
	// Owner reference cannot be set
	ErrorAddingOwnerReference ConditionReason = "ErrorAddingOwnerReference"

	// ErrorUnmarshallingData represents the condition reason when the object's
	// data cannot be unmarshalled
	ErrorUnmarshallingData ConditionReason = "ErrorUnmarshallingData"

	// ErrorCreatingChild represents the condition reason when the controller
	// hits an error trying to create the child
	ErrorCreatingChild ConditionReason = "ErrorCreatingChild"

	// ErrorGettingChild represents the condition reason when the controller
	// hits an error trying to get the child
	ErrorGettingChild ConditionReason = "ErrorGettingChild"

	// ErrorUpdatingChild represents the condition reason when the controller
	// hits an error trying to update the child
	ErrorUpdatingChild ConditionReason = "ErrorUpdatingChild"

	// ErrorWatchingChild represents the condition reason when the controller
	// cannot create an informer for the child's kind
	ErrorWatchingChild ConditionReason = "ErrorWatchingChild"
)

type EnqueueRequestForOwner

type EnqueueRequestForOwner struct {
	NamespacedEnqueueRequestForOwner    *handler.EnqueueRequestForOwner
	NonNamespacedEnqueueRequestForOwner *handler.EnqueueRequestForOwner
	RestMapper                          meta.RESTMapper
}

EnqueueRequestForOwner enqueues Requests for the Owners of an object. E.g. the object that created the object that was the source of the Event.

This implementation handles both namespaced and non-namespaced resources

func (*EnqueueRequestForOwner) Create

Create implements EventHandler

func (*EnqueueRequestForOwner) Delete

Delete implements EventHandler

func (*EnqueueRequestForOwner) Generic

Generic implements EventHandler

func (*EnqueueRequestForOwner) InjectScheme

func (e *EnqueueRequestForOwner) InjectScheme(s *runtime.Scheme) error

InjectScheme is called by the Controller to provide a singleton scheme to the EnqueueRequestForOwner.

func (*EnqueueRequestForOwner) Update

Update implements EventHandler

type UpdateStrategy

type UpdateStrategy string

UpdateStrategy represents a valid update strategy

const (
	// DefaultUpdateStrategy represents the default update strategy where a
	// resource should be updated in-place
	DefaultUpdateStrategy UpdateStrategy = "update"
	// NeverUpdateStrategy represents the update strategy where a resource should
	// never be updated
	NeverUpdateStrategy UpdateStrategy = "never"
	// RecreateUpdateStrategy represents the update strategy where a resource should
	// first be deleted and then created again, rather than updated in-place
	RecreateUpdateStrategy UpdateStrategy = "recreate"
)

func GetUpdateStrategy

func GetUpdateStrategy(obj *unstructured.Unstructured) (UpdateStrategy, error)

GetUpdateStrategy returns the value of the `faros.pusher.com/update-strategy` annotation, or the default value if one doesn't exist

Jump to

Keyboard shortcuts

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