instancecontrol

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2025 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputeHash

func ComputeHash(obj interface{}) string

ComputeHash returns a hash value calculated from pod template and a collisionCount to avoid hash collision. The hash will be safe encoded to avoid bad words.

Inspired by: https://github.com/kubernetes/kubernetes/blob/8aae5398b3885dc271d407c4d661e19653daaf88/pkg/controller/controller_utils.go#L1295

func DeepHashObject

func DeepHashObject(hasher hash.Hash, objectToWrite interface{})

DeepHashObject writes specified object to hash using the spew library which follows pointers and prints actual values of the nested objects ensuring the hash does not change when a pointer changes.

Types

type Action

type Action struct {
	Object client.Object
	// contains filtered or unexported fields
}

func NewCreateAction

func NewCreateAction(object client.Object) Action

func NewDeleteAction

func NewDeleteAction(object client.Object) Action

func NewUpdateAction

func NewUpdateAction(object client.Object) Action

func NewWaitAction

func NewWaitAction(object client.Object) Action

func (Action) ActionType

func (a Action) ActionType() ActionType

func (Action) Execute

func (a Action) Execute(ctx context.Context, c client.Client) error

func (Action) IsSkipped

func (a Action) IsSkipped() bool

func (*Action) SkipExecution

func (a *Action) SkipExecution()

type ActionType

type ActionType string
const (
	ActionTypeCreate ActionType = "Create"
	ActionTypeUpdate ActionType = "Update"
	ActionTypeDelete ActionType = "Delete"
	ActionTypeWait   ActionType = "Wait"
)

type SchedulingGate

type SchedulingGate string
const (
	NetworkSchedulingGate SchedulingGate = "Network"
)

func (SchedulingGate) String

func (s SchedulingGate) String() string

type Strategy

type Strategy interface {
	// GetActions returns a set of actions that should be taken in order to drive
	// the workload deployment to the desired state. Some actions may be informational,
	// such as providing context into pending actions when instance management
	// policies may require waiting for pod readiness.
	GetActions(
		ctx context.Context,
		scheme *runtime.Scheme,
		deployment *v1alpha.WorkloadDeployment,
		currentInstances []v1alpha.Instance,
	) ([]Action, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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