Skip to content
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

kompose.volume.size label is not working #927

Closed
bongole opened this issue Feb 7, 2018 · 3 comments · Fixed by #929
Closed

kompose.volume.size label is not working #927

bongole opened this issue Feb 7, 2018 · 3 comments · Fixed by #929

Comments

@bongole
Copy link

bongole commented Feb 7, 2018

kompose.volume.size label is not working.
I tested on macOS 10.13.3 and brew installed kompose.

# test.yaml 
version: '2'
services:
  db:
    image: postgres:10.1
    labels:
      kompose.volume.size: 1Gi
    volumes:
      - db-data:/var/lib/postgresql/data
$ kompose version
1.8.0 ()

$ ls
test.yaml

$ kompose convert -f test.yaml
INFO Kubernetes file "db-service.yaml" created
INFO Kubernetes file "db-deployment.yaml" created
INFO Kubernetes file "db-data-persistentvolumeclaim.yaml" created

$ ls
db-data-persistentvolumeclaim.yaml db-deployment.yaml db-service.yaml test.yaml

$ cat db-data-persistentvolumeclaim.yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  creationTimestamp: null
  labels:
    io.kompose.service: db-data
  name: db-data
spec:
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 100Mi # <-- not 1Gi
status: {}
@hangyan
Copy link
Contributor

hangyan commented Feb 7, 2018

It seems it's only working in compose v3 now, I will loop into it to see why in v1/v2 not working

@emmasteimann
Copy link

This is still not working for me. I'm using compose v3. Same error.

@emmasteimann
Copy link

emmasteimann commented Jul 30, 2018

Does it have something to do with the only modifying storage size if .Vfrom source is blank?

if volume.VFrom == "" {
defaultSize := PVCRequestSize
for key, value := range service.Labels {
if key == "kompose.volume.size" {
defaultSize = value
}
}
createdPVC, err := k.CreatePVC(volumeName, volume.Mode, defaultSize)
if err != nil {
return nil, nil, nil, errors.Wrap(err, "k.CreatePVC failed")
}
PVCs = append(PVCs, createdPVC)
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants