mirror of
https://github.com/containers/podman.git
synced 2025-08-06 19:44:14 +08:00
Fix a 'generate kube' bug on ctrs with named volumes
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
This commit is contained in:
@ -220,12 +220,12 @@ func containerToV1Container(c *Container) (v1.Container, error) {
|
|||||||
return kubeContainer, err
|
return kubeContainer, err
|
||||||
}
|
}
|
||||||
kubeContainer.VolumeMounts = volumes
|
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)
|
envVariables, err := libpodEnvVarsToKubeEnvVars(c.config.Spec.Process.Env)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return kubeContainer, nil
|
return kubeContainer, err
|
||||||
}
|
}
|
||||||
|
|
||||||
portmappings, err := c.PortMappings()
|
portmappings, err := c.PortMappings()
|
||||||
@ -234,7 +234,7 @@ func containerToV1Container(c *Container) (v1.Container, error) {
|
|||||||
}
|
}
|
||||||
ports, err := ocicniPortMappingToContainerPort(portmappings)
|
ports, err := ocicniPortMappingToContainerPort(portmappings)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return kubeContainer, nil
|
return kubeContainer, err
|
||||||
}
|
}
|
||||||
|
|
||||||
containerCommands := c.Command()
|
containerCommands := c.Command()
|
||||||
@ -345,7 +345,7 @@ func libpodMountsToKubeVolumeMounts(c *Container) ([]v1.VolumeMount, error) {
|
|||||||
for _, hostSourcePath := range c.config.UserVolumes {
|
for _, hostSourcePath := range c.config.UserVolumes {
|
||||||
vm, err := generateKubeVolumeMount(hostSourcePath, c.config.Spec.Mounts)
|
vm, err := generateKubeVolumeMount(hostSourcePath, c.config.Spec.Mounts)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return vms, err
|
continue
|
||||||
}
|
}
|
||||||
vms = append(vms, vm)
|
vms = append(vms, vm)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user