compose2kube icon indicating copy to clipboard operation
compose2kube copied to clipboard

Prevent errors when converting volumes starting ./

Open colinnewell opened this issue 8 years ago • 0 comments

If we have a volume defined like this in our docker-compose,

volumes:
  - ./cache:/var/cache/nginx

The name .cache is generated for the volume which failes the k8s name specification.

Error from server: error when creating "output/nginx-rc.yml":
ReplicationController "nginx" is invalid:
[spec.template.spec.volumes[0].name: Invalid value: ".cache": must match
the regex [a-z0-9]([-a-z0-9]*[a-z0-9])? (e.g. 'my-name' or '123-abc'),
spec.template.spec.containers[0].volumeMounts[0].name: Not found:
".cache"]

colinnewell avatar Nov 15 '16 18:11 colinnewell