cloud

package
v0.0.0-...-b4d8713 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2017 License: Apache-2.0 Imports: 8 Imported by: 0

README

Reconciler

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AtomicReconciler

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

func (*AtomicReconciler) Actual

func (r *AtomicReconciler) Actual(known *cluster.Cluster) (actualCluster *cluster.Cluster, err error)

func (*AtomicReconciler) Destroy

func (r *AtomicReconciler) Destroy() (destroyedCluster *cluster.Cluster, err error)

func (*AtomicReconciler) Expected

func (r *AtomicReconciler) Expected(known *cluster.Cluster) (expectedCluster *cluster.Cluster, err error)

func (*AtomicReconciler) Reconcile

func (r *AtomicReconciler) Reconcile(actual, expected *cluster.Cluster) (reconciledCluster *cluster.Cluster, err error)

type Model

type Model interface {

	// Resources returns the mapped resources for the specific cloud implementation.
	Resources() map[int]Resource
}

Model is what maps an API to a set of cloud Resources.

type Reconciler

type Reconciler interface {

	// Actual will audit a cloud and return the API representation of the current resources in the cloud.
	Actual(known *cluster.Cluster) (actual *cluster.Cluster, err error)

	// Expected will audit a state store and return the API representation of the intended resources in the cloud.
	Expected(known *cluster.Cluster) (expected *cluster.Cluster, err error)

	// Reconcile will take an actual and expected API representation and attempt to ensure the intended state.
	Reconcile(actual, expected *cluster.Cluster) (reconciled *cluster.Cluster, err error)

	// Destroy will take an actual API representation and destroy the resources in the cloud.
	Destroy() (destroyed *cluster.Cluster, err error)
}

Reconciler will create and destroy infrastructure based on an intended state. A Reconciler will also audit the expected and actual state.

func NewAtomicReconciler

func NewAtomicReconciler(known *cluster.Cluster, model Model) Reconciler

type Resource

type Resource interface {

	// Actual will return the current existing resource in the cloud if it exists.
	Actual(known *cluster.Cluster) (actual *cluster.Cluster, resource Resource, err error)

	// Expected will return the anticipated cloud resource.
	Expected(known *cluster.Cluster) (expected *cluster.Cluster, resource Resource, err error)

	// Apply will create a cloud resource if needed.
	Apply(actual, expected Resource, expectedCluster *cluster.Cluster) (updatedCluster *cluster.Cluster, resource Resource, err error)

	// Delete will delete a cloud resource if needed.
	Delete(actual Resource, known *cluster.Cluster) (updatedCluster *cluster.Cluster, resource Resource, err error)
}

Resource represents a single cloud level resource that can be mutated. Resources are mapped via a model.

Directories

Path Synopsis
amazon
azure
digitalocean
google

Jump to

Keyboard shortcuts

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