revision

package
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCurrentAndUpdate

func GetCurrentAndUpdate(
	ctx context.Context,
	group client.Object,
	component string,
	labels map[string]string,
	revisions []*appsv1.ControllerRevision,
	cli history.Interface,
	currentRevisionName string,
	currentCollisionCount *int32,
) (
	currentRevision *appsv1.ControllerRevision,
	updateRevision *appsv1.ControllerRevision,
	collisionCount int32,
	err error,
)

GetCurrentAndUpdate returns the current and update ControllerRevisions. It also returns a collision count that records the number of name collisions set saw when creating new ControllerRevisions. This count is incremented on every name collision and is used in building the ControllerRevision names for name collision avoidance. This method may create a new revision, or modify the Revision of an existing revision if an update to ComponentGroup is detected. This method expects that revisions is sorted when supplied.

func TruncateHistory

func TruncateHistory[T runtime.Instance](
	ctx context.Context,
	cli history.Interface,
	instances []T,
	revisions []*appsv1.ControllerRevision,
	updateRevision string,
	currentRevision string,
	limit *int32,
) error

TruncateHistory truncates any non-live ControllerRevisions in revisions from group's history. The UpdateRevision and CurrentRevision in group's Status are considered to be live. Any revisions associated with the Pods in pods are also considered to be live. Non-live revisions are deleted, starting with the revision with the lowest Revision, until only RevisionHistoryLimit revisions remain. This method expects that revisions is sorted when supplied.

Types

This section is empty.

Jump to

Keyboard shortcuts

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