apply

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2018 License: Apache-2.0 Imports: 10 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, actualState *resolve.PolicyResolution, actualStateUpdater actual.StateUpdater, externalData *external.Data, plugins plugin.Registry, actions []action.Base, eventLog *event.Log, progress progress.Indicator) *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() (*resolve.PolicyResolution, error)

Apply method executes all actions, actions call plugins to apply changes and roll them out to the cloud. It returns the updated actual state and event log. 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.
global
Package global defines a global post-processing action, which gets generated by the policy diff only once after processing all component instances.
Package global defines a global post-processing action, which gets generated by the policy diff only once after processing all component instances.

Jump to

Keyboard shortcuts

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