-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathDockerfile.csi-sanity
55 lines (50 loc) · 2.28 KB
/
Dockerfile.csi-sanity
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
ARG BASE_IMAGE
ARG BUILD_IMAGE
# csi-sanity build container
FROM $BUILD_IMAGE as builder-csi-sanity
WORKDIR /go/src/github.com/kubernetes-csi/
# csi-sanity versions: https://github.com/kubernetes-csi/csi-test/releases
ARG CSI_SANITY_VERSION_TAG
ENV CSI_SANITY_VERSION_TAG=$CSI_SANITY_VERSION_TAG
RUN apk add --no-cache make git
RUN git clone https://github.com/kubernetes-csi/csi-test.git &&\
cd csi-test &&\
git checkout -b ${CSI_SANITY_VERSION_TAG} ${CSI_SANITY_VERSION_TAG} &&\
cd cmd/csi-sanity &&\
make linux_amd64_dist &&\
cp ./csi-sanity /csi-sanity
# driver build container
FROM $BUILD_IMAGE as builder-driver
WORKDIR /go/src/github.com/Nexenta/nexentastor-csi-driver/
COPY . ./
RUN apk add --no-cache make git
RUN make build &&\
cp ./bin/nexentastor-csi-driver /nexentastor-csi-driver
# run driver and csi-sanity tests
FROM $BASE_IMAGE
WORKDIR /
# driver UNIX socket
ENV SOCK="unix:///csi.sock"
# install dependencies
RUN apk update &&\
apk add --no-cache rpcbind nfs-utils
# copy csi-sanity from build container
COPY --from=builder-csi-sanity /csi-sanity /
# copy driver from build container
COPY --from=builder-driver /nexentastor-csi-driver /
# copy driver config file
COPY ./tests/csi-sanity/driver-config-csi-sanity.yaml /config/driver-config-csi-sanity.yaml
# create mount direactory for tests
# driver run script
RUN echo '/nexentastor-csi-driver --config-dir=/config --endpoint=${SOCK} --nodeid=local &' > /run-driver &&\
chmod +x /run-driver
# details: https://stackoverflow.com/questions/34729748/installed-go-binary-not-found-in-path-on-alpine-linux-docker
RUN mkdir /lib64 &&\
ln -s /lib/libc.musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2
# versions
RUN /csi-sanity -version &&\
/nexentastor-csi-driver --version
# other csi-sanity options: --ginkgo.v -ginkgo.noColor
#TODO remove "--ginkgo.skip" option after fixing volume paginatin by token:
ENTRYPOINT ["/bin/sh", "-c", "/run-driver && /csi-sanity --csi.endpoint=${SOCK} --csi.createpathcmdtimeout=180s --csi.removepathcmdtimeout=180s --ginkgo.skip 'pagination should detect volumes added between pages and accept tokens when the last volume from a page is deleted'"]
#ENTRYPOINT ["/bin/sh", "-c", "/run-driver && /csi-sanity --csi.endpoint=${SOCK} --csi.createpathcmdtimeout=180 --csi.removepathcmdtimeout=180]