runner

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2019 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MaxRunnerArtifactsAnnotation - annotation used by a user to specify the max artifacts to keep
	// in the runner directory. This will override the value provided by the watches file for a
	// particular CR. Setting this to zero will cause all artifact directories to be kept.
	// Example usage "ansible.operator-sdk/max-runner-artifacts: 100"
	MaxRunnerArtifactsAnnotation = "ansible.operator-sdk/max-runner-artifacts"
)

Variables

This section is empty.

Functions

func NewFromWatches

func NewFromWatches(path string) (map[schema.GroupVersionKind]Runner, error)

NewFromWatches reads the operator's config file at the provided path.

Types

type Finalizer

type Finalizer struct {
	Name     string                 `yaml:"name"`
	Playbook string                 `yaml:"playbook"`
	Role     string                 `yaml:"role"`
	Vars     map[string]interface{} `yaml:"vars"`
}

Finalizer - Expose finalizer to be used by a user.

type RunResult added in v0.2.0

type RunResult interface {
	// Stdout returns the stdout from ansible-runner if it is available, else an error.
	Stdout() (string, error)
	// Events returns the events from ansible-runner if it is available, else an error.
	Events() <-chan eventapi.JobEvent
}

RunResult - result of a ansible run

type Runner

type Runner interface {
	Run(string, *unstructured.Unstructured, string) (RunResult, error)
	GetFinalizer() (string, bool)
	GetReconcilePeriod() (time.Duration, bool)
	GetManageStatus() bool
	GetWatchDependentResources() bool
}

Runner - a runnable that should take the parameters and name and namespace and run the correct code.

func NewForPlaybook

func NewForPlaybook(path string, gvk schema.GroupVersionKind, finalizer *Finalizer, reconcilePeriod *time.Duration, manageStatus, dependentResources bool, maxArtifacts int) (Runner, error)

NewForPlaybook returns a new Runner based on the path to an ansible playbook.

func NewForRole

func NewForRole(path string, gvk schema.GroupVersionKind, finalizer *Finalizer, reconcilePeriod *time.Duration, manageStatus, dependentResources bool, maxArtifacts int) (Runner, error)

NewForRole returns a new Runner based on the path to an ansible role.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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