apply

package
v0.1.15 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2018 License: Apache-2.0 Imports: 7 Imported by: 3

Documentation

Overview

Package apply implements state enforcer, which executes a list of actions to move from actual state to desired state, performing actual deployment of services and configuration of the underlying cloud components. As state gets enforced, it will configure the cloud to run new services/components, update existing services/components and delete services/components which are no longer needed.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EngineApply

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

EngineApply executes actions to get from an actual state to desired state

func NewEngineApply

func NewEngineApply(desiredPolicy *lang.Policy, desiredState *resolve.PolicyResolution, actualStateUpdater actual.StateUpdater, externalData *external.Data, plugins plugin.Registry, actionPlan *action.Plan, eventLog *event.Log, updater action.ApplyResultUpdater) *EngineApply

NewEngineApply creates an instance of EngineApply todo(slukjanov): make sure that plugins are created once per revision, b/c we need to cache only for single policy, when it changed some credentials could change as well todo(slukjanov): run cleanup on all plugins after apply done for the revision

func (*EngineApply) Apply

func (apply *EngineApply) Apply(maxConcurrentActions int) (*resolve.PolicyResolution, *action.ApplyResult)

Apply method executes all actions, actions call plugins to apply changes and roll them out to the cloud. It returns the updated actual state inside PolicyResolution and event log, as well as result/stats about how many actions have been applied successfully vs. failed vs. skipped.

As actions get executed, they will instantiate/update/delete components according to the resolved policy, as well as configure the underlying cloud components appropriately. In case of errors (e.g. cloud is not available), actual state may not be equal to desired state after performing all the actions.

Directories

Path Synopsis
Package action defines a base action (actions get born a result of policy diff calculation), as well as context which gets passed to all actions during apply phase.
Package action defines a base action (actions get born a result of policy diff calculation), as well as context which gets passed to all actions during apply phase.
component
Package component defines all component-specific actions, which get generated by the policy diff when component changes occur for specific component instances.
Package component defines all component-specific actions, which get generated by the policy diff when component changes occur for specific component instances.

Jump to

Keyboard shortcuts

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