Small updates and comment fixes

This commit is contained in:
Peter Schuurman 2022-10-14 15:36:30 -07:00
parent af58b491ef
commit 8a9c126eca
5 changed files with 9 additions and 9 deletions

View File

@ -148,8 +148,8 @@ type StatefulSetPersistentVolumeClaimRetentionPolicy struct {
type StatefulSetOrdinals struct {
// Start is the number representing the first index that is used to represent
// replica ordinals. Defaults to 0.
// If set, replica ordinals will be numbered
// [.spec.ordinals.start, .spec.ordinals.start - .spec.replicas).
// If set, replica ordinals will be numbered in the range:
// [.spec.ordinals.start, .spec.ordinals.start + .spec.replicas).
// +optional
Start int32
}

View File

@ -2696,7 +2696,7 @@ func checkClaimInvarients(set *apps.StatefulSet, pod *v1.Pod, claim *v1.Persiste
return fmt.Errorf("claim %s does not have owner ref on condemned pod %s for scaledown delete", claim.Name, pod.Name)
}
if podInOrdinalRange(pod, set) && hasOwnerRef(claim, pod) {
return fmt.Errorf("claim %s has unexpected owner ref on condemned pod %s for scaledown delete. ordinal: %d, [%d,%d]", claim.Name, pod.Name, getOrdinal(pod), getStartOrdinal(set), getEndOrdinal(set))
return fmt.Errorf("claim %s has unexpected owner ref on condemned pod %s for scaledown delete", claim.Name, pod.Name)
}
case policy.WhenScaled == delete && policy.WhenDeleted == delete:
if !podInOrdinalRange(pod, set) {

View File

@ -168,8 +168,8 @@ type StatefulSetPersistentVolumeClaimRetentionPolicy struct {
type StatefulSetOrdinals struct {
// Start is the number representing the first index that is used to represent
// replica ordinals. Defaults to 0.
// If set, replica ordinals will be numbered
// [.spec.ordinals.start, .spec.ordinals.start - .spec.replicas).
// If set, replica ordinals will be numbered in the range:
// [.spec.ordinals.start, .spec.ordinals.start + .spec.replicas).
// +optional
Start int32 `json:"start" protobuf:"varint,1,opt,name=start"`
}

View File

@ -209,8 +209,8 @@ type StatefulSetPersistentVolumeClaimRetentionPolicy struct {
type StatefulSetOrdinals struct {
// Start is the number representing the first index that is used to represent
// replica ordinals. Defaults to 0.
// If set, replica ordinals will be numbered
// [.spec.ordinals.start, .spec.ordinals.start - .spec.replicas).
// If set, replica ordinals will be numbered in the range:
// [.spec.ordinals.start, .spec.ordinals.start + .spec.replicas).
// +optional
Start int32 `json:"start" protobuf:"varint,1,opt,name=start"`
}

View File

@ -219,8 +219,8 @@ type StatefulSetPersistentVolumeClaimRetentionPolicy struct {
type StatefulSetOrdinals struct {
// Start is the number representing the first index that is used to represent
// replica ordinals. Defaults to 0.
// If set, replica ordinals will be numbered
// [.spec.ordinals.start, .spec.ordinals.start - .spec.replicas).
// If set, replica ordinals will be numbered in the range:
// [.spec.ordinals.start, .spec.ordinals.start + .spec.replicas).
// +optional
Start int32 `json:"start" protobuf:"varint,1,opt,name=start"`
}