getRouteHostName truncation can cause Route collisions
What version of crane are you running, and what are your clusters+platform
Latest main branch. Issue exists in cmd/transfer-pvc/transfer-pvc.go line 735.
What did you expect to happen?
Each PVC should get a unique Route hostname, even when PVC names are long.
What actually happened?
getRouteHostName() truncates long name-namespace prefixes to 62 chars using routeNamePrefix[:62]. Two PVCs with names that share the same first 62 characters will get the same hostname, causing a Route conflict.
Note: getValidatedResourceName() on line 485 already solves this problem using MD5 hashing: fmt.Sprintf("crane-%x", md5.Sum([]byte(name))). The same approach could be applied here.
Please include any relevant logs or errors
N/A — discovered via code review.
getRouteHostName truncation can cause Route collisions
What version of crane are you running, and what are your clusters+platform
Latest main branch. Issue exists in
cmd/transfer-pvc/transfer-pvc.goline 735.What did you expect to happen?
Each PVC should get a unique Route hostname, even when PVC names are long.
What actually happened?
getRouteHostName()truncates long name-namespace prefixes to 62 chars usingrouteNamePrefix[:62]. Two PVCs with names that share the same first 62 characters will get the same hostname, causing a Route conflict.Note:
getValidatedResourceName()on line 485 already solves this problem using MD5 hashing:fmt.Sprintf("crane-%x", md5.Sum([]byte(name))). The same approach could be applied here.Please include any relevant logs or errors
N/A — discovered via code review.