cache

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Infrastructure kind = "infrastructure"
	Service        kind = "service"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

Cache represents the dumb pipes connecting our business logic across different boundary conditions by providing critical information required to make the entire operator chain work as expected. The operator's worker handler is executed constantly in an interval, but the real work may only be done if the cached information about the specific release artifacts provided deeper down the stack is sufficient. E.g. an empty cache result may cause some business logic to be skipped temporarily, or cause the reconciliation loop to be cancelled entirely.

func New

func New(c Config) *Cache

func (*Cache) Create

func (c *Cache) Create(rel release.Slice) error

func (*Cache) Delete

func (c *Cache) Delete()

func (*Cache) Infrastructure added in v0.1.1

func (c *Cache) Infrastructure() Object

func (*Cache) Releases added in v0.1.1

func (c *Cache) Releases() []Object

func (*Cache) Services added in v0.1.1

func (c *Cache) Services() []Object

func (*Cache) Update

func (c *Cache) Update(obj Object)

type Config added in v0.1.1

type Config struct {
	// Frc is to forcefully trigger an infrastructure deployment, regardless of
	// any detectable state drift. This option should be used with caution. E.g.
	// the command "kayron daemon" should never allow to apply this trigger flag
	// within Kayron's normal reconciliation loop.
	Frc bool

	Log logger.Interface
}

type Object added in v0.1.1

type Object struct {
	Artifact artifact.Struct
	Release  release.Struct
	// contains filtered or unexported fields
}

Object combines the associated artifact and release information in one addressable cache object. The artifact information are written and the release information are read throughout the reconciliation loops.

func (Object) Name added in v0.2.0

func (o Object) Name() string

func (Object) Parameter added in v0.1.2

func (o Object) Parameter() string

Parameter returns the CloudFormation stack parameter key for this release artifact. The parameter keys generated here have to be supported in the CloudFormation template being deployed, e.g. InfrastructureVersion, SpectaVersion.

func (Object) Version added in v0.2.1

func (o Object) Version() string

Version returns the desired state of this artifact's release version if the following two conditions are true. Failed artifact conditions and deployment suspensions will then yield the artifact version of the scheduler's current state.

  1. the artifact condition must be true

  2. the deployment strategy must not be suspended

E.g. we may observe the new version of a service v0.5.0, for which there does no docker image exist yet. In this case we defer to the old version v0.4.0, which is currently deployed. Once the docker image for v0.5.0 has been confirmed inside of the underlying container registry, we will yield the new desired version.

Jump to

Keyboard shortcuts

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