Skip to content

Commit 7983cc8

Browse files
Merge pull request buildpacks-community#1562 from eirini-forks/fix-long-volume-names
2 parents e2c57e6 + 9c3620a commit 7983cc8

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

pkg/apis/build/v1alpha2/build_pod.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1135,7 +1135,7 @@ func setupBindingVolumesAndMounts(bindings []ServiceBinding) ([]corev1.Volume, [
11351135
switch b := binding.(type) {
11361136
case *corev1alpha1.ServiceBinding:
11371137
if b.SecretRef != nil {
1138-
secretVolume := fmt.Sprintf("service-binding-secret-%s", b.Name)
1138+
secretVolume := fmt.Sprintf("binding-%s", b.Name)
11391139
volumes = append(volumes,
11401140
corev1.Volume{
11411141
Name: secretVolume,

pkg/apis/build/v1alpha2/build_pod_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -440,15 +440,15 @@ func testBuildPod(t *testing.T, when spec.G, it spec.S) {
440440
assert.Contains(t,
441441
pod.Spec.Volumes,
442442
corev1.Volume{
443-
Name: "service-binding-secret-database",
443+
Name: "binding-database",
444444
VolumeSource: corev1.VolumeSource{
445445
Secret: &corev1.SecretVolumeSource{
446446
SecretName: "database",
447447
},
448448
},
449449
},
450450
corev1.Volume{
451-
Name: "service-binding-secret-apm",
451+
Name: "binding-apm",
452452
VolumeSource: corev1.VolumeSource{
453453
Secret: &corev1.SecretVolumeSource{
454454
SecretName: "apm",
@@ -461,12 +461,12 @@ func testBuildPod(t *testing.T, when spec.G, it spec.S) {
461461
assert.Contains(t,
462462
pod.Spec.InitContainers[containerIdx].VolumeMounts,
463463
corev1.VolumeMount{
464-
Name: "service-binding-secret-database",
464+
Name: "binding-database",
465465
MountPath: "/platform/bindings/database",
466466
ReadOnly: true,
467467
},
468468
corev1.VolumeMount{
469-
Name: "service-binding-secret-apm",
469+
Name: "binding-apm",
470470
MountPath: "/platform/bindings/apm",
471471
ReadOnly: true,
472472
},
@@ -728,8 +728,8 @@ func testBuildPod(t *testing.T, when spec.G, it spec.S) {
728728
"layers-dir",
729729
"platform-dir",
730730
"workspace-dir",
731-
"service-binding-secret-database",
732-
"service-binding-secret-apm",
731+
"binding-database",
732+
"binding-apm",
733733
}, names(pod.Spec.InitContainers[2].VolumeMounts))
734734
})
735735

@@ -843,8 +843,8 @@ func testBuildPod(t *testing.T, when spec.G, it spec.S) {
843843
"layers-dir",
844844
"platform-dir",
845845
"workspace-dir",
846-
"service-binding-secret-database",
847-
"service-binding-secret-apm",
846+
"binding-database",
847+
"binding-apm",
848848
}, names(pod.Spec.InitContainers[4].VolumeMounts))
849849
})
850850

0 commit comments

Comments
 (0)