Skip to content

Commit 29543c8

Browse files
authored
Merge pull request #64 from pohly/examples-drivername
examples + drivername
2 parents 9566dd7 + ca78448 commit 29543c8

File tree

12 files changed

+73
-36
lines changed

12 files changed

+73
-36
lines changed

.prow.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ CSI_PROW_GINKO_PARALLEL="-p -nodes 40" # default was 7
88
#CSI_PROW_BUILD_JOB=false
99
#CSI_PROW_KUBERNETES_VERSION=latest
1010
#CSI_PROW_HOSTPATH_CANARY=canary
11+
CSI_PROW_HOSTPATH_DRIVER_NAME="hostpath.csi.k8s.io"
1112

1213
CSI_PROW_TESTS_SANITY="sanity"
1314

README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ csi-hostpathplugin-0 2/2 Running 0 5m45s
8282
From the root directory, deploy the application pods including a storage class, a PVC, and a pod which mounts a volume using the Hostpath driver found in directory `./examples`:
8383

8484
```shell
85-
$ kubectl create -f ./examples
85+
$ for i in ./examples/csi-storageclass.yaml ./examples/csi-pvc.yaml ./examples/csi-app.yaml; do kubectl apply -f $i; done
8686
pod/my-csi-app created
8787
persistentvolumeclaim/csi-pvc created
8888
storageclass.storage.k8s.io/csi-hostpath-sc created
@@ -230,13 +230,14 @@ Since volume snapshot is an alpha feature starting in Kubernetes v1.12, you need
230230
> Resource Version: 2418
231231
> Self Link: /apis/snapshot.storage.k8s.io/v1alpha1/volumesnapshotclasses/csi-hostpath-snapclass
232232
> UID: c8f5bc47-c716-11e8-8911-000c2967769a
233-
> Snapshotter: csi-hostpath
233+
> Snapshotter: hostpath.csi.k8s.io
234234
> Events: <none>
235235
> ```
236236
237-
Use the volume snapshot class to dynamically create a volume snapshot:
237+
After having created the `csi-pvc` as described in the example above,
238+
use the volume snapshot class to dynamically create a volume snapshot:
238239
239-
> $ kubectl create -f examples/csi-snapshot.yaml
240+
> $ kubectl apply -f examples/csi-snapshot.yaml
240241
> ```
241242
> volumesnapshot.snapshot.storage.k8s.io/new-snapshot-demo created
242243
> ```
@@ -299,7 +300,7 @@ Use the volume snapshot class to dynamically create a volume snapshot:
299300
> Spec:
300301
> Csi Volume Snapshot Source:
301302
> Creation Time: 1538576205471577525
302-
> Driver: csi-hostpath
303+
> Driver: hostpath.csi.k8s.io
303304
> Restore Size: 1073741824
304305
> Snapshot Handle: f55ff979-c716-11e8-bb16-000c2967769a
305306
> Deletion Policy: Delete
@@ -324,7 +325,7 @@ Use the volume snapshot class to dynamically create a volume snapshot:
324325
325326
Follow the following example to create a volume from a volume snapshot:
326327
327-
> $ kubectl create -f examples/csi-restore.yaml
328+
> $ kubectl apply -f examples/csi-restore.yaml
328329
> `persistentvolumeclaim/hpvc-restore created`
329330
>
330331
> $ kubectl get pvc
@@ -387,7 +388,7 @@ spec:
387388
volumes:
388389
- name: my-csi-volume
389390
csi:
390-
driver: csi-hostpath
391+
driver: hostpath.csi.k8s.io
391392
```
392393
393394
> See sample YAML file [here](./examples/csi-app-inline.yaml).

cmd/hostpathplugin/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ func init() {
3131

3232
var (
3333
endpoint = flag.String("endpoint", "unix://tmp/csi.sock", "CSI endpoint")
34-
driverName = flag.String("drivername", "csi-hostpath", "name of the driver")
34+
driverName = flag.String("drivername", "hostpath.csi.k8s.io", "name of the driver")
3535
nodeID = flag.String("nodeid", "", "node id")
3636
ephemeral = flag.Bool("ephemeral", false, "deploy in ephemeral mode")
3737
showVersion = flag.Bool("version", false, "Show version.")

deploy/kubernetes-1.13/hostpath/csi-hostpath-plugin.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ spec:
6565
- name: hostpath
6666
image: quay.io/k8scsi/hostpathplugin:v1.1.0
6767
args:
68+
- "--drivername=hostpath.csi.k8s.io"
6869
- "--v=5"
6970
- "--endpoint=$(CSI_ENDPOINT)"
7071
- "--nodeid=$(KUBE_NODE_NAME)"

deploy/kubernetes-1.13/snapshotter/csi-hostpath-snapshotclass.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ apiVersion: snapshot.storage.k8s.io/v1alpha1
22
kind: VolumeSnapshotClass
33
metadata:
44
name: csi-hostpath-snapclass
5-
snapshotter: csi-hostpath
5+
snapshotter: hostpath.csi.k8s.io

deploy/kubernetes-1.14/hostpath/csi-hostpath-plugin.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ spec:
6565
- name: hostpath
6666
image: quay.io/k8scsi/hostpathplugin:v1.1.0
6767
args:
68+
- "--drivername=hostpath.csi.k8s.io"
6869
- "--v=5"
6970
- "--endpoint=$(CSI_ENDPOINT)"
7071
- "--nodeid=$(KUBE_NODE_NAME)"

deploy/kubernetes-1.14/snapshotter/csi-hostpath-snapshotclass.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ apiVersion: snapshot.storage.k8s.io/v1alpha1
22
kind: VolumeSnapshotClass
33
metadata:
44
name: csi-hostpath-snapclass
5-
snapshotter: csi-hostpath
5+
snapshotter: hostpath.csi.k8s.io

examples/csi-app-inline.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
kind: Pod
22
apiVersion: v1
33
metadata:
4-
name: my-csi-app
4+
name: my-csi-app-inline
55
spec:
66
containers:
77
- name: my-frontend
@@ -13,4 +13,4 @@ spec:
1313
volumes:
1414
- name: my-csi-volume
1515
csi:
16-
driver: csi-hostpath
16+
driver: hostpath.csi.k8s.io

examples/csi-storageclass.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ apiVersion: storage.k8s.io/v1
22
kind: StorageClass
33
metadata:
44
name: csi-hostpath-sc
5-
provisioner: csi-hostpath
5+
provisioner: hostpath.csi.k8s.io
66
reclaimPolicy: Delete
77
volumeBindingMode: Immediate

release-tools/build.make

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,14 +118,39 @@ test-fmt:
118118
fi
119119

120120
# This test only runs when dep >= 0.5 is installed, which is the case for the CI setup.
121+
# When using 'go mod', we allow the test to be skipped in the Prow CI under some special
122+
# circumstances, because it depends on accessing all remote repos and thus
123+
# running it all the time would defeat the purpose of vendoring:
124+
# - not handling a PR or
125+
# - the fabricated merge commit leaves go.mod, go.sum and vendor dir unchanged
126+
# - release-tools also didn't change (changing rules or Go version might lead to
127+
# a different result and thus must be tested)
121128
.PHONY: test-vendor
122129
test: test-vendor
123130
test-vendor:
124131
@ echo; echo "### $@:"
125-
@ case "$$(dep version 2>/dev/null | grep 'version *:')" in \
126-
*v0.[56789]*) dep check && echo "vendor up-to-date" || false;; \
127-
*) echo "skipping check, dep >= 0.5 required";; \
128-
esac
132+
@ if [ -f Gopkg.toml ]; then \
133+
echo "Repo uses 'dep' for vendoring."; \
134+
case "$$(dep version 2>/dev/null | grep 'version *:')" in \
135+
*v0.[56789]*) dep check && echo "vendor up-to-date" || false;; \
136+
*) echo "skipping check, dep >= 0.5 required";; \
137+
esac; \
138+
else \
139+
echo "Repo uses 'go mod' for vendoring."; \
140+
if [ "$${JOB_NAME}" ] && \
141+
( [ "$${JOB_TYPE}" != "presubmit" ] || \
142+
[ $$(git diff "${PULL_BASE_SHA}..HEAD" -- go.mod go.sum vendor release-tools | wc -l) -eq 0 ] ); then \
143+
echo "Skipping vendor check because the Prow pre-submit job does not change vendoring."; \
144+
elif ! GO111MODULE=on go mod vendor; then \
145+
echo "ERROR: vendor check failed."; \
146+
false; \
147+
elif [ $$(git status --porcelain -- vendor | wc -l) -gt 0 ]; then \
148+
echo "ERROR: vendor directory *not* up-to-date, it did get modified by 'GO111MODULE=on go mod vendor':"; \
149+
git status -- vendor; \
150+
git diff -- vendor; \
151+
false; \
152+
fi; \
153+
fi;
129154

130155
.PHONY: test-subtree
131156
test: test-subtree

0 commit comments

Comments
 (0)