Skip to content

Commit 7964fba

Browse files
committed
Cleanup on code verification and unit test
1 parent 044e271 commit 7964fba

File tree

14 files changed

+148
-62
lines changed

14 files changed

+148
-62
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,4 @@ cscope.*
6868

6969
/bazel-*
7070
*.pyc
71-
71+
profile.cov

.travis.yml

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

Makefile

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,34 +21,56 @@ IMAGE_TAG_LATEST=$(REGISTRY_NAME)/$(IMAGE_NAME):latest
2121
GIT_COMMIT?=$(shell git rev-parse HEAD)
2222
BUILD_DATE?=$(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
2323
LDFLAGS?="-X ${PKG}/pkg/blobfuse.driverVersion=${IMAGE_VERSION} -X ${PKG}/pkg/blobfuse.gitCommit=${GIT_COMMIT} -X ${PKG}/pkg/blobfuse.buildDate=${BUILD_DATE} -s -w -extldflags '-static'"
24-
25-
.PHONY: all blobfuse blobfuse-container clean
24+
GO111MODULE = off
25+
export GO111MODULE
2626

2727
all: blobfuse
2828

29-
test:
29+
.PHONY: verify
30+
verify:
31+
hack/verify-all.sh
32+
33+
.PHONY: unit-test
34+
unit-test:
3035
go test -covermode=count -coverprofile=profile.cov ./pkg/...
31-
$GOPATH/bin/goveralls -coverprofile=profile.cov -service=travis-ci
32-
integration-test:
33-
test/integration/run-tests-all-clouds.sh
36+
37+
.PHONY: sanity-test
3438
sanity-test:
3539
test/sanity/run-tests-all-clouds.sh
40+
41+
.PHONY: integration-test
42+
integration-test:
43+
test/integration/run-tests-all-clouds.sh
44+
45+
.PHONY: e2e-test
3646
e2e-test:
3747
test/e2e/run-test.sh
48+
49+
.PHONY: blobfuse
3850
blobfuse:
3951
if [ ! -d ./vendor ]; then dep ensure -vendor-only; fi
4052
CGO_ENABLED=0 GOOS=linux go build -a -ldflags ${LDFLAGS} -o _output/blobfuseplugin ./pkg/blobfuseplugin
53+
54+
.PHONY: blobfuse-windows
4155
blobfuse-windows:
4256
if [ ! -d ./vendor ]; then dep ensure -vendor-only; fi
4357
CGO_ENABLED=0 GOOS=windows go build -a -ldflags ${LDFLAGS} -o _output/blobfuseplugin.exe ./pkg/blobfuseplugin
58+
59+
.PHONY: blobfuse-container
4460
blobfuse-container: blobfuse
4561
docker build --no-cache -t $(IMAGE_TAG) -f ./pkg/blobfuseplugin/Dockerfile .
62+
63+
.PHONY: push
4664
push: blobfuse-container
4765
docker push $(IMAGE_TAG)
66+
67+
.PHONY: push-latest
4868
push-latest: blobfuse-container
4969
docker push $(IMAGE_TAG)
5070
docker tag $(IMAGE_TAG) $(IMAGE_TAG_LATEST)
5171
docker push $(IMAGE_TAG_LATEST)
72+
73+
.PHONY: clean
5274
clean:
5375
go clean -r -x
5476
-rm -rf _output

charts/latest/blobfuse-csi-driver/templates/csi-blobfuse-controller.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ spec:
3333
- mountPath: /csi
3434
name: socket-dir
3535
- name: csi-attacher
36-
image: quay.io/k8scsi/csi-attacher:v1.0.1
36+
image: "{{ .Values.image.csiAttacher.repository }}:{{ .Values.image.csiAttacher.tag }}"
3737
args:
3838
- --v=5
3939
- --csi-address=$(ADDRESS)
@@ -46,7 +46,7 @@ spec:
4646
- mountPath: /csi
4747
name: socket-dir
4848
- name: cluster-driver-registrar
49-
image: quay.io/k8scsi/csi-cluster-driver-registrar:v1.0.1
49+
image: "{{ .Values.image.clusterDriverRegistrar.repository }}:{{ .Values.image.clusterDriverRegistrar.tag }}"
5050
args:
5151
- --csi-address=$(ADDRESS)
5252
- --driver-requires-attachment=true
@@ -58,7 +58,7 @@ spec:
5858
- name: socket-dir
5959
mountPath: /csi
6060
- name: liveness-probe
61-
image: quay.io/k8scsi/livenessprobe:v1.1.0
61+
image: "{{ .Values.image.livenessProbe.repository }}:{{ .Values.image.livenessProbe.tag }}"
6262
args:
6363
- --csi-address=/csi/csi.sock
6464
- --connection-timeout=3s
@@ -67,7 +67,7 @@ spec:
6767
- name: socket-dir
6868
mountPath: /csi
6969
- name: blobfuse
70-
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
70+
image: "{{ .Values.image.blobfuse.repository }}:{{ .Values.image.blobfuse.tag }}"
7171
args:
7272
- "--v=5"
7373
- "--endpoint=$(CSI_ENDPOINT)"

charts/latest/blobfuse-csi-driver/templates/csi-blobfuse-node.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ spec:
2323
volumeMounts:
2424
- mountPath: /csi
2525
name: socket-dir
26-
image: quay.io/k8scsi/livenessprobe:v1.0.2
26+
image: "{{ .Values.image.livenessProbe.repository }}:{{ .Values.image.livenessProbe.tag }}"
2727
args:
2828
- --csi-address=/csi/csi.sock
2929
- --connection-timeout=3s
3030
- --health-port=9802
3131
- name: node-driver-registrar
32-
image: quay.io/k8scsi/csi-node-driver-registrar:v1.1.0
32+
image: "{{ .Values.image.nodeDriverRegistrar.repository }}:{{ .Values.image.nodeDriverRegistrar.tag }}"
3333
args:
3434
- --csi-address=$(ADDRESS)
3535
- --kubelet-registration-path=$(DRIVER_REG_SOCK_PATH)
@@ -49,7 +49,7 @@ spec:
4949
- name: registration-dir
5050
mountPath: /registration
5151
- name: blobfuse
52-
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
52+
image: "{{ .Values.image.blobfuse.repository }}:{{ .Values.image.blobfuse.tag }}"
5353
args:
5454
- "--v=5"
5555
- "--endpoint=$(CSI_ENDPOINT)"

charts/latest/blobfuse-csi-driver/values.yaml

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,28 @@
11
image:
2-
repository: mcr.microsoft.com/k8s/csi/blobfuse-csi
3-
tag: latest
4-
pullPolicy: Always
2+
blobfuse:
3+
repository: mcr.microsoft.com/k8s/csi/blobfuse-csi
4+
tag: latest
5+
pullPolicy: Always
6+
csiProvisioner:
7+
repository: quay.io/k8scsi/csi-provisioner
8+
tag: v1.0.1
9+
pullPolicy: Always
10+
csiAttacher:
11+
repository: quay.io/k8scsi/csi-attacher
12+
tag: v1.0.1
13+
pullPolicy: Always
14+
clusterDriverRegistrar:
15+
repository: quay.io/k8scsi/csi-cluster-driver-registrar
16+
tag: v1.0.1
17+
pullPolicy: Always
18+
livenessProbe:
19+
repository: quay.io/k8scsi/livenessprobe
20+
tag: v1.1.0
21+
pullPolicy: Always
22+
nodeDriverRegistrar:
23+
repository: quay.io/k8scsi/csi-node-driver-registrar
24+
tag: v1.1.0
25+
pullPolicy: Always
526

627
serviceAccount:
728
create: true

deploy/csi-blobfuse-node.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ spec:
2222
volumeMounts:
2323
- mountPath: /csi
2424
name: socket-dir
25-
image: quay.io/k8scsi/livenessprobe:v1.0.2
25+
image: quay.io/k8scsi/livenessprobe:v1.1.0
2626
args:
2727
- --csi-address=/csi/csi.sock
2828
- --connection-timeout=3s

hack/verify-all.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,5 @@ ${PKG_ROOT}/hack/verify-govet.sh
2323
${PKG_ROOT}/hack/verify-golint.sh
2424
${PKG_ROOT}/hack/verify-dep.sh
2525
${PKG_ROOT}/hack/verify-boilerplate.sh
26-
${PKG_ROOT}/hack/verify-spelling.sh
26+
${PKG_ROOT}/hack/verify-spelling.sh
27+
${PKG_ROOT}/hack/verify-helm-chart.sh

hack/verify-dep.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@
1717
set -euo pipefail
1818

1919
echo "Verifying dep check"
20+
go get github.com/golang/dep/cmd/dep
2021
dep check
21-
echo "No issue found"
22+
echo "No issue found"

hack/verify-golint.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ if ! which golangci-lint > /dev/null; then
2121
go get github.com/golangci/golangci-lint/cmd/golangci-lint
2222
fi
2323

24-
golangci-lint run --deadline=10m
24+
golangci-lint run --deadline=10m
2525

2626
echo "Congratulations! All Go source files have been linted."
27-

0 commit comments

Comments
 (0)