parent
6ba0258c1f
commit
83db9c8f9a
9
Makefile
9
Makefile
|
|
@ -117,15 +117,15 @@ e2e-teardown:
|
|||
|
||||
.PHONY: smb
|
||||
smb:
|
||||
CGO_ENABLED=0 GOOS=linux GOARCH=$(ARCH) go build -a -ldflags ${LDFLAGS} -mod vendor -o _output/smbplugin ./pkg/smbplugin
|
||||
CGO_ENABLED=0 GOOS=linux GOARCH=$(ARCH) go build -a -ldflags ${LDFLAGS} -mod vendor -o _output/${ARCH}/smbplugin ./pkg/smbplugin
|
||||
|
||||
.PHONY: smb-windows
|
||||
smb-windows:
|
||||
CGO_ENABLED=0 GOOS=windows go build -a -ldflags ${LDFLAGS} -mod vendor -o _output/smbplugin.exe ./pkg/smbplugin
|
||||
CGO_ENABLED=0 GOOS=windows go build -a -ldflags ${LDFLAGS} -mod vendor -o _output/${ARCH}/smbplugin.exe ./pkg/smbplugin
|
||||
|
||||
.PHONY: smb-darwin
|
||||
smb-darwin:
|
||||
CGO_ENABLED=0 GOOS=darwin go build -a -ldflags ${LDFLAGS} -mod vendor -o _output/smbplugin ./pkg/smbplugin
|
||||
CGO_ENABLED=0 GOOS=darwin go build -a -ldflags ${LDFLAGS} -mod vendor -o _output/${ARCH}/smbplugin ./pkg/smbplugin
|
||||
|
||||
.PHONY: container
|
||||
container: smb
|
||||
|
|
@ -139,7 +139,8 @@ container-linux:
|
|||
.PHONY: container-windows
|
||||
container-windows:
|
||||
docker buildx build --pull --output=type=$(OUTPUT_TYPE) --platform="windows/$(ARCH)" \
|
||||
-t $(IMAGE_TAG)-windows-$(OSVERSION)-$(ARCH) --build-arg OSVERSION=$(OSVERSION) -f ./pkg/smbplugin/Windows.Dockerfile .
|
||||
-t $(IMAGE_TAG)-windows-$(OSVERSION)-$(ARCH) --build-arg OSVERSION=$(OSVERSION) \
|
||||
--build-arg ARCH=$(ARCH) -f ./pkg/smbplugin/Windows.Dockerfile .
|
||||
|
||||
.PHONY: container-all
|
||||
container-all: smb-windows
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ $ make build
|
|||
#### Start CSI driver locally
|
||||
```console
|
||||
$ cd $GOPATH/src/github.com/kubernetes-csi/csi-driver-smb
|
||||
$ ./_output/smbplugin --endpoint tcp://127.0.0.1:10000 --nodeid CSINode -v=5 &
|
||||
$ ./_output/amd64/smbplugin --endpoint tcp://127.0.0.1:10000 --nodeid CSINode -v=5 &
|
||||
```
|
||||
|
||||
#### 1. Get plugin info
|
||||
|
|
|
|||
|
|
@ -12,15 +12,14 @@
|
|||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
ARG LDFLAGS
|
||||
ARG ARCH
|
||||
|
||||
FROM k8s.gcr.io/build-image/debian-base-${ARCH}:v2.1.3
|
||||
COPY ./_output/smbplugin /smbplugin
|
||||
RUN clean-install ca-certificates cifs-utils util-linux e2fsprogs mount udev xfsprogs
|
||||
|
||||
LABEL maintainers="andyzhangx"
|
||||
LABEL description="SMB CSI Driver"
|
||||
ARG ARCH
|
||||
|
||||
COPY ./_output/smbplugin /smbplugin
|
||||
COPY ./_output/${ARCH}/smbplugin /smbplugin
|
||||
ENTRYPOINT ["/smbplugin"]
|
||||
|
|
|
|||
|
|
@ -1,10 +1,12 @@
|
|||
ARG OSVERSION
|
||||
FROM --platform=linux/amd64 gcr.io/k8s-staging-e2e-test-images/windows-servercore-cache:1.0-linux-amd64-${OSVERSION} as core
|
||||
ARG ARCH=amd64
|
||||
FROM --platform=linux/${ARCH} gcr.io/k8s-staging-e2e-test-images/windows-servercore-cache:1.0-linux-${ARCH}-${OSVERSION} as core
|
||||
|
||||
FROM mcr.microsoft.com/windows/nanoserver:${OSVERSION}
|
||||
LABEL description="CSI SMB plugin"
|
||||
|
||||
COPY ./_output/smbplugin.exe /smbplugin.exe
|
||||
ARG ARCH=amd64
|
||||
COPY ./_output/${ARCH}/smbplugin.exe /smbplugin.exe
|
||||
COPY --from=core /Windows/System32/netapi32.dll /Windows/System32/netapi32.dll
|
||||
USER ContainerAdministrator
|
||||
ENTRYPOINT ["/smbplugin.exe"]
|
||||
|
|
|
|||
|
|
@ -17,5 +17,6 @@ RUN apt-get update && apt-get install -y ca-certificates cifs-utils util-linux e
|
|||
LABEL maintainers="andyzhangx"
|
||||
LABEL description="SMB CSI Driver"
|
||||
|
||||
COPY ./_output/smbplugin /smbplugin
|
||||
ARG ARCH=amd64
|
||||
COPY ./_output/${ARCH}/smbplugin /smbplugin
|
||||
ENTRYPOINT ["/smbplugin"]
|
||||
|
|
|
|||
|
|
@ -43,8 +43,13 @@ target_path='/tmp/targetpath'
|
|||
|
||||
echo "Begin to run integration test ..."
|
||||
|
||||
ARCH=$(uname -p)
|
||||
if [[ "${ARCH}" == "x86_64" || ${ARCH} == "unknown" ]]; then
|
||||
ARCH="amd64"
|
||||
fi
|
||||
|
||||
# Run CSI driver as a background service
|
||||
_output/smbplugin --endpoint "$endpoint" --nodeid CSINode -v=5 &
|
||||
_output/${ARCH}/smbplugin --endpoint "$endpoint" --nodeid CSINode -v=5 &
|
||||
trap cleanup EXIT
|
||||
|
||||
sleep 5
|
||||
|
|
|
|||
|
|
@ -63,13 +63,18 @@ if [[ "$#" -gt 0 ]] && [[ -n "$1" ]]; then
|
|||
nodeid="$1"
|
||||
fi
|
||||
|
||||
ARCH=$(uname -p)
|
||||
if [[ "${ARCH}" == "x86_64" || ${ARCH} == "unknown" ]]; then
|
||||
ARCH="amd64"
|
||||
fi
|
||||
|
||||
if [ -z "$GITHUB_ACTIONS" ]
|
||||
then
|
||||
# if not running on github actions, do not use sudo
|
||||
_output/smbplugin --endpoint "$endpoint" --nodeid "$nodeid" -v=5 &
|
||||
_output/${ARCH}/smbplugin --endpoint "$endpoint" --nodeid "$nodeid" -v=5 &
|
||||
else
|
||||
# if running on github actions, use sudo
|
||||
sudo _output/smbplugin --endpoint "$endpoint" --nodeid "$nodeid" -v=5 &
|
||||
sudo _output/${ARCH}/smbplugin --endpoint "$endpoint" --nodeid "$nodeid" -v=5 &
|
||||
fi
|
||||
|
||||
echo 'Begin to run sanity test...'
|
||||
|
|
|
|||
Loading…
Reference in New Issue