revision

package
v0.6.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const ControllerRevisionHashLabel = "controller.kubernetes.io/hash"

Variables

View Source
var PodCodec = scheme.Codecs.LegacyCodec(corev1.SchemeGroupVersion)

Functions

func EqualRevision

func EqualRevision(lhs *apps.ControllerRevision, rhs *apps.ControllerRevision) bool

EqualRevision returns true if lhs and rhs are either both nil, or both have same labels and annotations, or bath point to non-nil ControllerRevisions that contain semantically equivalent data. Otherwise this method returns false.

func FindEqualRevisions

func FindEqualRevisions(revisions []*apps.ControllerRevision, needle *apps.ControllerRevision) []*apps.ControllerRevision

FindEqualRevisions returns all ControllerRevisions in revisions that are equal to needle using EqualRevision as the equality test. The returned slice preserves the order of revisions.

func SortControllerRevisions

func SortControllerRevisions(revisions []*apps.ControllerRevision)

SortControllerRevisions sorts revisions by their Revision.

Types

type OwnerAdapter

type OwnerAdapter interface {
	GetSelector(obj metav1.Object) *metav1.LabelSelector
	GetCollisionCount(obj metav1.Object) *int32
	GetHistoryLimit(obj metav1.Object) int32
	GetPatch(obj metav1.Object) ([]byte, error)
	GetCurrentRevision(obj metav1.Object) string
	IsInUsed(obj metav1.Object, controllerRevision string) bool
}

type RevisionManager

type RevisionManager struct {
	client.Client
	// contains filtered or unexported fields
}

func NewRevisionManager

func NewRevisionManager(client client.Client, scheme *runtime.Scheme, ownerGetter OwnerAdapter) *RevisionManager

func (*RevisionManager) ConstructRevisions

ConstructRevisions returns the current and update ControllerRevisions for set. 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 set is detected. This method expects that revisions is sorted when supplied.

Jump to

Keyboard shortcuts

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