Skip to content

Commit a64be5d

Browse files
refact(csi): move common csi libraries (#1)
move the common CSI libraries from openebs/zfs-localpv to lib-csi repo which can be reused in other CSI implementations Signed-off-by: shubham <[email protected]>
1 parent 6664d0e commit a64be5d

29 files changed

+2962
-0
lines changed

.github/pull_request_template.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<!-- Thanks for sending a pull request! Before submitting:
2+
3+
1. Read our CONTRIBUTING.md guide for detailed contributing guidelines.
4+
2. Rebase your PR if it gets out of sync with master
5+
-->
6+
7+
**What this PR does**:
8+
9+
**Which issue(s) this PR fixes**:
10+
Fixes #<issue number>
11+
12+
13+
**Special notes for your reviewer**:
14+
15+
**Checklist**
16+
- [ ] PR messages has document related information
17+
- [ ] Labelled this PR & related issue with `documentation` tag
18+
- [ ] PR messages has breaking changes related information
19+
- [ ] PR messages has upgrade related information
20+
- [ ] Labelled this PR & related issue with `requires-upgrade` tag
21+
- [ ] Tests updated

.github/workflows/golang-ci.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
2+
# Copyright 2020 The OpenEBS Authors. All rights reserved.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
name: golangci-lint
17+
on: [push, pull_request]
18+
jobs:
19+
golangci:
20+
name: lint
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v2
24+
- name: golangci-lint
25+
uses: golangci/golangci-lint-action@v2
26+
with:
27+
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
28+
version: v1.29
29+
30+
# Optional: working directory, useful for monorepos
31+
# working-directory: somedir
32+
33+
# Optional: golangci-lint command line arguments.
34+
# args: --issues-exit-code=0
35+
36+
# Optional: show only new issues if it's a pull request. The default value is `false`.
37+
# only-new-issues: true

.github/workflows/test.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
2+
# Copyright 2020 The OpenEBS Authors. All rights reserved.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
name: Test
17+
on: [push, pull_request]
18+
jobs:
19+
20+
test:
21+
name: Test
22+
runs-on: ubuntu-latest
23+
steps:
24+
25+
- name: Set up Go 1.14
26+
uses: actions/setup-go@v1
27+
with:
28+
go-version: 1.14.7
29+
id: go
30+
31+
- name: Check out code into the Go module directory
32+
uses: actions/checkout@v2
33+
34+
- name: verify license
35+
run: make license-check
36+
37+
- name: verify dependencies
38+
run: make deps
39+
40+
- name: verify tests
41+
run: make test
42+

Makefile

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Copyright © 2020 The OpenEBS Authors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
PACKAGES = $(shell go list ./... | grep -v 'vendor\|pkg/client\|tests')
16+
17+
.PHONY: format
18+
format:
19+
@echo "--> Running go fmt"
20+
@go fmt $(PACKAGES)
21+
22+
# deps ensures fresh go.mod and go.sum.
23+
.PHONY: deps
24+
deps:
25+
@go mod tidy
26+
@go mod verify
27+
28+
.PHONY: test
29+
test: format
30+
@echo "--> Running go test" ;
31+
@go test $(PACKAGES)
32+
33+
.PHONY: license-check
34+
license-check:
35+
@echo "--> Checking license header..."
36+
@licRes=$$(for file in $$(find . -type f -regex '.*\.sh\|.*\.go\|.*Docker.*\|.*\Makefile*' ! -path './vendor/*' ) ; do \
37+
awk 'NR<=5' $$file | grep -Eq "(Copyright|generated|GENERATED)" || echo $$file; \
38+
done); \
39+
if [ -n "$${licRes}" ]; then \
40+
echo "license header checking failed:"; echo "$${licRes}"; \
41+
exit 1; \
42+
fi
43+
@echo "--> Done checking license."
44+
@echo

go.mod

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
module github.com/openebs/lib-csi
2+
3+
go 1.14
4+
5+
require (
6+
github.com/container-storage-interface/spec v1.1.0
7+
github.com/gogo/protobuf v1.3.0 // indirect
8+
github.com/googleapis/gnostic v0.3.1 // indirect
9+
github.com/imdario/mergo v0.3.7 // indirect
10+
github.com/json-iterator/go v1.1.8 // indirect
11+
github.com/kr/pretty v0.1.0 // indirect
12+
github.com/pkg/errors v0.8.1
13+
github.com/spf13/pflag v1.0.5 // indirect
14+
github.com/stretchr/testify v1.5.1 // indirect
15+
golang.org/x/crypto v0.0.0-20190829043050-9756ffdc2472 // indirect
16+
golang.org/x/net v0.0.0-20191004110552-13f9640d40b9 // indirect
17+
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 // indirect
18+
golang.org/x/sys v0.0.0-20190902133755-9109b7679e13 // indirect
19+
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 // indirect
20+
google.golang.org/appengine v1.6.2 // indirect
21+
google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9 // indirect
22+
google.golang.org/grpc v1.23.1 // indirect
23+
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect
24+
gopkg.in/inf.v0 v0.9.1 // indirect
25+
k8s.io/api v0.15.12
26+
k8s.io/apimachinery v0.15.12
27+
k8s.io/client-go v11.0.1-0.20190409021438-1a26190bd76a+incompatible
28+
k8s.io/klog v1.0.0
29+
k8s.io/kubernetes v1.15.12
30+
k8s.io/utils v0.0.0-20191114184206-e782cd3c129f // indirect
31+
)
32+
33+
replace (
34+
k8s.io/api => k8s.io/api v0.15.12
35+
k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.15.12
36+
k8s.io/apimachinery => k8s.io/apimachinery v0.15.12
37+
k8s.io/apiserver => k8s.io/apiserver v0.15.12
38+
k8s.io/cli-runtime => k8s.io/cli-runtime v0.15.12
39+
k8s.io/client-go => k8s.io/client-go v0.15.12
40+
k8s.io/cloud-provider => k8s.io/cloud-provider v0.15.12
41+
k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.15.12
42+
k8s.io/code-generator => k8s.io/code-generator v0.15.12
43+
k8s.io/component-base => k8s.io/component-base v0.15.12
44+
k8s.io/cri-api => k8s.io/cri-api v0.15.12
45+
k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.15.12
46+
k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.15.12
47+
k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.15.12
48+
k8s.io/kube-proxy => k8s.io/kube-proxy v0.15.12
49+
k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.15.12
50+
k8s.io/kubectl => k8s.io/kubectl v0.15.12
51+
k8s.io/kubelet => k8s.io/kubelet v0.15.12
52+
k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.15.12
53+
k8s.io/metrics => k8s.io/metrics v0.15.12
54+
k8s.io/node-api => k8s.io/node-api v0.15.12
55+
k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.15.12
56+
k8s.io/sample-cli-plugin => k8s.io/sample-cli-plugin v0.15.12
57+
k8s.io/sample-controller => k8s.io/sample-controller v0.15.12
58+
)

0 commit comments

Comments
 (0)