Skip to content

Commit 01eaa8c

Browse files
authored
Fix #172 support e2e regression (#173)
* Fix #172 support e2e regression Signed-off-by: David Ko <[email protected]>
1 parent a18426d commit 01eaa8c

Some content is hidden

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

86 files changed

+22135
-294
lines changed

Diff for: .drone.yml

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ steps:
1111
image: rancher/dapper:v0.4.1
1212
commands:
1313
- dapper ci
14+
- dapper e2e-test
1415
volumes:
1516
- name: docker
1617
path: /var/run/docker.sock

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
*.swp
66
.idea
77
.vscode/
8+
Dockerfile.dapper[0-9]*

Diff for: Dockerfile.dapper

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.12.1-alpine3.9
1+
FROM golang:1.15-alpine3.12
22

33
ARG DAPPER_HOST_ARCH
44
ENV ARCH $DAPPER_HOST_ARCH
@@ -14,13 +14,17 @@ RUN mkdir -p /go/src/golang.org/x && \
1414
go install golang.org/x/tools/cmd/goimports
1515
RUN rm -rf /go/src /go/pkg
1616
RUN if [ "${ARCH}" == "amd64" ]; then \
17-
curl -sL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s v1.15.0; \
18-
fi
17+
curl -sL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s v1.36.0; \
18+
fi; \
19+
curl -sL "https://kind.sigs.k8s.io/dl/v0.10.0/kind-linux-${ARCH}" -o kind && install kind /usr/local/bin; \
20+
curl -sLO "https://dl.k8s.io/release/v1.20.2/bin/linux/${ARCH}/kubectl" && install kubectl /usr/local/bin; \
21+
curl -sL "https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv3.9.2/kustomize_v3.9.2_linux_${ARCH}.tar.gz" | tar -zxv -C /usr/local/bin;
1922

2023
ENV DAPPER_ENV REPO TAG DRONE_TAG
2124
ENV DAPPER_SOURCE /go/src/github.com/rancher/local-path-provisioner/
2225
ENV DAPPER_OUTPUT ./bin ./dist
2326
ENV DAPPER_DOCKER_SOCKET true
27+
ENV DAPPER_RUN_ARGS --network=host
2428
ENV HOME ${DAPPER_SOURCE}
2529
WORKDIR ${DAPPER_SOURCE}
2630

Diff for: Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ $(TARGETS): .dapper
1212

1313
.DEFAULT_GOAL := default
1414

15-
.PHONY: $(TARGETS)
15+
.PHONY: $(TARGETS)

Diff for: README.md

+20-6
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ In this setup, the directory `/opt/local-path-provisioner` will be used across a
2828
kubectl apply -f https://raw.githubusercontent.com/rancher/local-path-provisioner/master/deploy/local-path-storage.yaml
2929
```
3030

31+
Or, use `kustomize` to deploy.
32+
```
33+
kustomize build "github.com/rancher/local-path-provisioner/deploy?ref=master" | kubectl apply -f -
34+
```
35+
3136
After installation, you should see something like the following:
3237
```
3338
$ kubectl -n local-path-storage get pod
@@ -43,10 +48,14 @@ $ kubectl -n local-path-storage logs -f -l app=local-path-provisioner
4348
## Usage
4449

4550
Create a `hostPath` backend Persistent Volume and a pod uses it:
51+
```
52+
kubectl create -f https://raw.githubusercontent.com/rancher/local-path-provisioner/master/examples/pvc/pvc.yaml
53+
kubectl create -f https://raw.githubusercontent.com/rancher/local-path-provisioner/master/examples/pod/pod.yaml
54+
```
4655

56+
Or, use `kustomize` to deploy them.
4757
```
48-
kubectl create -f https://raw.githubusercontent.com/rancher/local-path-provisioner/master/examples/pvc.yaml
49-
kubectl create -f https://raw.githubusercontent.com/rancher/local-path-provisioner/master/examples/pod.yaml
58+
kustomize build "github.com/rancher/local-path-provisioner/examples/pod?ref=master" | kubectl apply -f -
5059
```
5160

5261
You should see the PV has been created:
@@ -77,12 +86,12 @@ kubectl exec volume-test -- sh -c "echo local-path-test > /data/test"
7786

7887
Now delete the pod using
7988
```
80-
kubectl delete -f https://raw.githubusercontent.com/rancher/local-path-provisioner/master/examples/pod.yaml
89+
kubectl delete -f https://raw.githubusercontent.com/rancher/local-path-provisioner/master/examples/pod/pod.yaml
8190
```
8291

8392
After confirm that the pod is gone, recreated the pod using
8493
```
85-
kubectl create -f https://raw.githubusercontent.com/rancher/local-path-provisioner/master/examples/pod.yaml
94+
kubectl create -f https://raw.githubusercontent.com/rancher/local-path-provisioner/master/examples/pod/pod.yaml
8695
```
8796

8897
Check the volume content:
@@ -93,8 +102,13 @@ local-path-test
93102

94103
Delete the pod and pvc
95104
```
96-
kubectl delete -f https://raw.githubusercontent.com/rancher/local-path-provisioner/master/examples/pod.yaml
97-
kubectl delete -f https://raw.githubusercontent.com/rancher/local-path-provisioner/master/examples/pvc.yaml
105+
kubectl delete -f https://raw.githubusercontent.com/rancher/local-path-provisioner/master/examples/pod/pod.yaml
106+
kubectl delete -f https://raw.githubusercontent.com/rancher/local-path-provisioner/master/examples/pvc/pvc.yaml
107+
```
108+
109+
Or, use `kustomize` to delete them.
110+
```
111+
kustomize build "github.com/rancher/local-path-provisioner/examples/pod?ref=master" | kubectl delete -f -
98112
```
99113

100114
The volume content stored on the node will be automatically cleaned up. You can check the log of `local-path-provisioner-xxx` for details.

Diff for: deploy/example-config.yaml

+56-56
Original file line numberDiff line numberDiff line change
@@ -5,66 +5,66 @@ metadata:
55
namespace: local-path-storage
66
data:
77
config.json: |-
8-
{
9-
"nodePathMap":[
10-
{
11-
"node":"DEFAULT_PATH_FOR_NON_LISTED_NODES",
12-
"paths":["/opt/local-path-provisioner"]
13-
},
14-
{
15-
"node":"yasker-lp-dev1",
16-
"paths":["/opt/local-path-provisioner", "/data1"]
17-
},
18-
{
19-
"node":"yasker-lp-dev3",
20-
"paths":[]
21-
}
22-
]
23-
}
8+
{
9+
"nodePathMap":[
10+
{
11+
"node":"DEFAULT_PATH_FOR_NON_LISTED_NODES",
12+
"paths":["/opt/local-path-provisioner"]
13+
},
14+
{
15+
"node":"yasker-lp-dev1",
16+
"paths":["/opt/local-path-provisioner", "/data1"]
17+
},
18+
{
19+
"node":"yasker-lp-dev3",
20+
"paths":[]
21+
}
22+
]
23+
}
2424
setup: |-
25-
#!/bin/sh
26-
while getopts "m:s:p:" opt
27-
do
28-
case $opt in
29-
p)
30-
absolutePath=$OPTARG
31-
;;
32-
s)
33-
sizeInBytes=$OPTARG
34-
;;
35-
m)
36-
volMode=$OPTARG
37-
;;
38-
esac
39-
done
25+
#!/bin/sh
26+
while getopts "m:s:p:" opt
27+
do
28+
case $opt in
29+
p)
30+
absolutePath=$OPTARG
31+
;;
32+
s)
33+
sizeInBytes=$OPTARG
34+
;;
35+
m)
36+
volMode=$OPTARG
37+
;;
38+
esac
39+
done
4040
41-
mkdir -m 0777 -p ${absolutePath}
41+
mkdir -m 0777 -p ${absolutePath}
4242
teardown: |-
43-
#!/bin/sh
44-
while getopts "m:s:p:" opt
45-
do
46-
case $opt in
47-
p)
48-
absolutePath=$OPTARG
49-
;;
50-
s)
51-
sizeInBytes=$OPTARG
52-
;;
53-
m)
54-
volMode=$OPTARG
55-
;;
56-
esac
57-
done
43+
#!/bin/sh
44+
while getopts "m:s:p:" opt
45+
do
46+
case $opt in
47+
p)
48+
absolutePath=$OPTARG
49+
;;
50+
s)
51+
sizeInBytes=$OPTARG
52+
;;
53+
m)
54+
volMode=$OPTARG
55+
;;
56+
esac
57+
done
5858
59-
rm -rf ${absolutePath}
59+
rm -rf ${absolutePath}
6060
helperPod.yaml: |-
61-
apiVersion: v1
62-
kind: Pod
63-
metadata:
64-
name: helper-pod
65-
spec:
66-
containers:
67-
- name: helper-pod
68-
image: busybox
61+
apiVersion: v1
62+
kind: Pod
63+
metadata:
64+
name: helper-pod
65+
spec:
66+
containers:
67+
- name: helper-pod
68+
image: busybox
6969
7070

Diff for: deploy/kustomization.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
apiVersion: kustomize.config.k8s.io/v1beta1
33
kind: Kustomization
4-
54
resources:
65
- local-path-storage.yaml

0 commit comments

Comments
 (0)