Skip to content

Commit 8700605

Browse files
authored
remove maxStorageCapacity restriction (#53)
1 parent 1f79e43 commit 8700605

File tree

10 files changed

+150
-179
lines changed

10 files changed

+150
-179
lines changed

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
FROM golang:1.15-alpine as builder
1+
FROM golang:1.16-alpine as builder
22
RUN apk add make binutils
33
COPY / /work
44
WORKDIR /work
55
RUN make lvmplugin
66

7-
FROM alpine:3.12
7+
FROM alpine:3.13
88
LABEL maintainers="Metal Authors"
99
LABEL description="LVM Driver"
1010

TODO.md

Lines changed: 0 additions & 38 deletions
This file was deleted.

cmd/provisioner/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
FROM golang:1.15-alpine as builder
1+
FROM golang:1.16-alpine as builder
22
RUN apk add make binutils
33
COPY / /work
44
WORKDIR /work
55
RUN make provisioner
66

7-
FROM alpine:3.12
7+
FROM alpine:3.13
88
LABEL maintainers="Metal Authors"
99
LABEL description="LVM Driver"
1010

go.mod

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,29 @@
11
module github.com/metal-stack/csi-driver-lvm
22

3-
go 1.15
3+
go 1.16
44

55
require (
6-
github.com/container-storage-interface/spec v1.3.0
6+
github.com/container-storage-interface/spec v1.4.0
77
github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect
88
github.com/docker/go-units v0.4.0
9-
github.com/golang/protobuf v1.4.3 // indirect
109
github.com/google/gofuzz v1.2.0 // indirect
11-
github.com/kr/pretty v0.2.1 // indirect
12-
github.com/kubernetes-csi/csi-lib-utils v0.9.0
13-
github.com/stretchr/testify v1.6.1 // indirect
10+
github.com/googleapis/gnostic v0.5.5 // indirect
11+
github.com/json-iterator/go v1.1.11 // indirect
12+
github.com/kubernetes-csi/csi-lib-utils v0.9.1
13+
github.com/russross/blackfriday/v2 v2.1.0 // indirect
1414
github.com/urfave/cli/v2 v2.3.0
15-
golang.org/x/crypto v0.0.0-20201124201722-c8d3bf9c5392 // indirect
16-
golang.org/x/net v0.0.0-20201110031124-69a78807bb2b
17-
golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58 // indirect
18-
golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3
19-
golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e // indirect
20-
google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e // indirect
21-
google.golang.org/grpc v1.33.2
22-
gopkg.in/yaml.v2 v2.4.0 // indirect
23-
k8s.io/api v0.19.4
24-
k8s.io/apimachinery v0.19.4
25-
k8s.io/client-go v0.19.4
26-
k8s.io/klog/v2 v2.4.0
27-
k8s.io/utils v0.0.0-20201110183641-67b214c5f920 // indirect
15+
golang.org/x/net v0.0.0-20210510120150-4163338589ed
16+
golang.org/x/oauth2 v0.0.0-20210427180440-81ed05c6b58c // indirect
17+
golang.org/x/sys v0.0.0-20210511113859-b0526f3d8744
18+
golang.org/x/term v0.0.0-20210503060354-a79de5458b56 // indirect
19+
google.golang.org/appengine v1.6.7 // indirect
20+
google.golang.org/genproto v0.0.0-20210510173355-fb37daa5cd7a // indirect
21+
google.golang.org/grpc v1.37.1
22+
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
23+
k8s.io/api v0.21.0
24+
k8s.io/apimachinery v0.21.0
25+
k8s.io/client-go v0.21.0
26+
k8s.io/klog/v2 v2.8.0
27+
k8s.io/utils v0.0.0-20210305010621-2afb4311ab10 // indirect
28+
sigs.k8s.io/structured-merge-diff/v4 v4.1.1 // indirect
2829
)

go.sum

Lines changed: 123 additions & 92 deletions
Large diffs are not rendered by default.

helm/csi-driver-lvm/values.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ lvm:
1010

1111
pluginImage:
1212
repository: metalstack/lvmplugin
13-
tag: v0.4.0
13+
tag: v0.4.1
1414
pullPolicy: IfNotPresent
1515

1616
provisionerImage:
1717
repository: metalstack/csi-lvmplugin-provisioner
18-
tag: v0.4.0
18+
tag: v0.4.1
1919
pullPolicy: IfNotPresent
2020

2121
rbac:

pkg/lvm/controllerserver.go

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@ import (
3131
"k8s.io/klog/v2"
3232
)
3333

34-
const (
35-
maxStorageCapacity = tib
36-
)
37-
3834
type controllerServer struct {
3935
caps []*csi.ControllerServiceCapability
4036
nodeID string
@@ -112,15 +108,6 @@ func (cs *controllerServer) CreateVolume(ctx context.Context, req *csi.CreateVol
112108
return nil, status.Error(codes.InvalidArgument, "cannot have both block and mount access type")
113109
}
114110

115-
// TODO
116-
// this check must bei implemented in createlvs executed by the provisioner pod on the node
117-
118-
// Check for maximum available capacity
119-
capacity := int64(req.GetCapacityRange().GetRequiredBytes())
120-
if capacity >= maxStorageCapacity {
121-
return nil, status.Errorf(codes.OutOfRange, "Requested capacity %d exceeds maximum allowed %d", capacity, maxStorageCapacity)
122-
}
123-
124111
lvmType := req.GetParameters()["type"]
125112
if !(lvmType == "linear" || lvmType == "mirror" || lvmType == "striped") {
126113
return nil, status.Errorf(codes.Internal, "lvmType is incorrect: %s", lvmType)

pkg/lvm/lvm.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,6 @@ import (
3838
"k8s.io/klog/v2"
3939
)
4040

41-
const (
42-
kib int64 = 1024
43-
mib int64 = kib * 1024
44-
gib int64 = mib * 1024
45-
tib int64 = gib * 1024
46-
)
47-
4841
// Lvm contains the main parameters
4942
type Lvm struct {
5043
name string

pkg/lvm/nodeserver.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -303,9 +303,6 @@ func (ns *nodeServer) NodeExpandVolume(ctx context.Context, req *csi.NodeExpandV
303303
return nil, status.Error(codes.InvalidArgument, "Volume ID missing in request")
304304
}
305305
capacity := int64(req.GetCapacityRange().GetRequiredBytes())
306-
if capacity >= maxStorageCapacity {
307-
return nil, status.Errorf(codes.OutOfRange, "Requested capacity %d exceeds maximum allowed %d", capacity, maxStorageCapacity)
308-
}
309306

310307
volID := req.GetVolumeId()
311308
volPath := req.GetVolumePath()

start-minikube-on-linux.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22

3-
minikube start --memory 5g --driver kvm2
3+
minikube start --memory 5g --driver kvm2 --kubernetes-version v1.16.15
44
minikube ssh 'for i in 0 1; do fallocate -l 1G loop${i} ; sudo losetup -f loop${i}; sudo losetup -a ; done'
55
minikube ssh 'sudo rm /sbin/losetup'
66
scp -o 'StrictHostKeyChecking=no' -i $(minikube ssh-key) $(which losetup) docker@$(minikube ip):/tmp/losetup

0 commit comments

Comments
 (0)