Skip to content

Commit

Permalink
Merge pull request #1562 from eirini-forks/fix-long-volume-names
Browse files Browse the repository at this point in the history
  • Loading branch information
tomkennedy513 authored Mar 22, 2024
2 parents e2c57e6 + 9c3620a commit 7983cc8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pkg/apis/build/v1alpha2/build_pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -1135,7 +1135,7 @@ func setupBindingVolumesAndMounts(bindings []ServiceBinding) ([]corev1.Volume, [
switch b := binding.(type) {
case *corev1alpha1.ServiceBinding:
if b.SecretRef != nil {
secretVolume := fmt.Sprintf("service-binding-secret-%s", b.Name)
secretVolume := fmt.Sprintf("binding-%s", b.Name)
volumes = append(volumes,
corev1.Volume{
Name: secretVolume,
Expand Down
16 changes: 8 additions & 8 deletions pkg/apis/build/v1alpha2/build_pod_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -440,15 +440,15 @@ func testBuildPod(t *testing.T, when spec.G, it spec.S) {
assert.Contains(t,
pod.Spec.Volumes,
corev1.Volume{
Name: "service-binding-secret-database",
Name: "binding-database",
VolumeSource: corev1.VolumeSource{
Secret: &corev1.SecretVolumeSource{
SecretName: "database",
},
},
},
corev1.Volume{
Name: "service-binding-secret-apm",
Name: "binding-apm",
VolumeSource: corev1.VolumeSource{
Secret: &corev1.SecretVolumeSource{
SecretName: "apm",
Expand All @@ -461,12 +461,12 @@ func testBuildPod(t *testing.T, when spec.G, it spec.S) {
assert.Contains(t,
pod.Spec.InitContainers[containerIdx].VolumeMounts,
corev1.VolumeMount{
Name: "service-binding-secret-database",
Name: "binding-database",
MountPath: "/platform/bindings/database",
ReadOnly: true,
},
corev1.VolumeMount{
Name: "service-binding-secret-apm",
Name: "binding-apm",
MountPath: "/platform/bindings/apm",
ReadOnly: true,
},
Expand Down Expand Up @@ -728,8 +728,8 @@ func testBuildPod(t *testing.T, when spec.G, it spec.S) {
"layers-dir",
"platform-dir",
"workspace-dir",
"service-binding-secret-database",
"service-binding-secret-apm",
"binding-database",
"binding-apm",
}, names(pod.Spec.InitContainers[2].VolumeMounts))
})

Expand Down Expand Up @@ -843,8 +843,8 @@ func testBuildPod(t *testing.T, when spec.G, it spec.S) {
"layers-dir",
"platform-dir",
"workspace-dir",
"service-binding-secret-database",
"service-binding-secret-apm",
"binding-database",
"binding-apm",
}, names(pod.Spec.InitContainers[4].VolumeMounts))
})

Expand Down

0 comments on commit 7983cc8

Please sign in to comment.