diff --git a/Makefile b/Makefile index 2b2c9768d..ca4f48f49 100644 --- a/Makefile +++ b/Makefile @@ -29,7 +29,7 @@ CSI_IMAGE_TAG ?= $(REGISTRY)/$(IMAGE_NAME):$(IMAGE_VERSION) CSI_IMAGE_TAG_LATEST = $(REGISTRY)/$(IMAGE_NAME):latest BUILD_DATE ?= $(shell date -u +"%Y-%m-%dT%H:%M:%SZ") LDFLAGS ?= "-X ${PKG}/pkg/blob.driverVersion=${IMAGE_VERSION} -X ${PKG}/pkg/blob.gitCommit=${GIT_COMMIT} -X ${PKG}/pkg/blob.buildDate=${BUILD_DATE} -s -w -extldflags '-static'" -E2E_HELM_OPTIONS ?= --set image.blob.pullPolicy=Always --set image.blob.repository=$(REGISTRY)/$(IMAGE_NAME) --set image.blob.tag=$(IMAGE_VERSION) --set driver.userAgentSuffix="e2e-test" --set node.blobfuseProxy.migrateK8sRepo=true --set controller.runOnControlPlane=true +E2E_HELM_OPTIONS ?= --set image.blob.pullPolicy=Always --set image.blob.repository=$(REGISTRY)/$(IMAGE_NAME) --set image.blob.tag=$(IMAGE_VERSION) --set driver.userAgentSuffix="e2e-test" --set controller.runOnControlPlane=true ifdef ENABLE_BLOBFUSE_PROXY E2E_HELM_OPTIONS += --set node.enableBlobfuseProxy=true --set image.blob.pullPolicy=Always --set controller.logLevel=6 --set node.logLevel=6 endif diff --git a/pkg/blobfuse-proxy/init.sh b/pkg/blobfuse-proxy/init.sh index 7beaa13dc..a1d8c3a97 100755 --- a/pkg/blobfuse-proxy/init.sh +++ b/pkg/blobfuse-proxy/init.sh @@ -39,7 +39,7 @@ echo "Linux distribution: $DISTRIBUTION, Arch: $ARCH" # install blobfuse-proxy and blobfuse/blofuse2 if needed case "${DISTRIBUTION}" in - "rhcos") + "rhcos" | "cos") . ./blobfuse-proxy/install-proxy-rhcos.sh ;; *) diff --git a/pkg/blobfuse-proxy/install-proxy-rhcos.sh b/pkg/blobfuse-proxy/install-proxy-rhcos.sh index e15ae011a..522160a02 100644 --- a/pkg/blobfuse-proxy/install-proxy-rhcos.sh +++ b/pkg/blobfuse-proxy/install-proxy-rhcos.sh @@ -16,12 +16,16 @@ set -xe -# in coreos, we could just copy the blobfuse2 binary to /usr/local/bin/blobfuse2 +BIN_PATH=${BIN_PATH:-/usr/local/bin} +if [ "${DISTRIBUTION}" = "cos" ]; then + BIN_PATH="/home/kubernetes/bin" +fi +#copy blobfuse2 binary to BIN_PATH/blobfuse2 updateBlobfuse2="true" if [ "${INSTALL_BLOBFUSE}" = "true" ] || [ "${INSTALL_BLOBFUSE2}" = "true" ] then - if [ -f "/host/usr/local/bin/blobfuse2" ];then - old=$(sha256sum /host/usr/local/bin/blobfuse2 | awk '{print $1}') + if [ -f "/host/${BIN_PATH}/blobfuse2" ];then + old=$(sha256sum /host/${BIN_PATH}/blobfuse2 | awk '{print $1}') new=$(sha256sum /usr/bin/blobfuse2 | awk '{print $1}') if [ "$old" = "$new" ];then updateBlobfuse2="false" @@ -34,15 +38,15 @@ else fi if [ "$updateBlobfuse2" = "true" ];then echo "copy blobfuse2...." - cp /usr/bin/blobfuse2 /host/usr/local/bin/blobfuse2 --force - chmod 755 /host/usr/local/bin/blobfuse2 + cp /usr/bin/blobfuse2 /host/${BIN_PATH}/blobfuse2 --force + chmod 755 /host/${BIN_PATH}/blobfuse2 fi if [ "${INSTALL_BLOBFUSE_PROXY}" = "true" ];then # install blobfuse-proxy updateBlobfuseProxy="true" - if [ -f "/host/usr/local/bin/blobfuse-proxy" ];then - old=$(sha256sum /host/usr/local/bin/blobfuse-proxy | awk '{print $1}') + if [ -f "/host/${BIN_PATH}/blobfuse-proxy" ];then + old=$(sha256sum /host/${BIN_PATH}/blobfuse-proxy | awk '{print $1}') new=$(sha256sum /blobfuse-proxy/blobfuse-proxy | awk '{print $1}') if [ "$old" = "$new" ];then updateBlobfuseProxy="false" @@ -51,14 +55,14 @@ if [ "${INSTALL_BLOBFUSE_PROXY}" = "true" ];then fi if [ "$updateBlobfuseProxy" = "true" ];then echo "copy blobfuse-proxy...." - rm -rf /host/"$KUBELET_PATH"/plugins/blob.csi.azure.com/blobfuse-proxy.sock - cp /blobfuse-proxy/blobfuse-proxy /host/usr/local/bin/blobfuse-proxy --force - chmod 755 /host/usr/local/bin/blobfuse-proxy + rm -rf /host/${KUBELET_PATH}/plugins/blob.csi.azure.com/blobfuse-proxy.sock + cp /blobfuse-proxy/blobfuse-proxy /host/${BIN_PATH}/blobfuse-proxy --force + chmod 755 /host/${BIN_PATH}/blobfuse-proxy fi updateService="true" - echo "change from /usr/bin/blobfuse-proxy to /usr/local/bin/blobfuse-proxy in blobfuse-proxy.service" - sed -i 's/\/usr\/bin\/blobfuse-proxy/\/usr\/local\/bin\/blobfuse-proxy/g' /blobfuse-proxy/blobfuse-proxy.service + echo "change from /usr/bin/blobfuse-proxy to ${BIN_PATH}/blobfuse-proxy in blobfuse-proxy.service" + sed -i "s|/usr/bin/blobfuse-proxy|${BIN_PATH}/blobfuse-proxy|g" /blobfuse-proxy/blobfuse-proxy.service if [ -f "/host/etc/systemd/system/blobfuse-proxy.service" ];then old=$(sha256sum /host/etc/systemd/system/blobfuse-proxy.service | awk '{print $1}') new=$(sha256sum /blobfuse-proxy/blobfuse-proxy.service | awk '{print $1}') diff --git a/pkg/blobfuse-proxy/install-proxy.sh b/pkg/blobfuse-proxy/install-proxy.sh index e564d679f..a0197a866 100644 --- a/pkg/blobfuse-proxy/install-proxy.sh +++ b/pkg/blobfuse-proxy/install-proxy.sh @@ -100,7 +100,7 @@ if [ "${INSTALL_BLOBFUSE_PROXY}" = "true" ];then fi if [ "$updateBlobfuseProxy" = "true" ];then echo "copy blobfuse-proxy...." - rm -rf /host/"$KUBELET_PATH"/plugins/blob.csi.azure.com/blobfuse-proxy.sock + rm -rf /host/${KUBELET_PATH}/plugins/blob.csi.azure.com/blobfuse-proxy.sock cp /blobfuse-proxy/blobfuse-proxy /host/usr/bin/blobfuse-proxy --force chmod 755 /host/usr/bin/blobfuse-proxy fi