From dce877c5ca190d06c9e9c069475bd17ea12e8ac9 Mon Sep 17 00:00:00 2001 From: Jordan Christiansen Date: Fri, 26 Mar 2021 22:10:43 -0500 Subject: Add problematic volume name to kube play error messages When kube play fails to create a volume, it should say which volume had the problem so the user doesn't have to guess. For the following pod spec: apiVersion: v1 kind: Pod metadata: name: mypod spec: containers: - name: myfrontend image: nginx volumeMounts: - mountPath: "/var/www/html" name: mypd volumes: - name: mypd hostPath: path: /var/blah podman will now report: Error: failed to create volume "mypd": error in parsing HostPath in YAML: error checking path "/var/blah": stat /var/blah: no such file or directory Signed-off-by: Jordan Christiansen --- test/e2e/play_kube_test.go | 1 + 1 file changed, 1 insertion(+) (limited to 'test') diff --git a/test/e2e/play_kube_test.go b/test/e2e/play_kube_test.go index cc4450379..a4c738f17 100644 --- a/test/e2e/play_kube_test.go +++ b/test/e2e/play_kube_test.go @@ -1449,6 +1449,7 @@ spec: kube := podmanTest.Podman([]string{"play", "kube", kubeYaml}) kube.WaitWithDefaultTimeout() Expect(kube.ExitCode()).NotTo(Equal(0)) + Expect(kube.ErrorToString()).To(ContainSubstring(defaultVolName)) }) It("podman play kube test with empty HostPath type volume", func() { -- cgit v1.2.3-54-g00ecf