From 03824e04fdcc4a4f72741db9aa0962ecedf78ac3 Mon Sep 17 00:00:00 2001 From: Matthew Heon Date: Tue, 21 May 2019 13:52:55 -0400 Subject: Fix a 'generate kube' bug on ctrs with named volumes Signed-off-by: Matthew Heon --- libpod/kube.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'libpod/kube.go') diff --git a/libpod/kube.go b/libpod/kube.go index 260269b2e..149ea50c8 100644 --- a/libpod/kube.go +++ b/libpod/kube.go @@ -220,12 +220,12 @@ func containerToV1Container(c *Container) (v1.Container, error) { return kubeContainer, err } kubeContainer.VolumeMounts = volumes - return kubeContainer, errors.Wrapf(ErrNotImplemented, "volume names") + //return kubeContainer, errors.Wrapf(ErrNotImplemented, "volume names") } envVariables, err := libpodEnvVarsToKubeEnvVars(c.config.Spec.Process.Env) if err != nil { - return kubeContainer, nil + return kubeContainer, err } portmappings, err := c.PortMappings() @@ -234,7 +234,7 @@ func containerToV1Container(c *Container) (v1.Container, error) { } ports, err := ocicniPortMappingToContainerPort(portmappings) if err != nil { - return kubeContainer, nil + return kubeContainer, err } containerCommands := c.Command() @@ -345,7 +345,7 @@ func libpodMountsToKubeVolumeMounts(c *Container) ([]v1.VolumeMount, error) { for _, hostSourcePath := range c.config.UserVolumes { vm, err := generateKubeVolumeMount(hostSourcePath, c.config.Spec.Mounts) if err != nil { - return vms, err + continue } vms = append(vms, vm) } -- cgit v1.2.3-54-g00ecf From 968bcbc86b8fa26383ae2d4809b04aac288355f0 Mon Sep 17 00:00:00 2001 From: Matthew Heon Date: Tue, 21 May 2019 23:08:39 -0400 Subject: Remove unused return statement in kube volume code Signed-off-by: Matthew Heon --- libpod/kube.go | 1 - 1 file changed, 1 deletion(-) (limited to 'libpod/kube.go') diff --git a/libpod/kube.go b/libpod/kube.go index 149ea50c8..c5fd9d75c 100644 --- a/libpod/kube.go +++ b/libpod/kube.go @@ -220,7 +220,6 @@ func containerToV1Container(c *Container) (v1.Container, error) { return kubeContainer, err } kubeContainer.VolumeMounts = volumes - //return kubeContainer, errors.Wrapf(ErrNotImplemented, "volume names") } envVariables, err := libpodEnvVarsToKubeEnvVars(c.config.Spec.Process.Env) -- cgit v1.2.3-54-g00ecf