Skip to content

Commit 75f5ff8

Browse files
authored
Merge pull request #2 from opencurve/spy-dev-csi-1.5
release for csi-v1.5.0
2 parents 8cc8533 + 255a2d3 commit 75f5ff8

File tree

966 files changed

+218249
-142912
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

966 files changed

+218249
-142912
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
## csi-v1.5.0-rc1
2+
3+
- update csi spec to v1.5.0
4+
5+
## csi-v1.1.0-rc2
6+
7+
- bug fix of parsing output of `curve-nbd list-mapped`: #1
8+
9+
## csi-v1.1.0-rc1
10+
11+
first release

Makefile

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,45 @@
1-
.PHONY: all
1+
CSI_IMAGE_NAME?=harbor.cloud.netease.com/qzprod-k8s/k8scsi/curve-csi
22

3-
CSI_IMAGE_NAME=$(if $(ENV_CSI_IMAGE_NAME),$(ENV_CSI_IMAGE_NAME),harbor.cloud.netease.com/qzprod-k8s/k8scsi/curve-csi)
4-
CSI_IMAGE_VERSION=$(if $(ENV_CSI_IMAGE_VERSION),$(ENV_CSI_IMAGE_VERSION),csi-v1.1.0-rc2)
3+
# VERSION is the git tag
4+
VERSION?=$(shell git describe --tags --match "csi-v*")
55

66
GO_PROJECT=github.com/opencurve/curve-csi
77
GIT_COMMIT=$(shell git rev-parse --short HEAD)
88
BUILD_TIME=$(shell date '+%Y%m%d.%H%M%S.%Z')
9-
GO_VERSION=$(shell go version|sed 's/ /-/g')
10-
TESTARGS_DEFAULT := "-v"
11-
export TESTARGS ?= $(TESTARGS_DEFAULT)
129

1310
# go build flags
1411
LDFLAGS ?=
12+
LDFLAGS += -X $(GO_PROJECT)/pkg/util.Version=$(VERSION)
1513
LDFLAGS += -X $(GO_PROJECT)/pkg/util.GitCommit=$(GIT_COMMIT)
16-
# CSI_IMAGE_VERSION will be considered as the driver version
17-
LDFLAGS += -X $(GO_PROJECT)/pkg/util.Version=$(CSI_IMAGE_VERSION)
1814
LDFLAGS += -X $(GO_PROJECT)/pkg/util.BuildTime=$(BUILD_TIME)
19-
LDFLAGS += -X $(GO_PROJECT)/pkg/util.GoVersion=$(GO_VERSION)
2015

21-
all: curve-csi
16+
# test args
17+
TESTARGS_DEFAULT := "-v"
18+
export TESTARGS ?= $(TESTARGS_DEFAULT)
19+
20+
.PHONY: all
21+
all: build
2222

23+
.PHONY: test
2324
test:
2425
go test -tags=unit $(shell go list ./...) $(TESTARGS)
2526

26-
curve-csi:
27+
.PHONY: build
28+
build:
2729
if [ ! -d ./vendor ]; then (go mod tidy && go mod vendor); fi
28-
CGO_ENABLED=0 GOOS=linux go build -mod vendor -a -ldflags "$(LDFLAGS) -extldflags '-static'" -o _output/curve-csi ./cmd/
30+
CGO_ENABLED=0 GOOS=linux go build -mod vendor -a -ldflags "$(LDFLAGS) -extldflags '-static'" -o _output/curve-csi ./cmd/curve-csi.go
2931

30-
image: curve-csi
31-
cp _output/curve-csi images/curve-csi
32-
docker build --network host -t $(CSI_IMAGE_NAME):$(CSI_IMAGE_VERSION) ./images
32+
.PHONY: release-image
33+
release-image:
34+
docker build --network host -f ./build/curve-csi/Dockerfile \
35+
--build-arg VERSION="$(VERSION)" \
36+
-t $(CSI_IMAGE_NAME):$(VERSION) .
3337

34-
push-image: image
35-
docker push $(CSI_IMAGE_NAME):$(CSI_IMAGE_VERSION)
38+
.PHONY: push-image
39+
push-image:
40+
docker push $(CSI_IMAGE_NAME):$(VERSION)
3641

42+
.PHONY: clean
3743
clean:
3844
go clean -r -x
3945
rm -f _output/curve-csi

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Refer to [https://github.com/opencurve/curve](https://github.com/opencurve/curve
1313

1414
## Supported version
1515

16-
The driver is currently developed with csi spec v1.1.0, and tested on kubernetes v1.13+.
16+
The driver is currently developed with csi spec v1.5.0, and supported kubernetes v1.17+.
1717

1818
Other csi-v1.0+ enabled container orchestrator environments may work fine.
1919

build/curve-csi/Dockerfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
FROM golang:1.16.11
2+
3+
WORKDIR /go/src/github.com/opencurve/curve-csi
4+
COPY . .
5+
ARG VERSION
6+
RUN VERSION=${VERSION} make build
7+
8+
FROM us.gcr.io/k8s-artifacts-prod/build-image/debian-base-amd64:v2.1.0
9+
LABEL name="curve-csi" \
10+
license="Apache Version 2.0" \
11+
maintainers="The Netease Kubernetes Authors" \
12+
description="Curve CSI Plugin" \
13+
architecture="amd64" \
14+
distribution-scope="public" \
15+
summary="Curve CSI Plugin" \
16+
help="none"
17+
RUN clean-install ca-certificates e2fsprogs mount xfsprogs udev
18+
COPY --from=0 /go/src/github.com/opencurve/curve-csi/_output/curve-csi /bin/curve-csi
19+
RUN chmod +x /bin/curve-csi
20+
21+
ENTRYPOINT ["/bin/curve-csi"]

charts/curve-csi/Chart.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,5 @@ version: 0.1.0
2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to
2222
# follow Semantic Versioning. They should reflect the version the application is using.
23-
appVersion: 1.16.0
23+
# It is recommended to use it with quotes.
24+
appVersion: "csi-v1.5.0-rc1"

charts/curve-csi/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ The curve-csi chart adds the curve volume support to your k8s cluster.
77
Install the chart to your kubernetes cluster:
88

99
```bash
10-
helm install --namespace "curve-csi-system" --name "curve-csi" ./curve-csi
10+
helm install --namespace "curve-csi-system" ./curve-csi
1111
```
1212

1313
After installation succeeds, you can get a status of Chart:

charts/curve-csi/templates/NOTES.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.
Lines changed: 62 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,62 @@
1-
{{/* vim: set filetype=mustache: */}}
2-
{{/*
3-
Expand the name of the chart.
4-
*/}}
5-
{{- define "curve-csi.name" -}}
6-
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
7-
{{- end -}}
8-
9-
{{/*
10-
Create a default fully qualified app name.
11-
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
12-
If release name contains chart name it will be used as a full name.
13-
*/}}
14-
{{- define "curve-csi.fullname" -}}
15-
{{- if .Values.fullnameOverride -}}
16-
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
17-
{{- else -}}
18-
{{- $name := default .Chart.Name .Values.nameOverride -}}
19-
{{- if contains $name .Release.Name -}}
20-
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
21-
{{- else -}}
22-
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
23-
{{- end -}}
24-
{{- end -}}
25-
{{- end -}}
26-
27-
{{/*
28-
Create chart name and version as used by the chart label.
29-
*/}}
30-
{{- define "curve-csi.chart" -}}
31-
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
32-
{{- end -}}
33-
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "curve-csi.name" -}}
5+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
6+
{{- end }}
7+
8+
{{/*
9+
Create a default fully qualified app name.
10+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
11+
If release name contains chart name it will be used as a full name.
12+
*/}}
13+
{{- define "curve-csi.fullname" -}}
14+
{{- if .Values.fullnameOverride }}
15+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
16+
{{- else }}
17+
{{- $name := default .Chart.Name .Values.nameOverride }}
18+
{{- if contains $name .Release.Name }}
19+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
20+
{{- else }}
21+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
22+
{{- end }}
23+
{{- end }}
24+
{{- end }}
25+
26+
{{/*
27+
Create chart name and version as used by the chart label.
28+
*/}}
29+
{{- define "curve-csi.chart" -}}
30+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
31+
{{- end }}
32+
33+
{{/*
34+
Common labels
35+
*/}}
36+
{{- define "curve-csi.labels" -}}
37+
helm.sh/chart: {{ include "curve-csi.chart" . }}
38+
{{ include "curve-csi.selectorLabels" . }}
39+
{{- if .Chart.AppVersion }}
40+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
41+
{{- end }}
42+
app.kubernetes.io/managed-by: {{ .Release.Service }}
43+
{{- end }}
44+
45+
{{/*
46+
Selector labels
47+
*/}}
48+
{{- define "curve-csi.selectorLabels" -}}
49+
app.kubernetes.io/name: {{ include "curve-csi.name" . }}
50+
app.kubernetes.io/instance: {{ .Release.Name }}
51+
{{- end }}
52+
53+
{{/*
54+
Create the name of the service account to use
55+
*/}}
56+
{{- define "curve-csi.serviceAccountName" -}}
57+
{{- if .Values.serviceAccount.create }}
58+
{{- default (include "curve-csi.fullname" .) .Values.serviceAccount.name }}
59+
{{- else }}
60+
{{- default "default" .Values.serviceAccount.name }}
61+
{{- end }}
62+
{{- end }}

0 commit comments

Comments
 (0)