Documentation
¶
Index ¶
- Constants
- Variables
- func ComputeHash(template *orchestrationv1alpha1.RayClusterTemplateSpec, collisionCount *int32) string
- func DeepHashObject(hasher hash.Hash, objectToWrite interface{})
- func DeploymentComplete(deployment *orchestrationv1alpha1.RayClusterFleet, ...) bool
- func DeploymentProgressing(deployment *orchestrationv1alpha1.RayClusterFleet, ...) bool
- func DeploymentTimedOut(ctx context.Context, deployment *orchestrationv1alpha1.RayClusterFleet, ...) bool
- func EqualIgnoreLabels(template1, template2 *orchestrationv1alpha1.RayClusterTemplateSpec) bool
- func FilterActiveReplicaSets(replicaSets []*orchestrationv1alpha1.RayClusterReplicaSet) []*orchestrationv1alpha1.RayClusterReplicaSet
- func FilterReplicaSets(RSes []*orchestrationv1alpha1.RayClusterReplicaSet, filterFn filterRS) []*orchestrationv1alpha1.RayClusterReplicaSet
- func FindActiveOrLatest(newRS *orchestrationv1alpha1.RayClusterReplicaSet, ...) *orchestrationv1alpha1.RayClusterReplicaSet
- func FindNewReplicaSet(fleet *orchestrationv1alpha1.RayClusterFleet, ...) *orchestrationv1alpha1.RayClusterReplicaSet
- func FindOldReplicaSets(deployment *orchestrationv1alpha1.RayClusterFleet, ...) ([]*orchestrationv1alpha1.RayClusterReplicaSet, ...)
- func GetActualReplicaCountForReplicaSets(replicaSets []*orchestrationv1alpha1.RayClusterReplicaSet) int32
- func GetAvailableReplicaCountForReplicaSets(replicaSets []*orchestrationv1alpha1.RayClusterReplicaSet) int32
- func GetDeploymentCondition(status orchestrationv1alpha1.RayClusterFleetStatus, ...) *orchestrationv1alpha1.RayClusterFleetCondition
- func GetDeploymentsForReplicaSet(c client.Client, rs *orchestrationv1alpha1.RayClusterReplicaSet) ([]*orchestrationv1alpha1.RayClusterFleet, error)
- func GetDesiredReplicasAnnotation(logger klog.Logger, rs *orchestrationv1alpha1.RayClusterReplicaSet) (int32, bool)
- func GetProportion(logger klog.Logger, rs *orchestrationv1alpha1.RayClusterReplicaSet, ...) int32
- func GetReadyReplicaCountForReplicaSets(replicaSets []*orchestrationv1alpha1.RayClusterReplicaSet) int32
- func GetReplicaCountForReplicaSets(replicaSets []*orchestrationv1alpha1.RayClusterReplicaSet) int32
- func HasProgressDeadline(d *orchestrationv1alpha1.RayClusterFleet) bool
- func HasRevisionHistoryLimit(d *orchestrationv1alpha1.RayClusterFleet) bool
- func IsRollingUpdate(deployment *orchestrationv1alpha1.RayClusterFleet) bool
- func IsSaturated(deployment *orchestrationv1alpha1.RayClusterFleet, ...) bool
- func LastRevision(logger klog.Logger, allRSs []*orchestrationv1alpha1.RayClusterReplicaSet) int64
- func ListPods(deployment *orchestrationv1alpha1.RayClusterFleet, ...) (*v1.PodList, error)
- func ListReplicaSets(deployment *orchestrationv1alpha1.RayClusterFleet, getRSList RsListFunc) ([]*orchestrationv1alpha1.RayClusterReplicaSet, error)
- func MaxRevision(logger klog.Logger, allRSs []*orchestrationv1alpha1.RayClusterReplicaSet) int64
- func MaxSurge(deployment orchestrationv1alpha1.RayClusterFleet) int32
- func MaxUnavailable(deployment orchestrationv1alpha1.RayClusterFleet) int32
- func MinAvailable(deployment *orchestrationv1alpha1.RayClusterFleet) int32
- func NewDeploymentCondition(condType orchestrationv1alpha1.RayClusterFleetConditionType, ...) *orchestrationv1alpha1.RayClusterFleetCondition
- func NewRSNewReplicas(deployment *orchestrationv1alpha1.RayClusterFleet, ...) (int32, error)
- func RemoveDeploymentCondition(status *orchestrationv1alpha1.RayClusterFleetStatus, ...)
- func ReplicaSetToDeploymentCondition(cond metav1.Condition) orchestrationv1alpha1.RayClusterFleetCondition
- func ReplicasAnnotationsNeedUpdate(rs *orchestrationv1alpha1.RayClusterReplicaSet, ...) bool
- func ResolveFenceposts(maxSurge, maxUnavailable *intstrutil.IntOrString, desired int32) (int32, int32, error)
- func Revision(obj runtime.Object) (int64, error)
- func SetDeploymentAnnotationsTo(deployment *orchestrationv1alpha1.RayClusterFleet, ...)
- func SetDeploymentCondition(status *orchestrationv1alpha1.RayClusterFleetStatus, ...)
- func SetDeploymentRevision(fleet *orchestrationv1alpha1.RayClusterFleet, revision string) bool
- func SetFromReplicaSetTemplate(fleet *orchestrationv1alpha1.RayClusterFleet, ...) *orchestrationv1alpha1.RayClusterFleet
- func SetNewReplicaSetAnnotations(ctx context.Context, deployment *orchestrationv1alpha1.RayClusterFleet, ...) bool
- func SetReplicasAnnotations(rs *orchestrationv1alpha1.RayClusterReplicaSet, ...) bool
- func WaitForObservedDeployment(getDeploymentFunc func() (*orchestrationv1alpha1.RayClusterFleet, error), ...) error
- type ReplicaSetsByCreationTimestamp
- type ReplicaSetsByRevision
- type ReplicaSetsBySizeNewer
- type ReplicaSetsBySizeOlder
- type RsListFunc
Constants ¶
const ( // RevisionAnnotation is the revision annotation of a deployment's replica sets which records its rollout sequence RevisionAnnotation = "deployment.kubernetes.io/revision" // RevisionHistoryAnnotation maintains the history of all old revisions that a replica set has served for a deployment. RevisionHistoryAnnotation = "deployment.kubernetes.io/revision-history" // DesiredReplicasAnnotation is the desired replicas for a deployment recorded as an annotation // in its replica sets. Helps in separating scaling events from the rollout process and for // determining if the new replica set for a deployment is really saturated. DesiredReplicasAnnotation = "deployment.kubernetes.io/desired-replicas" // MaxReplicasAnnotation is the maximum replicas a deployment can have at a given point, which // is deployment.spec.replicas + maxSurge. Used by the underlying replica sets to estimate their // proportions in case the deployment has surge replicas. MaxReplicasAnnotation = "deployment.kubernetes.io/max-replicas" // RollbackRevisionNotFound is not found rollback event reason RollbackRevisionNotFound = "DeploymentRollbackRevisionNotFound" // RollbackTemplateUnchanged is the template unchanged rollback event reason RollbackTemplateUnchanged = "DeploymentRollbackTemplateUnchanged" // RollbackDone is the done rollback event reason RollbackDone = "DeploymentRollback" // ReplicaSetUpdatedReason is added in a deployment when one of its replica sets is updated as part // of the rollout process. ReplicaSetUpdatedReason = "ReplicaSetUpdated" // FailedRSCreateReason is added in a deployment when it cannot create a new replica set. FailedRSCreateReason = "ReplicaSetCreateError" // NewReplicaSetReason is added in a deployment when it creates a new replica set. NewReplicaSetReason = "NewReplicaSetCreated" // FoundNewRSReason is added in a deployment when it adopts an existing replica set. FoundNewRSReason = "FoundNewReplicaSet" // NewRSAvailableReason is added in a deployment when its newest replica set is made available // ie. the number of new pods that have passed readiness checks and run for at least minReadySeconds // is at least the minimum available pods that need to run for the deployment. NewRSAvailableReason = "NewReplicaSetAvailable" // TimedOutReason is added in a deployment when its newest replica set fails to show any progress // within the given deadline (progressDeadlineSeconds). TimedOutReason = "ProgressDeadlineExceeded" // PausedDeployReason is added in a deployment when it is paused. Lack of progress shouldn't be // estimated once a deployment is paused. PausedDeployReason = "DeploymentPaused" // ResumedDeployReason is added in a deployment when it is resumed. Useful for not failing accidentally // deployments that paused amidst a rollout and are bounded by a deadline. ResumedDeployReason = "DeploymentResumed" // MinimumReplicasAvailable is added in a deployment when it has its minimum replicas required available. MinimumReplicasAvailable = "MinimumReplicasAvailable" // available. MinimumReplicasUnavailable = "MinimumReplicasUnavailable" // Set name label will record the rayclusterfleet name that those Pods belong to. SetNameLabelKey string = "orchestration.aibrix.ai/raycluster-fleet-name" )
Variables ¶
var NowFn = func() time.Time { return time.Now() }
used for unit testing
Functions ¶
func ComputeHash ¶
func ComputeHash(template *orchestrationv1alpha1.RayClusterTemplateSpec, collisionCount *int32) 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.
func DeepHashObject ¶
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. Copied from k8s.io/kubernetes/pkg/util/hash/hash.go#DeepHashObject
func DeploymentComplete ¶
func DeploymentComplete(deployment *orchestrationv1alpha1.RayClusterFleet, newStatus *orchestrationv1alpha1.RayClusterFleetStatus) bool
DeploymentComplete considers a deployment to be complete once all of its desired replicas are updated and available, and no old pods are running.
func DeploymentProgressing ¶
func DeploymentProgressing(deployment *orchestrationv1alpha1.RayClusterFleet, newStatus *orchestrationv1alpha1.RayClusterFleetStatus) bool
DeploymentProgressing reports progress for a deployment. Progress is estimated by comparing the current with the new status of the deployment that the controller is observing. More specifically, when new pods are scaled up or become ready or available, or old pods are scaled down, then we consider the deployment is progressing.
func DeploymentTimedOut ¶
func DeploymentTimedOut(ctx context.Context, deployment *orchestrationv1alpha1.RayClusterFleet, newStatus *orchestrationv1alpha1.RayClusterFleetStatus) bool
DeploymentTimedOut considers a deployment to have timed out once its condition that reports progress is older than progressDeadlineSeconds or a Progressing condition with a TimedOutReason reason already exists.
func EqualIgnoreLabels ¶
func EqualIgnoreLabels(template1, template2 *orchestrationv1alpha1.RayClusterTemplateSpec) bool
EqualIgnoreLabels returns true if two given podTemplateSpec are equal, ignoring the diff in value of Labels[pod-template-hash] and Labels[orchestration.aibrix.ai/raycluster-fleet-name]. We ignore pod-template-hash and orchestration.aibrix.ai/raycluster-fleet-name, because:
- The hash result would be different upon podTemplateSpec API changes (e.g. the addition of a new field will cause the hash code to change)
- The deployment template won't have hash and fleet name labels
func FilterActiveReplicaSets ¶
func FilterActiveReplicaSets(replicaSets []*orchestrationv1alpha1.RayClusterReplicaSet) []*orchestrationv1alpha1.RayClusterReplicaSet
FilterActiveReplicaSets returns replica sets that have (or at least ought to have) pods.
func FilterReplicaSets ¶
func FilterReplicaSets(RSes []*orchestrationv1alpha1.RayClusterReplicaSet, filterFn filterRS) []*orchestrationv1alpha1.RayClusterReplicaSet
FilterReplicaSets returns replica sets that are filtered by filterFn (all returned ones should match filterFn).
func FindActiveOrLatest ¶
func FindActiveOrLatest(newRS *orchestrationv1alpha1.RayClusterReplicaSet, oldRSs []*orchestrationv1alpha1.RayClusterReplicaSet) *orchestrationv1alpha1.RayClusterReplicaSet
FindActiveOrLatest returns the only active or the latest replica set in case there is at most one active replica set. If there are more active replica sets, then we should proportionally scale them.
func FindNewReplicaSet ¶
func FindNewReplicaSet(fleet *orchestrationv1alpha1.RayClusterFleet, rsList []*orchestrationv1alpha1.RayClusterReplicaSet) *orchestrationv1alpha1.RayClusterReplicaSet
FindNewReplicaSet returns the new RS this given deployment targets (the one with the same pod template).
func FindOldReplicaSets ¶
func FindOldReplicaSets(deployment *orchestrationv1alpha1.RayClusterFleet, rsList []*orchestrationv1alpha1.RayClusterReplicaSet) ([]*orchestrationv1alpha1.RayClusterReplicaSet, []*orchestrationv1alpha1.RayClusterReplicaSet)
FindOldReplicaSets returns the old replica sets targeted by the given Deployment, with the given slice of RSes. Note that the first set of old replica sets doesn't include the ones with no pods, and the second set of old replica sets include all old replica sets.
func GetActualReplicaCountForReplicaSets ¶
func GetActualReplicaCountForReplicaSets(replicaSets []*orchestrationv1alpha1.RayClusterReplicaSet) int32
GetActualReplicaCountForReplicaSets returns the sum of actual replicas of the given replica sets.
func GetAvailableReplicaCountForReplicaSets ¶
func GetAvailableReplicaCountForReplicaSets(replicaSets []*orchestrationv1alpha1.RayClusterReplicaSet) int32
GetAvailableReplicaCountForReplicaSets returns the number of available pods corresponding to the given replica sets.
func GetDeploymentCondition ¶
func GetDeploymentCondition(status orchestrationv1alpha1.RayClusterFleetStatus, condType orchestrationv1alpha1.RayClusterFleetConditionType) *orchestrationv1alpha1.RayClusterFleetCondition
GetDeploymentCondition returns the condition with the provided type.
func GetDeploymentsForReplicaSet ¶
func GetDeploymentsForReplicaSet(c client.Client, rs *orchestrationv1alpha1.RayClusterReplicaSet) ([]*orchestrationv1alpha1.RayClusterFleet, error)
GetDeploymentsForReplicaSet returns a list of Deployments that potentially match a ReplicaSet. Only the one specified in the ReplicaSet's ControllerRef will actually manage it. Returns an error only if no matching Deployments are found.
func GetDesiredReplicasAnnotation ¶
func GetDesiredReplicasAnnotation(logger klog.Logger, rs *orchestrationv1alpha1.RayClusterReplicaSet) (int32, bool)
GetDesiredReplicasAnnotation returns the number of desired replicas
func GetProportion ¶
func GetProportion(logger klog.Logger, rs *orchestrationv1alpha1.RayClusterReplicaSet, d orchestrationv1alpha1.RayClusterFleet, deploymentReplicasToAdd, deploymentReplicasAdded int32) int32
GetProportion will estimate the proportion for the provided replica set using 1. the current size of the parent deployment, 2. the replica count that needs be added on the replica sets of the deployment, and 3. the total replicas added in the replica sets of the deployment so far.
func GetReadyReplicaCountForReplicaSets ¶
func GetReadyReplicaCountForReplicaSets(replicaSets []*orchestrationv1alpha1.RayClusterReplicaSet) int32
GetReadyReplicaCountForReplicaSets returns the number of ready pods corresponding to the given replica sets.
func GetReplicaCountForReplicaSets ¶
func GetReplicaCountForReplicaSets(replicaSets []*orchestrationv1alpha1.RayClusterReplicaSet) int32
GetReplicaCountForReplicaSets returns the sum of Replicas of the given replica sets.
func HasProgressDeadline ¶
func HasProgressDeadline(d *orchestrationv1alpha1.RayClusterFleet) bool
HasProgressDeadline checks if the Deployment d is expected to surface the reason "ProgressDeadlineExceeded" when the Deployment progress takes longer than expected time.
func HasRevisionHistoryLimit ¶
func HasRevisionHistoryLimit(d *orchestrationv1alpha1.RayClusterFleet) bool
HasRevisionHistoryLimit checks if the Deployment d is expected to keep a specified number of old replicaSets. These replicaSets are mainly kept with the purpose of rollback. The RevisionHistoryLimit can start from 0 (no retained replicasSet). When set to math.MaxInt32, the Deployment will keep all revisions.
func IsRollingUpdate ¶
func IsRollingUpdate(deployment *orchestrationv1alpha1.RayClusterFleet) bool
IsRollingUpdate returns true if the strategy type is a rolling update.
func IsSaturated ¶
func IsSaturated(deployment *orchestrationv1alpha1.RayClusterFleet, rs *orchestrationv1alpha1.RayClusterReplicaSet) bool
IsSaturated checks if the new replica set is saturated by comparing its size with its deployment size. Both the deployment and the replica set have to believe this replica set can own all of the desired replicas in the deployment and the annotation helps in achieving that. All pods of the ReplicaSet need to be available.
func LastRevision ¶
func LastRevision(logger klog.Logger, allRSs []*orchestrationv1alpha1.RayClusterReplicaSet) int64
LastRevision finds the second max revision number in all replica sets (the last revision)
func ListPods ¶
func ListPods(deployment *orchestrationv1alpha1.RayClusterFleet, rsList []*orchestrationv1alpha1.RayClusterReplicaSet, getPodList podListFunc) (*v1.PodList, error)
ListPods returns a list of pods the given deployment targets. This needs a list of ReplicaSets for the Deployment, which can be found with ListReplicaSets(). Note that this does NOT attempt to reconcile ControllerRef (adopt/orphan), because only the controller itself should do that. However, it does filter out anything whose ControllerRef doesn't match.
func ListReplicaSets ¶
func ListReplicaSets(deployment *orchestrationv1alpha1.RayClusterFleet, getRSList RsListFunc) ([]*orchestrationv1alpha1.RayClusterReplicaSet, error)
ListReplicaSets returns a slice of RSes the given deployment targets. Note that this does NOT attempt to reconcile ControllerRef (adopt/orphan), because only the controller itself should do that. However, it does filter out anything whose ControllerRef doesn't match.
func MaxRevision ¶
func MaxRevision(logger klog.Logger, allRSs []*orchestrationv1alpha1.RayClusterReplicaSet) int64
MaxRevision finds the highest revision in the replica sets
func MaxSurge ¶
func MaxSurge(deployment orchestrationv1alpha1.RayClusterFleet) int32
MaxSurge returns the maximum surge pods a rolling deployment can take.
func MaxUnavailable ¶
func MaxUnavailable(deployment orchestrationv1alpha1.RayClusterFleet) int32
MaxUnavailable returns the maximum unavailable pods a rolling deployment can take.
func MinAvailable ¶
func MinAvailable(deployment *orchestrationv1alpha1.RayClusterFleet) int32
MinAvailable returns the minimum available pods of a given deployment
func NewDeploymentCondition ¶
func NewDeploymentCondition(condType orchestrationv1alpha1.RayClusterFleetConditionType, status v1.ConditionStatus, reason, message string) *orchestrationv1alpha1.RayClusterFleetCondition
NewDeploymentCondition creates a new deployment condition.
func NewRSNewReplicas ¶
func NewRSNewReplicas(deployment *orchestrationv1alpha1.RayClusterFleet, allRSs []*orchestrationv1alpha1.RayClusterReplicaSet, newRS *orchestrationv1alpha1.RayClusterReplicaSet) (int32, error)
NewRSNewReplicas calculates the number of replicas a deployment's new RS should have. When one of the followings is true, we're rolling out the deployment; otherwise, we're scaling it. 1) The new RS is saturated: newRS's replicas == deployment's replicas 2) Max number of pods allowed is reached: deployment's replicas + maxSurge == all RSs' replicas
func RemoveDeploymentCondition ¶
func RemoveDeploymentCondition(status *orchestrationv1alpha1.RayClusterFleetStatus, condType orchestrationv1alpha1.RayClusterFleetConditionType)
RemoveDeploymentCondition removes the deployment condition with the provided type.
func ReplicaSetToDeploymentCondition ¶
func ReplicaSetToDeploymentCondition(cond metav1.Condition) orchestrationv1alpha1.RayClusterFleetCondition
ReplicaSetToDeploymentCondition converts a replica set condition into a deployment condition. Useful for promoting replica set failure conditions into deployments.
func ReplicasAnnotationsNeedUpdate ¶
func ReplicasAnnotationsNeedUpdate(rs *orchestrationv1alpha1.RayClusterReplicaSet, desiredReplicas, maxReplicas int32) bool
ReplicasAnnotationsNeedUpdate return true if ReplicasAnnotations need to be updated
func ResolveFenceposts ¶
func ResolveFenceposts(maxSurge, maxUnavailable *intstrutil.IntOrString, desired int32) (int32, int32, error)
ResolveFenceposts resolves both maxSurge and maxUnavailable. This needs to happen in one step. For example:
2 desired, max unavailable 1%, surge 0% - should scale old(-1), then new(+1), then old(-1), then new(+1) 1 desired, max unavailable 1%, surge 0% - should scale old(-1), then new(+1) 2 desired, max unavailable 25%, surge 1% - should scale new(+1), then old(-1), then new(+1), then old(-1) 1 desired, max unavailable 25%, surge 1% - should scale new(+1), then old(-1) 2 desired, max unavailable 0%, surge 1% - should scale new(+1), then old(-1), then new(+1), then old(-1) 1 desired, max unavailable 0%, surge 1% - should scale new(+1), then old(-1)
func SetDeploymentAnnotationsTo ¶
func SetDeploymentAnnotationsTo(deployment *orchestrationv1alpha1.RayClusterFleet, rollbackToRS *orchestrationv1alpha1.RayClusterReplicaSet)
SetDeploymentAnnotationsTo sets deployment's annotations as given RS's annotations. This action should be done if and only if the deployment is rolling back to this rs. Note that apply and revision annotations are not changed.
func SetDeploymentCondition ¶
func SetDeploymentCondition(status *orchestrationv1alpha1.RayClusterFleetStatus, condition orchestrationv1alpha1.RayClusterFleetCondition)
SetDeploymentCondition updates the deployment to include the provided condition. If the condition that we are about to add already exists and has the same status and reason then we are not going to update.
func SetDeploymentRevision ¶
func SetDeploymentRevision(fleet *orchestrationv1alpha1.RayClusterFleet, revision string) bool
SetDeploymentRevision updates the revision for a deployment.
func SetFromReplicaSetTemplate ¶
func SetFromReplicaSetTemplate(fleet *orchestrationv1alpha1.RayClusterFleet, template orchestrationv1alpha1.RayClusterTemplateSpec) *orchestrationv1alpha1.RayClusterFleet
SetFromReplicaSetTemplate sets the desired RayClusterTemplateSpec from a replica set template to the given deployment.
func SetNewReplicaSetAnnotations ¶
func SetNewReplicaSetAnnotations(ctx context.Context, deployment *orchestrationv1alpha1.RayClusterFleet, newRS *orchestrationv1alpha1.RayClusterReplicaSet, newRevision string, exists bool, revHistoryLimitInChars int) bool
SetNewReplicaSetAnnotations sets new replica set's annotations appropriately by updating its revision and copying required deployment annotations to it; it returns true if replica set's annotation is changed.
func SetReplicasAnnotations ¶
func SetReplicasAnnotations(rs *orchestrationv1alpha1.RayClusterReplicaSet, desiredReplicas, maxReplicas int32) bool
SetReplicasAnnotations sets the desiredReplicas and maxReplicas into the annotations
func WaitForObservedDeployment ¶
func WaitForObservedDeployment(getDeploymentFunc func() (*orchestrationv1alpha1.RayClusterFleet, error), desiredGeneration int64, interval, timeout time.Duration) error
WaitForObservedDeployment polls for deployment to be updated so that deployment.Status.ObservedGeneration >= desiredGeneration. Returns error if polling timesout.
Types ¶
type ReplicaSetsByCreationTimestamp ¶
type ReplicaSetsByCreationTimestamp []*orchestrationv1alpha1.RayClusterReplicaSet
ReplicaSetsByCreationTimestamp sorts a list of ReplicaSet by creation timestamp, using their names as a tie breaker.
func (ReplicaSetsByCreationTimestamp) Len ¶
func (o ReplicaSetsByCreationTimestamp) Len() int
func (ReplicaSetsByCreationTimestamp) Less ¶
func (o ReplicaSetsByCreationTimestamp) Less(i, j int) bool
func (ReplicaSetsByCreationTimestamp) Swap ¶
func (o ReplicaSetsByCreationTimestamp) Swap(i, j int)
type ReplicaSetsByRevision ¶
type ReplicaSetsByRevision []*orchestrationv1alpha1.RayClusterReplicaSet
ReplicaSetsByRevision sorts a list of ReplicaSet by revision, using their creation timestamp or name as a tie breaker. By using the creation timestamp, this sorts from old to new replica sets.
func (ReplicaSetsByRevision) Len ¶
func (o ReplicaSetsByRevision) Len() int
func (ReplicaSetsByRevision) Less ¶
func (o ReplicaSetsByRevision) Less(i, j int) bool
func (ReplicaSetsByRevision) Swap ¶
func (o ReplicaSetsByRevision) Swap(i, j int)
type ReplicaSetsBySizeNewer ¶
type ReplicaSetsBySizeNewer []*orchestrationv1alpha1.RayClusterReplicaSet
ReplicaSetsBySizeNewer sorts a list of ReplicaSet by size in descending order, using their creation timestamp or name as a tie breaker. By using the creation timestamp, this sorts from new to old replica sets.
func (ReplicaSetsBySizeNewer) Len ¶
func (o ReplicaSetsBySizeNewer) Len() int
func (ReplicaSetsBySizeNewer) Less ¶
func (o ReplicaSetsBySizeNewer) Less(i, j int) bool
func (ReplicaSetsBySizeNewer) Swap ¶
func (o ReplicaSetsBySizeNewer) Swap(i, j int)
type ReplicaSetsBySizeOlder ¶
type ReplicaSetsBySizeOlder []*orchestrationv1alpha1.RayClusterReplicaSet
ReplicaSetsBySizeOlder sorts a list of ReplicaSet by size in descending order, using their creation timestamp or name as a tie breaker. By using the creation timestamp, this sorts from old to new replica sets.
func (ReplicaSetsBySizeOlder) Len ¶
func (o ReplicaSetsBySizeOlder) Len() int
func (ReplicaSetsBySizeOlder) Less ¶
func (o ReplicaSetsBySizeOlder) Less(i, j int) bool
func (ReplicaSetsBySizeOlder) Swap ¶
func (o ReplicaSetsBySizeOlder) Swap(i, j int)
type RsListFunc ¶
type RsListFunc func(string, metav1.ListOptions) ([]*orchestrationv1alpha1.RayClusterReplicaSet, error)
RsListFunc returns the ReplicaSet from the ReplicaSet namespace and the List metav1.ListOptions.
func RsListFromClient ¶
func RsListFromClient(c client.Client) RsListFunc
RsListFromClient returns an rsListFunc that wraps the given client.