mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-08 11:38:15 +00:00
Merge pull request #120336 from pohly/dra-generated-name-hyphen
resource claim controller: separate generated suffix from base
This commit is contained in:
commit
73580b2038
@ -616,7 +616,7 @@ func (ec *Controller) handleClaim(ctx context.Context, pod *v1.Pod, podClaim v1.
|
||||
annotations = make(map[string]string)
|
||||
}
|
||||
annotations[podResourceClaimAnnotation] = podClaim.Name
|
||||
generateName := pod.Name + "-" + podClaim.Name
|
||||
generateName := pod.Name + "-" + podClaim.Name + "-"
|
||||
maxBaseLen := 57 // Leave space for hyphen and 5 random characters in a name with 63 characters.
|
||||
if len(generateName) > maxBaseLen {
|
||||
// We could leave truncation to the apiserver, but as
|
||||
|
@ -62,7 +62,7 @@ var (
|
||||
testClaimReserved = reserveClaim(testClaimAllocated, testPodWithResource)
|
||||
testClaimReservedTwice = reserveClaim(testClaimReserved, otherTestPod)
|
||||
|
||||
generatedTestClaim = makeGeneratedClaim(podResourceClaimName, testPodName+"-"+podResourceClaimName, testNamespace, className, 1, makeOwnerReference(testPodWithResource, true))
|
||||
generatedTestClaim = makeGeneratedClaim(podResourceClaimName, testPodName+"-"+podResourceClaimName+"-", testNamespace, className, 1, makeOwnerReference(testPodWithResource, true))
|
||||
generatedTestClaimAllocated = allocateClaim(generatedTestClaim)
|
||||
generatedTestClaimReserved = reserveClaim(generatedTestClaimAllocated, testPodWithResource)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user