Skip to content

Commit

Permalink
fix: allow volume mounts in junit checks
Browse files Browse the repository at this point in the history
  • Loading branch information
LarsFronius authored and moshloop committed Nov 6, 2024
1 parent 394c1d7 commit 0ef8083
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,8 @@ ginkgo:
CONTROLLER_GEN=$(GOBIN)/controller-gen

.bin/yq: .bin
curl -sSLo $(YQ) https://github.com/mikefarah/yq/releases/download/v4.40.5/yq_$(OS)_$(ARCH) && \
chmod +x $(YQ)
curl -sSLo .bin/yq https://github.com/mikefarah/yq/releases/download/v4.40.5/yq_$(OS)_$(ARCH) && \
chmod +x .bin/yq


.bin/go-junit-report: .bin
Expand Down
15 changes: 7 additions & 8 deletions checks/junit.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,16 +105,15 @@ func newPod(ctx *context.Context, check v1.JunitCheck) (*corev1.Pod, error) {
`, mountPath, mountPath),
},
}}
pod.Spec.Volumes = []corev1.Volume{
{
Name: volumeName,
VolumeSource: corev1.VolumeSource{
EmptyDir: &corev1.EmptyDirVolumeSource{},
},
pod.Spec.Volumes = append(pod.Spec.Volumes, corev1.Volume{
Name: volumeName,
VolumeSource: corev1.VolumeSource{
EmptyDir: &corev1.EmptyDirVolumeSource{},
},
}
})
pod.Spec.RestartPolicy = corev1.RestartPolicyNever
pod.Spec.InitContainers[0].VolumeMounts = []corev1.VolumeMount{{Name: volumeName, MountPath: filepath.Dir(check.TestResults)}}
//
pod.Spec.InitContainers[0].VolumeMounts = append(pod.Spec.InitContainers[0].VolumeMounts, corev1.VolumeMount{Name: volumeName, MountPath: filepath.Dir(check.TestResults)})
pod.Spec.Containers[0].VolumeMounts = []corev1.VolumeMount{{Name: volumeName, MountPath: mountPath}}
return pod, nil
}
Expand Down

0 comments on commit 0ef8083

Please sign in to comment.