watches

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2021 License: Apache-2.0 Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package watches provides the structures and functions for mapping a GroupVersionKind to an Ansible playbook or role.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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 Watch

type Watch struct {
	GroupVersionKind            schema.GroupVersionKind   `yaml:",inline"`
	Blacklist                   []schema.GroupVersionKind `yaml:"blacklist"`
	Playbook                    string                    `yaml:"playbook"`
	Role                        string                    `yaml:"role"`
	Vars                        map[string]interface{}    `yaml:"vars"`
	MaxRunnerArtifacts          int                       `yaml:"maxRunnerArtifacts"`
	ReconcilePeriod             time.Duration             `yaml:"reconcilePeriod"`
	Finalizer                   *Finalizer                `yaml:"finalizer"`
	ManageStatus                bool                      `yaml:"manageStatus"`
	WatchDependentResources     bool                      `yaml:"watchDependentResources"`
	WatchClusterScopedResources bool                      `yaml:"watchClusterScopedResources"`
	SnakeCaseParameters         bool                      `yaml:"snakeCaseParameters"`
	Selector                    metav1.LabelSelector      `yaml:"selector"`

	// Not configurable via watches.yaml
	MaxConcurrentReconciles int `yaml:"-"`
	AnsibleVerbosity        int `yaml:"-"`
}

Watch - holds data used to create a mapping of GVK to ansible playbook or role. The mapping is used to compose an ansible operator.

func Load

func Load(path string, maxReconciler, ansibleVerbosity int) ([]Watch, error)

Load - loads a slice of Watches from the watches file from the CLI

func New

func New(gvk schema.GroupVersionKind, role, playbook string, vars map[string]interface{}, finalizer *Finalizer) *Watch

New - returns a Watch with sensible defaults.

func (*Watch) Validate

func (w *Watch) Validate() error

Validate - ensures that a Watch is valid A Watch is considered valid if it: - Specifies a valid path to a Role||Playbook - If a Finalizer is non-nil, it must have a name + valid path to a Role||Playbook or Vars

Jump to

Keyboard shortcuts

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