Documentation ¶
Index ¶
- func EqualIgnoreHash(template1, template2 *v1.PodTemplateSpec) bool
- func FindNewReplicaSet(deployment *appsv1.Deployment, rsList []*appsv1.ReplicaSet) *appsv1.ReplicaSet
- func GetScaledValueFromIntOrPercent(intOrPercent *intstrutil.IntOrString, total int, roundUp bool) (int, error)
- func IsRollingUpdate(deployment *appsv1.Deployment) bool
- func MaxUnavailable(deployment appsv1.Deployment) int32
- func ResolveFenceposts(maxSurge, maxUnavailable *intstrutil.IntOrString, desired int32) (int32, int32, error)
- type ReplicaSetsByCreationTimestamp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EqualIgnoreHash ¶
func EqualIgnoreHash(template1, template2 *v1.PodTemplateSpec) bool
EqualIgnoreHash returns true if two given podTemplateSpec are equal, ignoring the diff in value of Labels[pod-template-hash] We ignore pod-template-hash 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 labels
func FindNewReplicaSet ¶
func FindNewReplicaSet(deployment *appsv1.Deployment, rsList []*appsv1.ReplicaSet) *appsv1.ReplicaSet
func GetScaledValueFromIntOrPercent ¶
func GetScaledValueFromIntOrPercent(intOrPercent *intstrutil.IntOrString, total int, roundUp bool) (int, error)
GetScaledValueFromIntOrPercent is meant to replace GetValueFromIntOrPercent. This method returns a scaled value from an IntOrString type. If the IntOrString is a percentage string value it's treated as a percentage and scaled appropriately in accordance to the total, if it's an int value it's treated as a a simple value and if it is a string value which is either non-numeric or numeric but lacking a trailing '%' it returns an error.
func IsRollingUpdate ¶
func IsRollingUpdate(deployment *appsv1.Deployment) bool
IsRollingUpdate returns true if the strategy type is a rolling update.
func MaxUnavailable ¶
func MaxUnavailable(deployment appsv1.Deployment) int32
MaxUnavailable returns the maximum unavailable pods a rolling deployment can take.
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)
Types ¶
type ReplicaSetsByCreationTimestamp ¶
type ReplicaSetsByCreationTimestamp []*appsv1.ReplicaSet
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)