strategy

package
v0.8.7 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package strategy dispatches a DeploymentIntent across the Runtime/Strategy axis: which backend to deploy to (Kubernetes, ECS, Knative) and, once a backend is chosen, which rollout strategy to run there (Rolling, BlueGreen).

In this domain, Kubernetes/ECS/Knative are themselves deployment strategies, not a separate runtime layer sitting above strategy — so RuntimeProvider (the Runtime switch) and each backend's own strategy dispatch (K8SStrategy's Rolling/BlueGreen switch, plus the ECS/Knative placeholders) live together in this one package rather than being split across "runtime" and "strategy" packages.

This package only decides *which* strategy runs; the actual object apply/teardown work is delegated to pkg/apis/deployment/api (e.g. K8SStrategy wraps api.K8SProvider and calls its ApplyServiceUnit).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ECSReconciler

type ECSReconciler struct {
	Log    logr.Logger
	Scheme *runtime.Scheme
}

ECSReconciler is a placeholder for the ECS runtime backend — not yet implemented (see RuntimeProvider.Execute).

func NewECSReconciler

func NewECSReconciler(scheme *runtime.Scheme, log logr.Logger) *ECSReconciler

NewECSReconciler constructs an ECSReconciler.

func (*ECSReconciler) Reconcile

Reconcile executes a ServiceUnitIntent on ECS

type K8SStrategy

type K8SStrategy struct {
	K8S *api.K8SProvider
	Log logr.Logger
}

K8SStrategy dispatches a DeploymentIntent's Strategy (Rolling, BlueGreen) against the Kubernetes runtime, delegating the actual object apply/ teardown to api.K8SProvider.

func NewK8SStrategy

func NewK8SStrategy(k8s *api.K8SProvider, log logr.Logger) *K8SStrategy

NewK8SStrategy constructs a K8SStrategy wrapping the given K8SProvider.

func (*K8SStrategy) Execute

Execute dispatches dIntent's rollout strategy (Rolling, BlueGreen) to the matching apply path, delegating the actual object apply to K8S.

func (*K8SStrategy) Runtime

func (s *K8SStrategy) Runtime() intent.Runtime

Runtime reports that K8SStrategy handles intent.RuntimeKubernetes.

func (*K8SStrategy) Supports

func (s *K8SStrategy) Supports(
	strategy intent.Strategy,
) bool

Supports reports whether K8SStrategy can run the given rollout strategy (only Rolling and BlueGreen).

func (*K8SStrategy) Teardown

func (s *K8SStrategy) Teardown(
	ctx context.Context,
	dIntent *intent.DeploymentIntent,
) error

Teardown delegates to K8S.Teardown, deleting the Kubernetes Deployment and Service objects this strategy applied for dIntent.

type KnativeReconciler

type KnativeReconciler struct {
	Client client.Client
	Scheme *runtime.Scheme
	Log    logr.Logger
}

KnativeReconciler is a placeholder for the Knative runtime backend — not yet implemented (see RuntimeProvider.Execute).

func NewKnativeReconciler

func NewKnativeReconciler(c client.Client, scheme *runtime.Scheme, log logr.Logger) *KnativeReconciler

NewKnativeReconciler constructs a KnativeReconciler.

type RuntimeProvider

type RuntimeProvider struct {
	Client client.Client
	Scheme *runtime.Scheme
	Log    logr.Logger
	K8S    *K8SStrategy
}

RuntimeProvider dispatches a DeploymentIntent's Runtime (Kubernetes, Knative, ECS) to the strategy that implements it. Runtime and Strategy are the same axis in this domain — which runtime to deploy to is itself a deployment strategy choice — so this and K8SStrategy live together in this package, not split across a separate "runtime" concept.

func NewRuntimeProvider

func NewRuntimeProvider(c client.Client, scheme *runtime.Scheme, log logr.Logger, Recorder events.EventRecorder) *RuntimeProvider

NewRuntimeProvider constructs a RuntimeProvider, wiring up its K8S strategy from the given clients.

func (*RuntimeProvider) Execute

Execute dispatches dIntent to the strategy implementing its Runtime. Knative and ECS are recognized but not yet implemented.

func (*RuntimeProvider) Teardown

func (p *RuntimeProvider) Teardown(
	ctx context.Context,
	dIntent *intent.DeploymentIntent,
) error

Teardown dispatches dIntent to the strategy implementing its Runtime, mirroring Execute's dispatch. Knative and ECS are recognized but not yet implemented.

Jump to

Keyboard shortcuts

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