ppnd

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsRequestingPause added in v0.9.0

func IsRequestingPause(pauseRequester PauseRequester, rollout client.Object) bool

func ProcessChildObjectWithPPND

func ProcessChildObjectWithPPND(ctx context.Context, k8sclient client.Client, rollout client.Object, pauseRequester PauseRequester,
	resourceNeedsUpdating bool, resourceIsUpdating bool, updateFunc func() error, enqueuePipelineFunc func(k8stypes.NamespacedName)) (bool, error)

process a child object, pausing pipelines or resuming pipelines if needed return: - true if done with PPND - error if any (note we'll automatically reuqueue if there's an error anyway)

Types

type PauseModule

type PauseModule struct {

	// map of pause requester to Pause Request
	PauseRequests map[string]*bool // having *bool gives us 3 states: [true=pause-required, false=pause-not-required, nil=unknown]
	// contains filtered or unexported fields
}

func GetPauseModule

func GetPauseModule() *PauseModule

func (*PauseModule) DeletePauseRequest

func (pm *PauseModule) DeletePauseRequest(requester string)

func (*PauseModule) GetISBServiceKey

func (pm *PauseModule) GetISBServiceKey(namespace string, name string) string

func (*PauseModule) GetNumaflowControllerKey

func (pm *PauseModule) GetNumaflowControllerKey(namespace string) string

func (*PauseModule) GetPauseRequest

func (pm *PauseModule) GetPauseRequest(requester string) (*bool, bool)

func (*PauseModule) NewPauseRequest

func (pm *PauseModule) NewPauseRequest(requester string)

func (*PauseModule) PausePipeline

func (pm *PauseModule) PausePipeline(ctx context.Context, c client.Client, pipeline *unstructured.Unstructured) error

pause pipeline

func (*PauseModule) RunPipelineIfSafe

func (pm *PauseModule) RunPipelineIfSafe(ctx context.Context, c client.Client, pipeline *unstructured.Unstructured) (bool, error)

resume pipeline lock the maps while we change pipeline lifecycle so nobody changes their pause request while we run; otherwise, they may think they are pausing the pipeline while it's running

func (*PauseModule) UpdatePauseRequest

func (pm *PauseModule) UpdatePauseRequest(requester string, pause bool) bool

update and return whether the value changed

func (*PauseModule) UpdatePipelineLifecycle

func (pm *PauseModule) UpdatePipelineLifecycle(ctx context.Context, c client.Client, pipeline *unstructured.Unstructured, phase string) error

type PauseRequester

type PauseRequester interface {
	// get the list of Pipelines corresponding to a Rollout
	GetPipelineList(ctx context.Context, rolloutNamespace string, rolloutName string) (*unstructured.UnstructuredList, error)

	// get the unique key corresponding to this Rollout
	GetRolloutKey(rolloutNamespace string, rolloutName string) string

	// just a free form string to describe what we're deploying, for logging
	GetChildTypeString() string
}

PauseRequester interface manages the safe update of Rollouts by requesting Pipelines to pause

Jump to

Keyboard shortcuts

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