-
Notifications
You must be signed in to change notification settings - Fork 770
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert volumes in [name:][host:]container[:access_mode] format #78
Conversation
@janetkuo did you test with compose v1 which doesn't include volume name ? |
Yes, I tested against $ kompose convert -f docker-gitlab.yml -y
file "postgresql-svc.yaml" created
file "redisio-svc.yaml" created
file "gitlab-svc.yaml" created
file "redisio-deployment.yaml" created
file "gitlab-deployment.yaml" created
file "postgresql-deployment.yaml" created
$ cat redisio-deployment.yaml
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
creationTimestamp: null
labels:
service: redisio
name: redisio
spec:
replicas: 1
selector:
matchLabels:
service: redisio
strategy: {}
template:
metadata:
creationTimestamp: null
labels:
service: redisio
spec:
containers:
- image: sameersbn/redis
name: redisio
ports:
- containerPort: 6379
protocol: TCP
resources: {}
volumeMounts:
- mountPath: /var/lib/redis
name: ls6k1hh2gdnyxxvi7hvs
restartPolicy: Always
volumes:
- hostPath:
path: /srv/docker/gitlab/redis
name: ls6k1hh2gdnyxxvi7hvs
status: {} |
|
||
volumesMount = append(volumesMount, api.VolumeMount{Name: volumeName, ReadOnly: readonly, MountPath: containerDir}) | ||
// volumeName = random string of 20 chars | ||
if len(name) == 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't assume that volume name is specified (even for v2, volume name isn't required), and if it's not, just use the current random volume name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
aa3abb1
to
8d7be45
Compare
Just rebased. |
I added a unit test, tested locally with |
#75