policy

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package policy inspects and verifies any potential state drift in order to either allow the reconciliation loop to continue, or cancel it. Only valid state drifts can be applied within the underlying infrastructure.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Aws aws.Config
	Cac *cache.Cache
	Env envvar.Env
	Log logger.Interface
}

type Policy

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

func New

func New(c Config) *Policy

func (*Policy) Cancel

func (p *Policy) Cancel() bool

Cancel tells us whether it is safe to proceed with the next CloudFormation update this time around. Note that Cancel uses the stack cache that is being purged at the start of every reconciliation loop. Further note that any internal error causes Cancel to return true, which is meant to stop processing in case our understanding of the current state of the system is incomplete.

func (*Policy) Delete

func (p *Policy) Delete()

Delete purges the underlying local cache, causing Cancel to fetch the latest version of the stack object state again over network.

func (*Policy) Drift

func (p *Policy) Drift(rea bool) []cache.Object

Drift returns all cached artifact releases that have valid state drift according to the provided ready flag. In other words, the cache objects returned here indicate that their respective releases should be updated.

func (*Policy) Stack

func (p *Policy) Stack() (types.Stack, error)

Stack returns the state of the configured stack object and caches the first valid search result so that consecutive executions of Stack prevent network calls. This behaviour guarantees consistent stack object state within reconciliation loops.

func (*Policy) Update

func (p *Policy) Update() bool

Update determines whether the managed CloudFormation stack should be updated or not. We do not signal an update if the managed CloudFormation stack is already being updated, and if there is no detectable state drift.

Jump to

Keyboard shortcuts

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