Skip to content

Commit

Permalink
Fix comment to refer to 253 chars, not 63
Browse files Browse the repository at this point in the history
  • Loading branch information
laverya authored Apr 22, 2024
1 parent 1a5809a commit 1571ce7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/k8sutil/truncate.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import "fmt"

const nameSuffix = "-pvcmigrate"

// if the length after adding the suffix is more than 63 characters, we need to reduce that to fit within k8s limits
// if the length after adding the suffix is more than 253 characters, we need to reduce that to fit within k8s limits
// pruning from the end runs the risk of dropping the '0'/'1'/etc of a statefulset's PVC name
// pruning from the front runs the risk of making a-replica-... and b-replica-... collide
// so this removes characters from the middle of the string
Expand All @@ -14,7 +14,7 @@ func NewPvcName(originalName string) string {
return candidate
}

// remove characters from the middle of the string to reduce the total length to 63 characters
// remove characters from the middle of the string to reduce the total length to 253 characters
newCandidate := candidate[0:100] + candidate[len(candidate)-153:]
return newCandidate
}
Expand Down

0 comments on commit 1571ce7

Please sign in to comment.