controller

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2018 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusPhaseCreating = "Creating"
	StatusPhaseRunning  = "Running"
	StatusPhaseFailed   = "Failed"
)
View Source
const (
	// ReconcilePeriodAnnotation - annotation used by a user to specify the reconcilation interval for the CR.
	// To use create a CR with an annotation "ansible.operator-sdk/reconcile-period: 30s" or some other valid
	// Duration. This will override the operators/or controllers reconcile period for that particular CR.
	ReconcilePeriodAnnotation = "ansible.operator-sdk/reconcile-period"
)

Variables

This section is empty.

Functions

func Add

func Add(mgr manager.Manager, options Options)

Add - Creates a new ansible operator controller and adds it to the manager

func IsStatusEqual

func IsStatusEqual(s1, s2 Status) bool

Types

type AnsibleOperatorReconciler

type AnsibleOperatorReconciler struct {
	GVK             schema.GroupVersionKind
	Runner          runner.Runner
	Client          client.Client
	EventHandlers   []events.EventHandler
	ReconcilePeriod time.Duration
}

AnsibleOperatorReconciler - object to reconcile runner requests

func (*AnsibleOperatorReconciler) Reconcile

Reconcile - handle the event.

type Options

type Options struct {
	EventHandlers   []events.EventHandler
	LoggingLevel    events.LogLevel
	Runner          runner.Runner
	GVK             schema.GroupVersionKind
	ReconcilePeriod time.Duration
}

Options - options for your controller

type ResourceStatus

type ResourceStatus struct {
	Status         `json:",inline"`
	Phase          string   `json:"phase"`
	FailureMessage string   `json:"reason,omitempty"`
	History        []Status `json:"history,omitempty"`
}

func UpdateResourceStatus

func UpdateResourceStatus(sm map[string]interface{}, je eventapi.StatusJobEvent) (bool, ResourceStatus)

type Status

type Status struct {
	Ok               int                `json:"ok"`
	Changed          int                `json:"changed"`
	Skipped          int                `json:"skipped"`
	Failures         int                `json:"failures"`
	TimeOfCompletion eventapi.EventTime `json:"completion"`
}

func NewStatusFromMap

func NewStatusFromMap(sm map[string]interface{}) Status

func NewStatusFromStatusJobEvent

func NewStatusFromStatusJobEvent(je eventapi.StatusJobEvent) Status

Jump to

Keyboard shortcuts

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