Skip to content

Commit

Permalink
Merge pull request #2 from opencurve/spy-dev-csi-1.5
Browse files Browse the repository at this point in the history
release for csi-v1.5.0
  • Loading branch information
spyyang authored Dec 10, 2021
2 parents 8cc8533 + 255a2d3 commit 75f5ff8
Show file tree
Hide file tree
Showing 966 changed files with 218,249 additions and 142,912 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## csi-v1.5.0-rc1

- update csi spec to v1.5.0

## csi-v1.1.0-rc2

- bug fix of parsing output of `curve-nbd list-mapped`: #1

## csi-v1.1.0-rc1

first release
40 changes: 23 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,39 +1,45 @@
.PHONY: all
CSI_IMAGE_NAME?=harbor.cloud.netease.com/qzprod-k8s/k8scsi/curve-csi

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

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

# go build flags
LDFLAGS ?=
LDFLAGS += -X $(GO_PROJECT)/pkg/util.Version=$(VERSION)
LDFLAGS += -X $(GO_PROJECT)/pkg/util.GitCommit=$(GIT_COMMIT)
# CSI_IMAGE_VERSION will be considered as the driver version
LDFLAGS += -X $(GO_PROJECT)/pkg/util.Version=$(CSI_IMAGE_VERSION)
LDFLAGS += -X $(GO_PROJECT)/pkg/util.BuildTime=$(BUILD_TIME)
LDFLAGS += -X $(GO_PROJECT)/pkg/util.GoVersion=$(GO_VERSION)

all: curve-csi
# test args
TESTARGS_DEFAULT := "-v"
export TESTARGS ?= $(TESTARGS_DEFAULT)

.PHONY: all
all: build

.PHONY: test
test:
go test -tags=unit $(shell go list ./...) $(TESTARGS)

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

image: curve-csi
cp _output/curve-csi images/curve-csi
docker build --network host -t $(CSI_IMAGE_NAME):$(CSI_IMAGE_VERSION) ./images
.PHONY: release-image
release-image:
docker build --network host -f ./build/curve-csi/Dockerfile \
--build-arg VERSION="$(VERSION)" \
-t $(CSI_IMAGE_NAME):$(VERSION) .

push-image: image
docker push $(CSI_IMAGE_NAME):$(CSI_IMAGE_VERSION)
.PHONY: push-image
push-image:
docker push $(CSI_IMAGE_NAME):$(VERSION)

.PHONY: clean
clean:
go clean -r -x
rm -f _output/curve-csi
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Refer to [https://github.com/opencurve/curve](https://github.com/opencurve/curve

## Supported version

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

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

Expand Down
21 changes: 21 additions & 0 deletions build/curve-csi/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM golang:1.16.11

WORKDIR /go/src/github.com/opencurve/curve-csi
COPY . .
ARG VERSION
RUN VERSION=${VERSION} make build

FROM us.gcr.io/k8s-artifacts-prod/build-image/debian-base-amd64:v2.1.0
LABEL name="curve-csi" \
license="Apache Version 2.0" \
maintainers="The Netease Kubernetes Authors" \
description="Curve CSI Plugin" \
architecture="amd64" \
distribution-scope="public" \
summary="Curve CSI Plugin" \
help="none"
RUN clean-install ca-certificates e2fsprogs mount xfsprogs udev
COPY --from=0 /go/src/github.com/opencurve/curve-csi/_output/curve-csi /bin/curve-csi
RUN chmod +x /bin/curve-csi

ENTRYPOINT ["/bin/curve-csi"]
3 changes: 2 additions & 1 deletion charts/curve-csi/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ version: 0.1.0
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
appVersion: 1.16.0
# It is recommended to use it with quotes.
appVersion: "csi-v1.5.0-rc1"
2 changes: 1 addition & 1 deletion charts/curve-csi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The curve-csi chart adds the curve volume support to your k8s cluster.
Install the chart to your kubernetes cluster:

```bash
helm install --namespace "curve-csi-system" --name "curve-csi" ./curve-csi
helm install --namespace "curve-csi-system" ./curve-csi
```

After installation succeeds, you can get a status of Chart:
Expand Down
2 changes: 0 additions & 2 deletions charts/curve-csi/templates/NOTES.txt

This file was deleted.

95 changes: 62 additions & 33 deletions charts/curve-csi/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -1,33 +1,62 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "curve-csi.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "curve-csi.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "curve-csi.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Expand the name of the chart.
*/}}
{{- define "curve-csi.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "curve-csi.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "curve-csi.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "curve-csi.labels" -}}
helm.sh/chart: {{ include "curve-csi.chart" . }}
{{ include "curve-csi.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "curve-csi.selectorLabels" -}}
app.kubernetes.io/name: {{ include "curve-csi.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "curve-csi.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "curve-csi.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
Loading

0 comments on commit 75f5ff8

Please sign in to comment.