cache

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

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) Previews added in v0.4.0

func (c *Cache) Previews(doc string) []Object

Previews returns all cached service release artifacts that are defined as preview deployments.

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

Services returns all cached service release artifacts, including those of any preview deployments.

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) Domain added in v0.4.0

func (o Object) Domain(env string) string

Domain returns the hash based testing domain for preview deployments, or an empty string for any other main release and non-testing environment.

1d0fd508.lite.testing.splits.org

func (Object) Drift added in v0.4.3

func (o Object) Drift(rea bool) bool

Drift tries to detect a single valid state drift, in order to allow allow the operator chain to execute. Our current policy requires the following conditions to be true for a valid state drift using the ready flag. If the ready flag is false, then only the first three conditions are being evaluated. That way we can differentiate between ready and waiting state drift. Note that the set of waiting release artifacts may also contain ready release artifacts.

  1. the desired deployment must not be suspended

  2. the current and desired state must not be equal

  3. the desired state must not be empty

  4. the container image for the desired state must be pushed

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) Preview added in v0.4.1

func (o Object) Preview() bool

Preview returns whether this release artifact is for an automatically injected preview deployment. The determining factor here is whether a preview hash exists.

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