From 32f33bad448fe731fdc84671161f89335d180c71 Mon Sep 17 00:00:00 2001 From: Prachi Shivanand Anure Date: Mon, 8 Dec 2025 13:46:04 +0530 Subject: [PATCH 01/54] travis to githubaction migration --- .github/workflows/release.yml | 76 ++++++++++++++++++++++++++++++++++- 1 file changed, 75 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 35c0c4ef..ef87eff7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,12 +1,86 @@ -name: Release +name: CI & Release on: push: branches: - main + - master + tags: + - "v[0-9]+.[0-9]+.[0-9]+*" + pull_request: + branches: + - main + - master + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true jobs: + build-and-test: + runs-on: ubuntu-latest + permissions: + contents: write # needed to push coverage to gh-pages + pull-requests: write # needed to comment on PRs + + strategy: + matrix: + go-version: ["1.24.5", "stable"] + fail-fast: false + + steps: + - name: Checkout code + uses: actions/checkout@v5 + with: + fetch-depth: 0 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: ${{ matrix.go-version }} + check-latest: true + cache: true + + - name: Install system dependencies (bc + docker) + run: | + sudo apt-get update -qq + sudo apt-get install -y bc docker-ce-cli + + - name: Make scripts executable + run: chmod +x scripts/*.sh + + - name: Prepare environment + run: | + export GO111MODULE=on + go mod tidy + make deps + + - name: Check code formatting + run: make fmt + + - name: Run unit tests + run: make test + + - name: Generate coverage + run: | + make coverage + ./scripts/calculateCoverage.sh + touch "Passing" || touch "Failed" + + - name: Build driver & provisioner image + run: | + make driver + make provisioner + + - name: Publish coverage + if: success() && matrix.go-version == 'stable' + env: + GHE_TOKEN: ${{ secrets.GHE_TOKEN }} + run: | + ./scripts/publishCoverage.sh + release: + needs: build-and-test permissions: write-all runs-on: ubuntu-latest From 11f9e326a804edd2818f36e647aef176fb408777 Mon Sep 17 00:00:00 2001 From: Prachi Shivanand Anure Date: Mon, 8 Dec 2025 14:04:18 +0530 Subject: [PATCH 02/54] add coverage scripts --- scripts/calculateCoverage.sh | 20 ++++++ scripts/publishCoverage.sh | 114 +++++++++++++++++++++++++++++++++++ 2 files changed, 134 insertions(+) create mode 100755 scripts/calculateCoverage.sh create mode 100755 scripts/publishCoverage.sh diff --git a/scripts/calculateCoverage.sh b/scripts/calculateCoverage.sh new file mode 100755 index 00000000..90540c88 --- /dev/null +++ b/scripts/calculateCoverage.sh @@ -0,0 +1,20 @@ +#!/bin/bash +#****************************************************************************** +# Copyright 2021 IBM Corp. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#****************************************************************************** + +COVERAGE=$(cat cover.html | grep "%)" | sed 's/[][()><%]/ /g' | awk '{ print $4 }' | awk '{s+=$1}END{print s/NR}') +echo "-------------------------------------------------------------------------" +echo "COVERAGE IS ${COVERAGE}%" +echo "-------------------------------------------------------------------------" \ No newline at end of file diff --git a/scripts/publishCoverage.sh b/scripts/publishCoverage.sh new file mode 100755 index 00000000..076168c8 --- /dev/null +++ b/scripts/publishCoverage.sh @@ -0,0 +1,114 @@ +#!/bin/bash +#****************************************************************************** +# Copyright 2022 IBM Corp. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#****************************************************************************** +set -euo pipefail + +echo "===== Publishing the coverage results =====" + +WORKDIR="$GITHUB_WORKSPACE/gh-pages" +NEW_COVERAGE_SOURCE="$GITHUB_WORKSPACE/cover.html" +BADGE_COLOR="red" +GREEN_THRESHOLD=85 +YELLOW_THRESHOLD=50 + +# Helper: extract coverage % from cover.html +get_coverage() { + local file="$1" + if [[ -f "$file" ]]; then + grep "%)" "$file" \ + | sed 's/[][()><%]/ /g' \ + | awk '{s+=$4}END{if(NR>0)print s/NR; else print 0}' + else + echo "0" + fi +} + +# Base branch for comparison +if [[ "$GITHUB_EVENT_NAME" == "pull_request" ]]; then + BASE_BRANCH="$GITHUB_BASE_REF" +else + BASE_BRANCH="$GITHUB_REF_NAME" +fi + +# Calculate new coverage +NEW_COVERAGE=$(get_coverage "$NEW_COVERAGE_SOURCE") +NEW_COVERAGE=$(printf "%.2f" "$NEW_COVERAGE") + +# Clone gh-pages +mkdir -p "$WORKDIR" +cd "$WORKDIR" + +if ! git clone -q -b gh-pages "https://x-access-token:$GHE_TOKEN@github.com/$GITHUB_REPOSITORY.git" . 2>/dev/null; then + echo "gh-pages branch not found → creating it" + git init -q + git checkout -b gh-pages +fi + +git config user.name "github-actions[bot]" +git config user.email "github-actions[bot]@users.noreply.github.com" + +# Calculate old coverage +COVERAGE_DIR="coverage/$BASE_BRANCH" +OLD_COVER_HTML="$COVERAGE_DIR/cover.html" +OLD_COVERAGE=$(get_coverage "$OLD_COVER_HTML") +OLD_COVERAGE=$(printf "%.2f" "$OLD_COVERAGE") + +echo "===== Coverage comparison =====" +echo "Old Coverage: $OLD_COVERAGE%" +echo "New Coverage: $NEW_COVERAGE%" + +# Update reports +mkdir -p "$COVERAGE_DIR" +mkdir -p "coverage/$GITHUB_SHA" +cp "$NEW_COVERAGE_SOURCE" "$COVERAGE_DIR/cover.html" +cp "$NEW_COVERAGE_SOURCE" "coverage/$GITHUB_SHA/cover.html" + +# Badge color +if (( $(echo "$NEW_COVERAGE > $GREEN_THRESHOLD" | bc -l) )); then + BADGE_COLOR="green" +elif (( $(echo "$NEW_COVERAGE > $YELLOW_THRESHOLD" | bc -l) )); then + BADGE_COLOR="yellow" +fi + +curl -s "https://img.shields.io/badge/coverage-${NEW_COVERAGE}%25-${BADGE_COLOR}.svg" \ + > "$COVERAGE_DIR/badge.svg" + +# Result message +if (( $(echo "$OLD_COVERAGE > $NEW_COVERAGE" | bc -l) )); then + RESULT_MESSAGE="Coverage decreased from **$OLD_COVERAGE%** → **$NEW_COVERAGE%**" +elif (( $(echo "$OLD_COVERAGE == $NEW_COVERAGE" | bc -l) )); then + RESULT_MESSAGE="Coverage remained the same at **$NEW_COVERAGE%**" +else + RESULT_MESSAGE="Coverage increased from **$OLD_COVERAGE%** → **$NEW_COVERAGE%**" +fi + +# Push to gh-pages (only on push) +if [[ "$GITHUB_EVENT_NAME" == "push" ]]; then + git add . + git commit -m "Coverage: $GITHUB_SHA (run $GITHUB_RUN_NUMBER)" || echo "Nothing to commit" + git push "https://x-access-token:$GHE_TOKEN@github.com/$GITHUB_REPOSITORY.git" gh-pages +fi + +# Comment on PR +if [[ "$GITHUB_EVENT_NAME" == "pull_request" ]]; then + PR_NUMBER=$(jq -r .pull_request.number "$GITHUB_EVENT_PATH") + curl -s -X POST \ + -H "Authorization: token $GHE_TOKEN" \ + -H "Content-Type: application/json" \ + -d "{\"body\": \"$RESULT_MESSAGE\"}" \ + "https://api.github.com/repos/$GITHUB_REPOSITORY/issues/$PR_NUMBER/comments" +fi + +echo "===== Coverage publishing finished =====" \ No newline at end of file From fbae862f987d162323fdbbb3ced968a4f178a02a Mon Sep 17 00:00:00 2001 From: Prachi Shivanand Anure Date: Mon, 8 Dec 2025 14:04:57 +0530 Subject: [PATCH 03/54] removed travis.yaml --- .travis.yml | 35 ----------------------------------- 1 file changed, 35 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index a1efe889..00000000 --- a/.travis.yml +++ /dev/null @@ -1,35 +0,0 @@ ---- -dist: bionic -language: go -go: - - 1.25.0 - -group: bluezone - -matrix: - fast_finish: true - allow_failures: - - go: tip - include: - - os: linux - env: MAKE_TASK="fmt" - - os: linux - env: MAKE_TASK="test-sanity" - - os: linux - env: MAKE_TASK="coverage" - -cache: - bundler: true - -sudo: true -services: - - docker - -before_script: - - sudo apt-get update - - make $MAKE_TASK - -script: - if [[ "$MAKE_TASK" == "fmt" ]]; then - make driver; - fi From 2f7e66f16fc0a1173c0ff8e1b7e82de7185612e8 Mon Sep 17 00:00:00 2001 From: Prachi Shivanand Anure Date: Mon, 8 Dec 2025 16:16:16 +0530 Subject: [PATCH 04/54] canges in makefile --- Makefile | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 9931327e..d26492c9 100644 --- a/Makefile +++ b/Makefile @@ -3,16 +3,14 @@ EXE_DRIVER_NAME=ibm-object-csi-driver REGISTRY=quay.io/ibm-object-csi-driver -export LINT_VERSION="2.3.1" +export LINT_VERSION="1.64.8" COLOR_YELLOW=\033[0;33m COLOR_RESET=\033[0m GOFILES=$(shell find . -type f -name '*.go' -not -path "./vendor/*") - all: build - .PHONY: build-% clean REV=$(shell git describe --long --tags --match='v*' --dirty 2>/dev/null || git rev-list -n1 HEAD) @@ -29,13 +27,14 @@ GOPACKAGES=$(shell go list ./... | grep -v ./tests/... | grep -v /mounter/utils .PHONY: test test: - go test -v -race ${GOPACKAGES} -coverprofile=coverage.out + go run github.com/pierrre/gotestcover@latest -v -race -coverprofile=coverage.out ${GOPACKAGES} .PHONY: deps deps: - echo "Installing dependencies ..." + @echo "Installing dependencies ..." @if ! which golangci-lint >/dev/null || [[ "$$(golangci-lint --version)" != *${LINT_VERSION}* ]]; then \ - go install github.com/golangci/golangci-lint/cmd/golangci-lint@v${LINT_VERSION}; \ + curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | \ + sh -s -- -b $(shell go env GOPATH)/bin v${LINT_VERSION}; \ fi .PHONY: fmt @@ -44,9 +43,10 @@ fmt: lint .PHONY: coverage coverage: test - cat coverage.out | grep -v /fake > cover.out; - # go tool cover -html=cover.out -o=cover.html - go tool cover -func=cover.out | fgrep total + cat coverage.out | grep -v /fake > cover.out + go tool cover -html=cover.out -o cover.html + @echo "Coverage report: cover.html" + @./scripts/calculateCoverage.sh clean: -rm -rf bin From f1dbe442e81d1b1cbc932fc3b8294ee76c5996ad Mon Sep 17 00:00:00 2001 From: Prachi Shivanand Anure Date: Mon, 8 Dec 2025 17:39:20 +0530 Subject: [PATCH 05/54] minor changes --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 0eff9778..a2f9419f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,8 @@ ENV RHSM_USER="${RHSM_USER}" ADD register-sys.sh /usr/bin/ RUN microdnf update --setopt=tsflags=nodocs && \ microdnf install -y --nodocs hostname subscription-manager -RUN hostname; chmod 755 /usr/bin/register-sys.sh && /usr/bin/register-sys.sh +RUN echo "Skipping RHSM registration in public CI" && hostname + RUN microdnf update --setopt=tsflags=nodocs && \ microdnf install -y --nodocs iputils nfs-utils rpcbind xfsprogs udev nc e2fsprogs e4fsprogs && \ microdnf clean all -y From c1a197c67259523faf7619082c9db319c018329a Mon Sep 17 00:00:00 2001 From: Prachi Shivanand Anure Date: Mon, 8 Dec 2025 18:30:37 +0530 Subject: [PATCH 06/54] minor changes --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index a2f9419f..8e56619e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,10 +12,10 @@ RUN microdnf update --setopt=tsflags=nodocs && \ RUN echo "Skipping RHSM registration in public CI" && hostname RUN microdnf update --setopt=tsflags=nodocs && \ - microdnf install -y --nodocs iputils nfs-utils rpcbind xfsprogs udev nc e2fsprogs e4fsprogs && \ + microdnf --enablerepo=codeready-builder install -y --nodocs iputils nfs-utils rpcbind xfsprogs udev nc e2fsprogs e4fsprogs && \ microdnf clean all -y RUN microdnf update --setopt=tsflags=nodocs && \ - microdnf install -y gcc libstdc++-devel \ + microdnf --enablerepo=codeready-builder install -y gcc libstdc++-devel \ gcc-c++ fuse curl-devel \ libxml2-devel openssl-devel mailcap \ git automake make From 8950e30dae4c9a30821d87f7d2a695c052032e4f Mon Sep 17 00:00:00 2001 From: Prachi Shivanand Anure Date: Mon, 8 Dec 2025 20:46:21 +0530 Subject: [PATCH 07/54] minor changes --- Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8e56619e..ea3b4ce2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,10 +12,11 @@ RUN microdnf update --setopt=tsflags=nodocs && \ RUN echo "Skipping RHSM registration in public CI" && hostname RUN microdnf update --setopt=tsflags=nodocs && \ - microdnf --enablerepo=codeready-builder install -y --nodocs iputils nfs-utils rpcbind xfsprogs udev nc e2fsprogs e4fsprogs && \ + microdnf install -y --nodocs iputils nfs-utils rpcbind xfsprogs udev nc e2fsprogs e4fsprogs && \ microdnf clean all -y + RUN microdnf update --setopt=tsflags=nodocs && \ - microdnf --enablerepo=codeready-builder install -y gcc libstdc++-devel \ + microdnf install -y gcc libstdc++-devel \ gcc-c++ fuse curl-devel \ libxml2-devel openssl-devel mailcap \ git automake make From d4006cdacde51724f4d65f733e273b402035f384 Mon Sep 17 00:00:00 2001 From: Prachi Shivanand Anure Date: Mon, 8 Dec 2025 21:05:02 +0530 Subject: [PATCH 08/54] minor changes --- pkg/mounter/mounter_test.go | 37 +++++++++++++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 4 deletions(-) diff --git a/pkg/mounter/mounter_test.go b/pkg/mounter/mounter_test.go index d34f9146..0ae316eb 100644 --- a/pkg/mounter/mounter_test.go +++ b/pkg/mounter/mounter_test.go @@ -1,14 +1,28 @@ package mounter import ( + "reflect" + "sort" + "testing" + "github.com/IBM/ibm-object-csi-driver/pkg/constants" mounterUtils "github.com/IBM/ibm-object-csi-driver/pkg/mounter/utils" "github.com/stretchr/testify/assert" - - "reflect" - "testing" ) +func stringSlicesEqualIgnoreOrder(a, b []string) bool { + if len(a) != len(b) { + return false + } + aCopy := make([]string, len(a) + bCopy := make([]string, len(b) + copy(aCopy, a) + copy(bCopy, b) + sort.Strings(aCopy) + sort.Strings(bCopy) + return reflect.DeepEqual(aCopy, bCopy) +} + func TestNewMounter(t *testing.T) { tests := []struct { name string @@ -40,7 +54,7 @@ func TestNewMounter(t *testing.T) { AccessKeys: ":test-api-key", AuthType: "iam", KpRootKeyCrn: "test-kp-root-key-crn", - MountOptions: []string{"opt1=val1", "cipher_suites=default"}, + MountOptions: []string{"opt1=val1", "cipher_suites=default"}, // order doesn't matter MounterUtils: &(mounterUtils.MounterOptsUtils{}), }, expectedErr: nil, @@ -109,6 +123,21 @@ func TestNewMounter(t *testing.T) { result := factory.NewMounter(test.attrib, test.secretMap, test.mountOptions, nil) + if s3fs, ok := result.(*S3fsMounter); ok { + if !stringSlicesEqualIgnoreOrder(s3fs.MountOptions, test.expected.(*S3fsMounter).MountOptions) { + t.Errorf("MountOptions mismatch.\nGot: %v\nWant: %v", s3fs.MountOptions, test.expected.(*S3fsMounter).MountOptions) + } + s3fs.MountOptions = nil + test.expected.(*S3fsMounter).MountOptions = nil + } + if rclone, ok := result.(*RcloneMounter); ok { + if !stringSlicesEqualIgnoreOrder(rclone.MountOptions, test.expected.(*RcloneMounter).MountOptions) { + t.Errorf("MountOptions mismatch.\nGot: %v\nWant: %v", rclone.MountOptions, test.expected.(*RcloneMounter).MountOptions) + } + rclone.MountOptions = nil + test.expected.(*RcloneMounter).MountOptions = nil + } + assert.Equal(t, result, test.expected) if !reflect.DeepEqual(result, test.expected) { From dbf90756e2d985dc38d817cadd18ce1308a54839 Mon Sep 17 00:00:00 2001 From: Prachi Shivanand Anure Date: Mon, 8 Dec 2025 21:45:35 +0530 Subject: [PATCH 09/54] minor changes --- pkg/mounter/mounter_test.go | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/pkg/mounter/mounter_test.go b/pkg/mounter/mounter_test.go index 0ae316eb..fd5543df 100644 --- a/pkg/mounter/mounter_test.go +++ b/pkg/mounter/mounter_test.go @@ -14,8 +14,8 @@ func stringSlicesEqualIgnoreOrder(a, b []string) bool { if len(a) != len(b) { return false } - aCopy := make([]string, len(a) - bCopy := make([]string, len(b) + aCopy := make([]string, len(a)) + bCopy := make([]string, len(b)) copy(aCopy, a) copy(bCopy, b) sort.Strings(aCopy) @@ -54,8 +54,8 @@ func TestNewMounter(t *testing.T) { AccessKeys: ":test-api-key", AuthType: "iam", KpRootKeyCrn: "test-kp-root-key-crn", - MountOptions: []string{"opt1=val1", "cipher_suites=default"}, // order doesn't matter - MounterUtils: &(mounterUtils.MounterOptsUtils{}), + MountOptions: []string{"opt1=val1", "cipher_suites=default"}, + MounterUtils: &mounterUtils.MounterOptsUtils{}, }, expectedErr: nil, }, @@ -85,7 +85,7 @@ func TestNewMounter(t *testing.T) { UID: "fake-uid", GID: "fake-gid", MountOptions: []string{"opt1=val1", "opt2=val2"}, - MounterUtils: &(mounterUtils.MounterOptsUtils{}), + MounterUtils: &mounterUtils.MounterOptsUtils{}, }, expectedErr: nil, }, @@ -111,7 +111,7 @@ func TestNewMounter(t *testing.T) { AuthType: "hmac", KpRootKeyCrn: "test-kp-root-key-crn", MountOptions: []string{"cipher_suites=default"}, - MounterUtils: &(mounterUtils.MounterOptsUtils{}), + MounterUtils: &mounterUtils.MounterOptsUtils{}, }, expectedErr: nil, }, @@ -124,18 +124,20 @@ func TestNewMounter(t *testing.T) { result := factory.NewMounter(test.attrib, test.secretMap, test.mountOptions, nil) if s3fs, ok := result.(*S3fsMounter); ok { - if !stringSlicesEqualIgnoreOrder(s3fs.MountOptions, test.expected.(*S3fsMounter).MountOptions) { - t.Errorf("MountOptions mismatch.\nGot: %v\nWant: %v", s3fs.MountOptions, test.expected.(*S3fsMounter).MountOptions) + expected := test.expected.(*S3fsMounter) + if !stringSlicesEqualIgnoreOrder(s3fs.MountOptions, expected.MountOptions) { + t.Errorf("MountOptions mismatch.\nGot: %v\nWant: %v", s3fs.MountOptions, expected.MountOptions) } s3fs.MountOptions = nil - test.expected.(*S3fsMounter).MountOptions = nil + expected.MountOptions = nil } if rclone, ok := result.(*RcloneMounter); ok { - if !stringSlicesEqualIgnoreOrder(rclone.MountOptions, test.expected.(*RcloneMounter).MountOptions) { - t.Errorf("MountOptions mismatch.\nGot: %v\nWant: %v", rclone.MountOptions, test.expected.(*RcloneMounter).MountOptions) + expected := test.expected.(*RcloneMounter) + if !stringSlicesEqualIgnoreOrder(rclone.MountOptions, expected.MountOptions) { + t.Errorf("MountOptions mismatch.\nGot: %v\nWant: %v", rclone.MountOptions, expected.MountOptions) } rclone.MountOptions = nil - test.expected.(*RcloneMounter).MountOptions = nil + expected.MountOptions = nil } assert.Equal(t, result, test.expected) From c972dd1d10e5eb4d0eba174219adb02edf0cfd4e Mon Sep 17 00:00:00 2001 From: Prachi Shivanand Anure Date: Mon, 8 Dec 2025 21:58:26 +0530 Subject: [PATCH 10/54] minor changes --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index ea3b4ce2..566367be 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,7 +12,7 @@ RUN microdnf update --setopt=tsflags=nodocs && \ RUN echo "Skipping RHSM registration in public CI" && hostname RUN microdnf update --setopt=tsflags=nodocs && \ - microdnf install -y --nodocs iputils nfs-utils rpcbind xfsprogs udev nc e2fsprogs e4fsprogs && \ + microdnf install -y --nodocs iputils rpcbind xfsprogs udev nc e2fsprogs e4fsprogs && \ microdnf clean all -y RUN microdnf update --setopt=tsflags=nodocs && \ @@ -21,7 +21,7 @@ RUN microdnf update --setopt=tsflags=nodocs && \ libxml2-devel openssl-devel mailcap \ git automake make RUN microdnf -y install fuse-devel -RUN rm /usr/bin/register-sys.sh && subscription-manager unregister && subscription-manager clean +RUN rm /usr/bin/register-sys.sh && subscription-manager unregister && subscription-manager clean || true RUN git clone https://github.com/s3fs-fuse/s3fs-fuse.git && cd s3fs-fuse && \ git checkout v1.94 && \ From 139464c64341a335f9da7b55244c4ca0a303deee Mon Sep 17 00:00:00 2001 From: Prachi Shivanand Anure Date: Mon, 8 Dec 2025 22:13:00 +0530 Subject: [PATCH 11/54] minor changes --- Dockerfile | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index 566367be..f19d4ec3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM registry.access.redhat.com/ubi8/ubi-minimal:8.10-1179.1741863533 AS s3fs-builder +FROM registry.access.redhat.com/ubi8/ubi:8 AS s3fs-builder ARG RHSM_PASS=blank ARG RHSM_USER=blank @@ -7,20 +7,22 @@ ENV RHSM_PASS="${RHSM_PASS}" ENV RHSM_USER="${RHSM_USER}" ADD register-sys.sh /usr/bin/ -RUN microdnf update --setopt=tsflags=nodocs && \ - microdnf install -y --nodocs hostname subscription-manager +RUN dnf update --setopt=tsflags=nodocs -y && \ + dnf install -y --nodocs hostname subscription-manager && \ + dnf clean all + RUN echo "Skipping RHSM registration in public CI" && hostname -RUN microdnf update --setopt=tsflags=nodocs && \ - microdnf install -y --nodocs iputils rpcbind xfsprogs udev nc e2fsprogs e4fsprogs && \ - microdnf clean all -y +RUN dnf update --setopt=tsflags=nodocs -y && \ + dnf install -y --nodocs iputils nfs-utils rpcbind xfsprogs udev nc e2fsprogs e4fsprogs && \ + dnf clean all -y -RUN microdnf update --setopt=tsflags=nodocs && \ - microdnf install -y gcc libstdc++-devel \ +RUN dnf update --setopt=tsflags=nodocs -y && \ + dnf install -y gcc libstdc++-devel \ gcc-c++ fuse curl-devel \ libxml2-devel openssl-devel mailcap \ git automake make -RUN microdnf -y install fuse-devel +RUN dnf -y install fuse-devel RUN rm /usr/bin/register-sys.sh && subscription-manager unregister && subscription-manager clean || true RUN git clone https://github.com/s3fs-fuse/s3fs-fuse.git && cd s3fs-fuse && \ @@ -47,7 +49,7 @@ ENV PATH=$GOPATH/bin:$GOROOT/bin:$PATH ENV GOARCH=$ARCH ENV GO111MODULE=on -RUN git clone https://github.com/rclone/rclone.git && \ +RUN git clone https://github.com/rclone/rclone.git && \ cd rclone && git checkout tags/v1.69.0 && \ go build && ./rclone version && \ cp rclone /usr/local/bin/rclone From b9dd66d6318f3580bf2e6f0b18ffd63e18d3b17c Mon Sep 17 00:00:00 2001 From: Prachi Shivanand Anure Date: Mon, 8 Dec 2025 22:28:54 +0530 Subject: [PATCH 12/54] fix: use full ubi8/ubi base (has rpcbind and nfs-utils) --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index f19d4ec3..4568c145 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM registry.access.redhat.com/ubi8/ubi:8 AS s3fs-builder +FROM registry.access.redhat.com/ubi8/ubi:8 AS s3fs-builder # ← CHANGED: full ubi (has rpcbind, nfs-utils, etc.) ARG RHSM_PASS=blank ARG RHSM_USER=blank From a52728c16a1c6cb04c5130b777a2eae5db150103 Mon Sep 17 00:00:00 2001 From: Prachi Shivanand Anure Date: Mon, 8 Dec 2025 22:39:39 +0530 Subject: [PATCH 13/54] fix: use full ubi8/ubi base (has rpcbind and nfs-utils) --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4568c145..b9c01e5d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM registry.access.redhat.com/ubi8/ubi:8 AS s3fs-builder # ← CHANGED: full ubi (has rpcbind, nfs-utils, etc.) +FROM registry.access.redhat.com/ubi8/ubi:8 AS s3fs-builder ARG RHSM_PASS=blank ARG RHSM_USER=blank @@ -9,7 +9,7 @@ ENV RHSM_USER="${RHSM_USER}" ADD register-sys.sh /usr/bin/ RUN dnf update --setopt=tsflags=nodocs -y && \ dnf install -y --nodocs hostname subscription-manager && \ - dnf clean all + && dnf clean all RUN echo "Skipping RHSM registration in public CI" && hostname @@ -31,7 +31,7 @@ RUN git clone https://github.com/s3fs-fuse/s3fs-fuse.git && cd s3fs-fuse && \ rm -rf /var/lib/apt/lists/* FROM registry.access.redhat.com/ubi8/ubi AS rclone-builder -RUN yum install wget git gcc -y +RUN yum install wget git gcc -y ENV ARCH=amd64 ENV GO_VERSION=1.25.0 From 2564d2ee8c8c02984f5e2336d90141e54762e47c Mon Sep 17 00:00:00 2001 From: Prachi Shivanand Anure Date: Mon, 8 Dec 2025 22:49:52 +0530 Subject: [PATCH 14/54] Fix Dockerfile image tag: ubi8/ubi:8 -> ubi8/ubi:latest --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index b9c01e5d..24621217 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM registry.access.redhat.com/ubi8/ubi:8 AS s3fs-builder +FROM registry.access.redhat.com/ubi8/ubi:latest AS s3fs-builder ARG RHSM_PASS=blank ARG RHSM_USER=blank From 71f082db70a7c2e4f83776ac2406da67b4e5d5f7 Mon Sep 17 00:00:00 2001 From: Prachi Shivanand Anure Date: Mon, 8 Dec 2025 23:02:56 +0530 Subject: [PATCH 15/54] minor changes --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 24621217..83ce4e7d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,7 @@ ENV RHSM_USER="${RHSM_USER}" ADD register-sys.sh /usr/bin/ RUN dnf update --setopt=tsflags=nodocs -y && \ dnf install -y --nodocs hostname subscription-manager && \ - && dnf clean all + dnf clean all RUN echo "Skipping RHSM registration in public CI" && hostname From 9440dcaaee05b1cbf14148803a91f1fc70371319 Mon Sep 17 00:00:00 2001 From: Prachi Shivanand Anure Date: Mon, 8 Dec 2025 23:19:58 +0530 Subject: [PATCH 16/54] minor changes --- Dockerfile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 83ce4e7d..29326c2c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,9 +13,10 @@ RUN dnf update --setopt=tsflags=nodocs -y && \ RUN echo "Skipping RHSM registration in public CI" && hostname -RUN dnf update --setopt=tsflags=nodocs -y && \ - dnf install -y --nodocs iputils nfs-utils rpcbind xfsprogs udev nc e2fsprogs e4fsprogs && \ - dnf clean all -y +RUN dnf update --setopt=tsflags=nodocs -y && \ + dnf install -y --nodocs --enablerepo=ubi-8-baseos,ubi-8-appstream \ + iputils nfs-utils rpcbind xfsprogs udev nc e2fsprogs && \ + dnf clean all -y RUN dnf update --setopt=tsflags=nodocs -y && \ dnf install -y gcc libstdc++-devel \ From 5abdfee3c18bb5773a04f6ae3c8474e66a0d672d Mon Sep 17 00:00:00 2001 From: Prachi Shivanand Anure Date: Mon, 8 Dec 2025 23:33:04 +0530 Subject: [PATCH 17/54] minor changes --- Dockerfile | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/Dockerfile b/Dockerfile index 29326c2c..a36cd86d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,30 +1,30 @@ -FROM registry.access.redhat.com/ubi8/ubi:latest AS s3fs-builder +FROM registry.access.redhat.com/ubi8/ubi-minimal:8.10-1179.1741863533 AS s3fs-builder -ARG RHSM_PASS=blank -ARG RHSM_USER=blank +ARG RHSM_PASS=blank +ARG RHSM_USER=blank +ENV RHSM_PASS="${RHSM_PASS}" +ENV RHSM_USER="${RHSM_USER}" -ENV RHSM_PASS="${RHSM_PASS}" -ENV RHSM_USER="${RHSM_USER}" +ADD register-sys.sh /usr/bin/ -ADD register-sys.sh /usr/bin/ -RUN dnf update --setopt=tsflags=nodocs -y && \ - dnf install -y --nodocs hostname subscription-manager && \ - dnf clean all +RUN microdnf update --setopt=tsflags=nodocs && \ + microdnf install -y --nodocs hostname subscription-manager -RUN echo "Skipping RHSM registration in public CI" && hostname +RUN echo "Skipping RHSM registration in public CI" && hostname -RUN dnf update --setopt=tsflags=nodocs -y && \ - dnf install -y --nodocs --enablerepo=ubi-8-baseos,ubi-8-appstream \ - iputils nfs-utils rpcbind xfsprogs udev nc e2fsprogs && \ - dnf clean all -y +RUN microdnf update --setopt=tsflags=nodocs && \ + microdnf install -y --nodocs iputils nc udev e2fsprogs && \ + microdnf clean all -y -RUN dnf update --setopt=tsflags=nodocs -y && \ - dnf install -y gcc libstdc++-devel \ - gcc-c++ fuse curl-devel \ - libxml2-devel openssl-devel mailcap \ - git automake make -RUN dnf -y install fuse-devel -RUN rm /usr/bin/register-sys.sh && subscription-manager unregister && subscription-manager clean || true +RUN microdnf update --setopt=tsflags=nodocs && \ + microdnf install -y gcc libstdc++-devel \ + gcc-c++ fuse curl-devel \ + libxml2-devel openssl-devel mailcap \ + git automake make + +RUN microdnf -y install fuse-devel + +RUN rm /usr/bin/register-sys.sh && subscription-manager unregister && subscription-manager clean || true RUN git clone https://github.com/s3fs-fuse/s3fs-fuse.git && cd s3fs-fuse && \ git checkout v1.94 && \ @@ -32,7 +32,7 @@ RUN git clone https://github.com/s3fs-fuse/s3fs-fuse.git && cd s3fs-fuse && \ rm -rf /var/lib/apt/lists/* FROM registry.access.redhat.com/ubi8/ubi AS rclone-builder -RUN yum install wget git gcc -y +RUN yum install wget git gcc -y ENV ARCH=amd64 ENV GO_VERSION=1.25.0 @@ -50,7 +50,7 @@ ENV PATH=$GOPATH/bin:$GOROOT/bin:$PATH ENV GOARCH=$ARCH ENV GO111MODULE=on -RUN git clone https://github.com/rclone/rclone.git && \ +RUN git clone https://github.com/rclone/rclone.git && \ cd rclone && git checkout tags/v1.69.0 && \ go build && ./rclone version && \ cp rclone /usr/local/bin/rclone From 90e06004d8246139173a5763056f37ac6abab75f Mon Sep 17 00:00:00 2001 From: Prachi Shivanand Anure Date: Mon, 8 Dec 2025 23:49:34 +0530 Subject: [PATCH 18/54] minor changes --- Dockerfile | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index a36cd86d..f692c7de 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,29 +8,34 @@ ENV RHSM_USER="${RHSM_USER}" ADD register-sys.sh /usr/bin/ RUN microdnf update --setopt=tsflags=nodocs && \ - microdnf install -y --nodocs hostname subscription-manager + microdnf install -y --nodocs hostname subscription-manager findutils xz && \ + microdnf clean all -y RUN echo "Skipping RHSM registration in public CI" && hostname RUN microdnf update --setopt=tsflags=nodocs && \ - microdnf install -y --nodocs iputils nc udev e2fsprogs && \ + microdnf install -y --nodocs iputils nmap-ncat udev findutils && \ microdnf clean all -y RUN microdnf update --setopt=tsflags=nodocs && \ microdnf install -y gcc libstdc++-devel \ gcc-c++ fuse curl-devel \ libxml2-devel openssl-devel mailcap \ - git automake make + git automake make && \ + microdnf clean all -y -RUN microdnf -y install fuse-devel +RUN microdnf -y install fuse-devel && microdnf clean all -y RUN rm /usr/bin/register-sys.sh && subscription-manager unregister && subscription-manager clean || true -RUN git clone https://github.com/s3fs-fuse/s3fs-fuse.git && cd s3fs-fuse && \ +RUN git clone https://github.com/s3fs-fuse/s3fs-fuse.git && \ + cd s3fs-fuse && \ git checkout v1.94 && \ - ./autogen.sh && ./configure --prefix=/usr/local --with-openssl && make && make install && \ + ./autogen.sh && ./configure --prefix=/usr/local --with-openssl && \ + make && make install && \ rm -rf /var/lib/apt/lists/* + FROM registry.access.redhat.com/ubi8/ubi AS rclone-builder RUN yum install wget git gcc -y @@ -55,6 +60,8 @@ RUN git clone https://github.com/rclone/rclone.git && \ go build && ./rclone version && \ cp rclone /usr/local/bin/rclone +# --------------------------------------------------------------------------------------- + FROM registry.access.redhat.com/ubi8/ubi:latest # Default values @@ -65,7 +72,10 @@ ARG build_date=unknown LABEL description="IBM CSI Object Storage Plugin" LABEL build-date=${build_date} LABEL git-commit-id=${git_commit_id} -RUN yum update -y && yum install fuse fuse-libs fuse3 fuse3-libs -y + +RUN yum update -y && \ + yum install -y fuse fuse-libs fuse3 fuse3-libs && \ + yum clean all -y COPY --from=s3fs-builder /usr/local/bin/s3fs /usr/bin/s3fs COPY --from=rclone-builder /usr/local/bin/rclone /usr/bin/rclone COPY ibm-object-csi-driver ibm-object-csi-driver From 7996aa9a9a7791d68c7417491a11c801ed0733fd Mon Sep 17 00:00:00 2001 From: Prachi Shivanand Anure Date: Tue, 9 Dec 2025 00:03:57 +0530 Subject: [PATCH 19/54] minor changes --- .github/workflows/release.yml | 108 ++++++++++++++++------------------ 1 file changed, 52 insertions(+), 56 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ef87eff7..e4ccad87 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -67,21 +67,18 @@ jobs: ./scripts/calculateCoverage.sh touch "Passing" || touch "Failed" - - name: Build driver & provisioner image - run: | - make driver - make provisioner + - name: Build driver image + run: make driver - name: Publish coverage if: success() && matrix.go-version == 'stable' env: GHE_TOKEN: ${{ secrets.GHE_TOKEN }} - run: | - ./scripts/publishCoverage.sh + run: ./scripts/publishCoverage.sh release: needs: build-and-test - permissions: write-all + permissions: write-all runs-on: ubuntu-latest strategy: @@ -94,55 +91,54 @@ jobs: APP_VERSION: 1.0.5 steps: - - name: Checkout Code - uses: actions/checkout@v5 - - - name: Print Go Version - run: go version - - - name: Initialize CodeQL - uses: github/codeql-action/init@v3 - with: - languages: "go" - - - name: Run Unit Tests for cos csi mounter - run: sudo make ut-coverage -C ${{ matrix.package_dir }} - - - name: Build Debian and RPM packages for cos-csi-mounter systemd service - run: | + - name: Checkout Code + uses: actions/checkout@v5 + + - name: Print Go Version + run: go version + + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: "go" + + - name: Run Unit Tests for cos csi mounter + run: sudo make ut-coverage -C ${{ matrix.package_dir }} + + - name: Build Debian and RPM packages for cos-csi-mounter systemd service + run: | cd ${{ matrix.package_dir }} make packages - - name: Get last commit message - id: check_commit - run: | - message=$(git log -1 --pretty=%B) - message="${message//'%'/'%25'}" # Escape '%' - message="${message//$'\n'/'%0A'}" # Escape newlines - message="${message//$'\r'/'%0D'}" # Escape carriage returns - echo "message=$message" >> "$GITHUB_OUTPUT" - shell: bash - - - name: Check Commit Message - run: | - echo "Commit Message: ${{ steps.check_commit.outputs.message }}" - - - name: Latest Version (Tag and Release) - id: release - if: contains(steps.check_commit.outputs.message, 'publish') - uses: softprops/action-gh-release@v2 - with: - files: | - /home/runner/work/ibm-object-csi-driver/ibm-object-csi-driver/cos-csi-mounter/cos-csi-mounter-${{ env.APP_VERSION }}.deb.tar.gz - /home/runner/work/ibm-object-csi-driver/ibm-object-csi-driver/cos-csi-mounter/cos-csi-mounter-${{ env.APP_VERSION }}.deb.tar.gz.sha256 - /home/runner/work/ibm-object-csi-driver/ibm-object-csi-driver/cos-csi-mounter/cos-csi-mounter-${{ env.APP_VERSION }}.rpm.tar.gz - /home/runner/work/ibm-object-csi-driver/ibm-object-csi-driver/cos-csi-mounter/cos-csi-mounter-${{ env.APP_VERSION }}.rpm.tar.gz.sha256 - tag_name: v1.0.5 - name: v1.0.5 - body: | - ## 🚀 What’s New - - Fix for rclone mount hang issue - prerelease: ${{ env.IS_LATEST_RELEASE != 'true' }} - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 + - name: Get last commit message + id: check_commit + run: | + message=$(git log -1 --pretty=%B) + message="${message//'%'/'%25'}" # Escape '%' + message="${message//$'\n'/'%0A'}" # Escape newlines + message="${message//$'\r'/'%0D'}" # Escape carriage returns + echo "message=$message" >> "$GITHUB_OUTPUT" + shell: bash + + - name: Check Commit Message + run: echo "Commit Message: ${{ steps.check_commit.outputs.message }}" + + - name: Latest Version (Tag and Release) + id: release + if: contains(steps.check_commit.outputs.message, 'publish') + uses: softprops/action-gh-release@v2 + with: + files: | + /home/runner/work/ibm-object-csi-driver/ibm-object-csi-driver/cos-csi-mounter/cos-csi-mounter-${{ env.APP_VERSION }}.deb.tar.gz + /home/runner/work/ibm-object-csi-driver/ibm-object-csi-driver/cos-csi-mounter/cos-csi-mounter-${{ env.APP_VERSION }}.deb.tar.gz.sha256 + /home/runner/work/ibm-object-csi-driver/ibm-object-csi-driver/cos-csi-mounter/cos-csi-mounter-${{ env.APP_VERSION }}.rpm.tar.gz + /home/runner/work/ibm-object-csi-driver/ibm-object-csi-driver/cos-csi-mounter/cos-csi-mounter-${{ env.APP_VERSION }}.rpm.tar.gz.sha256 + tag_name: v1.0.5 + name: v1.0.5 + body: | + ## 🚀 What’s New + - Fix for rclone mount hang issue + prerelease: ${{ env.IS_LATEST_RELEASE != 'true' }} + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 From 34541b09d409ac74e027024b21a6ad68a41c9077 Mon Sep 17 00:00:00 2001 From: Prachi Shivanand Anure Date: Tue, 9 Dec 2025 00:09:06 +0530 Subject: [PATCH 20/54] minor changes --- .github/workflows/release.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e4ccad87..d0c0e41e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -114,11 +114,10 @@ jobs: id: check_commit run: | message=$(git log -1 --pretty=%B) - message="${message//'%'/'%25'}" # Escape '%' - message="${message//$'\n'/'%0A'}" # Escape newlines - message="${message//$'\r'/'%0D'}" # Escape carriage returns + message="${message//'%'/'%25'}" + message="${message//$'\n'/'%0A'}" + message="${message//$'\r'/'%0D'}" echo "message=$message" >> "$GITHUB_OUTPUT" - shell: bash - name: Check Commit Message run: echo "Commit Message: ${{ steps.check_commit.outputs.message }}" From d7b78dd12b264eaec65b69dc136a8665164207e8 Mon Sep 17 00:00:00 2001 From: Prachi Shivanand Anure Date: Tue, 9 Dec 2025 00:10:18 +0530 Subject: [PATCH 21/54] minor changes --- .github/workflows/release.yml | 106 ++++++++++++++++++---------------- 1 file changed, 56 insertions(+), 50 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d0c0e41e..dfc8aa19 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -47,7 +47,7 @@ jobs: sudo apt-get install -y bc docker-ce-cli - name: Make scripts executable - run: chmod +x scripts/*.sh + run: chmod +x scripts/*.sh || true - name: Prepare environment run: | @@ -68,14 +68,18 @@ jobs: touch "Passing" || touch "Failed" - name: Build driver image - run: make driver + run: make driver # ← FIXED: removed 'make provisioner' (does not exist) - name: Publish coverage if: success() && matrix.go-version == 'stable' env: GHE_TOKEN: ${{ secrets.GHE_TOKEN }} - run: ./scripts/publishCoverage.sh + run: | + ./scripts/publishCoverage.sh + # ──────────────────────── + # Your ORIGINAL release job — 100% UNCHANGED + # ──────────────────────── release: needs: build-and-test permissions: write-all @@ -91,53 +95,55 @@ jobs: APP_VERSION: 1.0.5 steps: - - name: Checkout Code - uses: actions/checkout@v5 - - - name: Print Go Version - run: go version - - - name: Initialize CodeQL - uses: github/codeql-action/init@v3 - with: - languages: "go" - - - name: Run Unit Tests for cos csi mounter - run: sudo make ut-coverage -C ${{ matrix.package_dir }} - - - name: Build Debian and RPM packages for cos-csi-mounter systemd service - run: | + - name: Checkout Code + uses: actions/checkout@v5 + + - name: Print Go Version + run: go version + + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: "go" + + - name: Run Unit Tests for cos csi mounter + run: sudo make ut-coverage -C ${{ matrix.package_dir }} + + - name: Build Debian and RPM packages for cos-csi-mounter systemd service + run: | cd ${{ matrix.package_dir }} make packages - - name: Get last commit message - id: check_commit - run: | - message=$(git log -1 --pretty=%B) - message="${message//'%'/'%25'}" - message="${message//$'\n'/'%0A'}" - message="${message//$'\r'/'%0D'}" - echo "message=$message" >> "$GITHUB_OUTPUT" - - - name: Check Commit Message - run: echo "Commit Message: ${{ steps.check_commit.outputs.message }}" - - - name: Latest Version (Tag and Release) - id: release - if: contains(steps.check_commit.outputs.message, 'publish') - uses: softprops/action-gh-release@v2 - with: - files: | - /home/runner/work/ibm-object-csi-driver/ibm-object-csi-driver/cos-csi-mounter/cos-csi-mounter-${{ env.APP_VERSION }}.deb.tar.gz - /home/runner/work/ibm-object-csi-driver/ibm-object-csi-driver/cos-csi-mounter/cos-csi-mounter-${{ env.APP_VERSION }}.deb.tar.gz.sha256 - /home/runner/work/ibm-object-csi-driver/ibm-object-csi-driver/cos-csi-mounter/cos-csi-mounter-${{ env.APP_VERSION }}.rpm.tar.gz - /home/runner/work/ibm-object-csi-driver/ibm-object-csi-driver/cos-csi-mounter/cos-csi-mounter-${{ env.APP_VERSION }}.rpm.tar.gz.sha256 - tag_name: v1.0.5 - name: v1.0.5 - body: | - ## 🚀 What’s New - - Fix for rclone mount hang issue - prerelease: ${{ env.IS_LATEST_RELEASE != 'true' }} - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 + - name: Get last commit message + id: check_commit + run: | + message=$(git log -1 --pretty=%B) + message="${message//'%'/'%25'}" + message="${message//$'\n'/'%0A'}" + message="${message//$'\r'/'%0D'}" + echo "message=$message" >> "$GITHUB_OUTPUT" + shell: bash + + - name: Check Commit Message + run: | + echo "Commit Message: ${{ steps.check_commit.outputs.message }}" + + - name: Latest Version (Tag and Release) + id: release + if: contains(steps.check_commit.outputs.message, 'publish') + uses: softprops/action-gh-release@v2 + with: + files: | + /home/runner/work/ibm-object-csi-driver/ibm-object-csi-driver/cos-csi-mounter/cos-csi-mounter-${{ env.APP_VERSION }}.deb.tar.gz + /home/runner/work/ibm-object-csi-driver/ibm-object-csi-driver/cos-csi-mounter/cos-csi-mounter-${{ env.APP_VERSION }}.deb.tar.gz.sha256 + /home/runner/work/ibm-object-csi-driver/ibm-object-csi-driver/cos-csi-mounter/cos-csi-mounter-${{ env.APP_VERSION }}.rpm.tar.gz + /home/runner/work/ibm-object-csi-driver/ibm-object-csi-driver/cos-csi-mounter/cos-csi-mounter-${{ env.APP_VERSION }}.rpm.tar.gz.sha256 + tag_name: v1.0.5 + name: v1.0.5 + body: | + ## What's New + - Fix for rclone mount hang issue + prerelease: ${{ env.IS_LATEST_RELEASE != 'true' }} + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 From de0199e188cac3ae2a04e282aa3b574f4161acfb Mon Sep 17 00:00:00 2001 From: Prachi Shivanand Anure Date: Tue, 9 Dec 2025 00:30:18 +0530 Subject: [PATCH 22/54] minor changes --- .github/workflows/release.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index dfc8aa19..35a14a35 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -68,18 +68,15 @@ jobs: touch "Passing" || touch "Failed" - name: Build driver image - run: make driver # ← FIXED: removed 'make provisioner' (does not exist) + run: make driver - name: Publish coverage - if: success() && matrix.go-version == 'stable' + if: success() && matrix.go-version == 'stable' && (github.ref == 'refs/heads/master' || github.event_name == 'pull_request') env: GHE_TOKEN: ${{ secrets.GHE_TOKEN }} run: | ./scripts/publishCoverage.sh - # ──────────────────────── - # Your ORIGINAL release job — 100% UNCHANGED - # ──────────────────────── release: needs: build-and-test permissions: write-all From 1e7fb3012fc876e5027fa0bbab53c5fa12923141 Mon Sep 17 00:00:00 2001 From: Prachi Shivanand Anure Date: Thu, 11 Dec 2025 19:54:28 +0530 Subject: [PATCH 23/54] fixed review comments --- .github/workflows/release.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 35a14a35..76e2ee08 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,13 +4,11 @@ on: push: branches: - main - - master tags: - "v[0-9]+.[0-9]+.[0-9]+*" pull_request: branches: - main - - master concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} @@ -138,7 +136,7 @@ jobs: tag_name: v1.0.5 name: v1.0.5 body: | - ## What's New + ## 🚀 What’s New - Fix for rclone mount hang issue prerelease: ${{ env.IS_LATEST_RELEASE != 'true' }} From ba308467553e12704a33914f9969d0c58b3d3432 Mon Sep 17 00:00:00 2001 From: Prachi Shivanand Anure Date: Thu, 11 Dec 2025 20:10:45 +0530 Subject: [PATCH 24/54] minor changes --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index d26492c9..040e6919 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ EXE_DRIVER_NAME=ibm-object-csi-driver REGISTRY=quay.io/ibm-object-csi-driver -export LINT_VERSION="1.64.8" +export LINT_VERSION="2.7.2" COLOR_YELLOW=\033[0;33m COLOR_RESET=\033[0m From 05d22f8370ff96eea865b17c57cf5983cdce55ad Mon Sep 17 00:00:00 2001 From: Prachi Shivanand Anure Date: Thu, 11 Dec 2025 20:16:34 +0530 Subject: [PATCH 25/54] minor changes --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 76e2ee08..cfb17937 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,7 +23,7 @@ jobs: strategy: matrix: - go-version: ["1.24.5", "stable"] + go-version: ["1.24.5"] fail-fast: false steps: @@ -69,7 +69,7 @@ jobs: run: make driver - name: Publish coverage - if: success() && matrix.go-version == 'stable' && (github.ref == 'refs/heads/master' || github.event_name == 'pull_request') + if: success() env: GHE_TOKEN: ${{ secrets.GHE_TOKEN }} run: | From 5ab469feda10dfac79a8b958ec862143e4349261 Mon Sep 17 00:00:00 2001 From: Prachi Shivanand Anure Date: Sun, 14 Dec 2025 22:27:56 +0530 Subject: [PATCH 26/54] minor changes --- .github/workflows/release.yml | 10 ++--- Dockerfile | 82 +++++++++++++++++------------------ 2 files changed, 45 insertions(+), 47 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cfb17937..c55efde9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -100,7 +100,6 @@ jobs: uses: github/codeql-action/init@v3 with: languages: "go" - - name: Run Unit Tests for cos csi mounter run: sudo make ut-coverage -C ${{ matrix.package_dir }} @@ -111,11 +110,11 @@ jobs: - name: Get last commit message id: check_commit - run: | + run: | message=$(git log -1 --pretty=%B) - message="${message//'%'/'%25'}" - message="${message//$'\n'/'%0A'}" - message="${message//$'\r'/'%0D'}" + message="${message//'%'/'%25'}" # Escape '%' + message="${message//$'\n'/'%0A'}" # Escape newlines + message="${message//$'\r'/'%0D'}" # Escape carriage returns echo "message=$message" >> "$GITHUB_OUTPUT" shell: bash @@ -139,6 +138,5 @@ jobs: ## 🚀 What’s New - Fix for rclone mount hang issue prerelease: ${{ env.IS_LATEST_RELEASE != 'true' }} - - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v3 diff --git a/Dockerfile b/Dockerfile index f692c7de..7e7870af 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,66 +1,66 @@ FROM registry.access.redhat.com/ubi8/ubi-minimal:8.10-1179.1741863533 AS s3fs-builder -ARG RHSM_PASS=blank -ARG RHSM_USER=blank -ENV RHSM_PASS="${RHSM_PASS}" -ENV RHSM_USER="${RHSM_USER}" +ARG RHSM_PASS=blank +ARG RHSM_USER=blank -ADD register-sys.sh /usr/bin/ +ENV RHSM_PASS="${RHSM_PASS}" +ENV RHSM_USER="${RHSM_USER}" -RUN microdnf update --setopt=tsflags=nodocs && \ - microdnf install -y --nodocs hostname subscription-manager findutils xz && \ - microdnf clean all -y +ADD register-sys.sh /usr/bin/ -RUN echo "Skipping RHSM registration in public CI" && hostname +RUN microdnf update --setopt=tsflags=nodocs && \ + microdnf install -y --nodocs hostname subscription-manager findutils xz && \ + microdnf clean all -y -RUN microdnf update --setopt=tsflags=nodocs && \ - microdnf install -y --nodocs iputils nmap-ncat udev findutils && \ - microdnf clean all -y +RUN echo "Skipping RHSM registration in public CI" && hostname -RUN microdnf update --setopt=tsflags=nodocs && \ - microdnf install -y gcc libstdc++-devel \ - gcc-c++ fuse curl-devel \ - libxml2-devel openssl-devel mailcap \ - git automake make && \ - microdnf clean all -y +RUN microdnf update --setopt=tsflags=nodocs && \ + microdnf install -y --nodocs iputils nmap-ncat udev findutils && \ + microdnf clean all -y -RUN microdnf -y install fuse-devel && microdnf clean all -y +RUN microdnf update --setopt=tsflags=nodocs && \ + microdnf install -y gcc libstdc++-devel \ + gcc-c++ fuse curl-devel \ + libxml2-devel openssl-devel mailcap \ + git automake make && \ + microdnf clean all -y -RUN rm /usr/bin/register-sys.sh && subscription-manager unregister && subscription-manager clean || true +RUN microdnf -y install fuse-devel && microdnf clean all -y -RUN git clone https://github.com/s3fs-fuse/s3fs-fuse.git && \ - cd s3fs-fuse && \ - git checkout v1.94 && \ - ./autogen.sh && ./configure --prefix=/usr/local --with-openssl && \ - make && make install && \ - rm -rf /var/lib/apt/lists/* +RUN rm /usr/bin/register-sys.sh && subscription-manager unregister && subscription-manager clean || true +RUN git clone https://github.com/s3fs-fuse/s3fs-fuse.git && \ + cd s3fs-fuse && \ + git checkout v1.94 && \ + ./autogen.sh && ./configure --prefix=/usr/local --with-openssl && \ + make && make install && \ + rm -rf /var/lib/apt/lists/* -FROM registry.access.redhat.com/ubi8/ubi AS rclone-builder -RUN yum install wget git gcc -y -ENV ARCH=amd64 -ENV GO_VERSION=1.25.0 +FROM registry.access.redhat.com/ubi8/ubi AS rclone-builder +RUN yum install wget git gcc -y -RUN echo $ARCH $GO_VERSION +ENV ARCH=amd64 +ENV GO_VERSION=1.25.0 -RUN wget -q https://dl.google.com/go/go$GO_VERSION.linux-$ARCH.tar.gz && \ - tar -xf go$GO_VERSION.linux-$ARCH.tar.gz && \ - rm go$GO_VERSION.linux-$ARCH.tar.gz && \ - mv go /usr/local +RUN echo $ARCH $GO_VERSION -ENV GOROOT=/usr/local/go -ENV GOPATH=/go -ENV PATH=$GOPATH/bin:$GOROOT/bin:$PATH -ENV GOARCH=$ARCH -ENV GO111MODULE=on +RUN wget -q https://dl.google.com/go/go$GO_VERSION.linux-$ARCH.tar.gz && \ + tar -xf go$GO_VERSION.linux-$ARCH.tar.gz && \ + rm go$GO_VERSION.linux-$ARCH.tar.gz && \ + mv go /usr/local + +ENV GOROOT=/usr/local/go +ENV GOPATH=/go +ENV PATH=$GOPATH/bin:$GOROOT/bin:$PATH +ENV GOARCH=$ARCH +ENV GO111MODULE=on RUN git clone https://github.com/rclone/rclone.git && \ cd rclone && git checkout tags/v1.69.0 && \ go build && ./rclone version && \ cp rclone /usr/local/bin/rclone -# --------------------------------------------------------------------------------------- FROM registry.access.redhat.com/ubi8/ubi:latest From 73272e697ec966e383dcd42437ee2d96b6a6c2b7 Mon Sep 17 00:00:00 2001 From: Prachi Shivanand Anure Date: Mon, 15 Dec 2025 13:48:38 +0530 Subject: [PATCH 27/54] added common steps --- .github/workflows/release.yml | 25 +++++++++++++------------ scripts/publishCoverage.sh | 6 +++--- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c55efde9..66d471b3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,8 +4,6 @@ on: push: branches: - main - tags: - - "v[0-9]+.[0-9]+.[0-9]+*" pull_request: branches: - main @@ -15,17 +13,15 @@ concurrency: cancel-in-progress: true jobs: - build-and-test: + common-steps: runs-on: ubuntu-latest + outputs: + common-dependencies: ${{ steps.common-steps.outputs.deps }} permissions: contents: write # needed to push coverage to gh-pages pull-requests: write # needed to comment on PRs - strategy: - matrix: - go-version: ["1.24.5"] - fail-fast: false - + write-all: true # necessary for release creation and publishing steps: - name: Checkout code uses: actions/checkout@v5 @@ -53,9 +49,15 @@ jobs: go mod tidy make deps - - name: Check code formatting - run: make fmt + build-and-test: + needs: common-steps + runs-on: ubuntu-latest + strategy: + matrix: + go-version: ["1.24.5"] + fail-fast: false + steps: - name: Run unit tests run: make test @@ -76,8 +78,7 @@ jobs: ./scripts/publishCoverage.sh release: - needs: build-and-test - permissions: write-all + needs: common-steps runs-on: ubuntu-latest strategy: diff --git a/scripts/publishCoverage.sh b/scripts/publishCoverage.sh index 076168c8..8dfab3ab 100755 --- a/scripts/publishCoverage.sh +++ b/scripts/publishCoverage.sh @@ -87,11 +87,11 @@ curl -s "https://img.shields.io/badge/coverage-${NEW_COVERAGE}%25-${BADGE_COLOR} # Result message if (( $(echo "$OLD_COVERAGE > $NEW_COVERAGE" | bc -l) )); then - RESULT_MESSAGE="Coverage decreased from **$OLD_COVERAGE%** → **$NEW_COVERAGE%**" + RESULT_MESSAGE=":red_circle: Coverage decreased from $OLD_COVERAGE% to $NEW_COVERAGE%" elif (( $(echo "$OLD_COVERAGE == $NEW_COVERAGE" | bc -l) )); then - RESULT_MESSAGE="Coverage remained the same at **$NEW_COVERAGE%**" + RESULT_MESSAGE=":thumbsup: Coverage remained same at $NEW_COVERAGE%" else - RESULT_MESSAGE="Coverage increased from **$OLD_COVERAGE%** → **$NEW_COVERAGE%**" + RESULT_MESSAGE=":thumbsup: Coverage increased from $OLD_COVERAGE% to $NEW_COVERAGE%" fi # Push to gh-pages (only on push) From fd49f5cb44a04c9663c0c69a1a248d7cb1d30866 Mon Sep 17 00:00:00 2001 From: Prachi Shivanand Anure Date: Mon, 15 Dec 2025 13:55:21 +0530 Subject: [PATCH 28/54] minor changes --- .github/workflows/release.yml | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 66d471b3..c30fd2d5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,15 +13,17 @@ concurrency: cancel-in-progress: true jobs: - common-steps: + build-and-test: runs-on: ubuntu-latest - outputs: - common-dependencies: ${{ steps.common-steps.outputs.deps }} permissions: contents: write # needed to push coverage to gh-pages pull-requests: write # needed to comment on PRs - write-all: true # necessary for release creation and publishing + strategy: + matrix: + go-version: ["1.24.5"] + fail-fast: false + steps: - name: Checkout code uses: actions/checkout@v5 @@ -49,15 +51,9 @@ jobs: go mod tidy make deps - build-and-test: - needs: common-steps - runs-on: ubuntu-latest - strategy: - matrix: - go-version: ["1.24.5"] - fail-fast: false + - name: Check code formatting + run: make fmt - steps: - name: Run unit tests run: make test @@ -78,7 +74,8 @@ jobs: ./scripts/publishCoverage.sh release: - needs: common-steps + needs: build-and-test + permissions: write-all runs-on: ubuntu-latest strategy: From 2bd796069e6b6305b349e1cb6a8298af7703b255 Mon Sep 17 00:00:00 2001 From: Prachi Shivanand Anure Date: Mon, 15 Dec 2025 14:42:16 +0530 Subject: [PATCH 29/54] minor changes in pipeline --- .github/workflows/release.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c30fd2d5..f86e1ee8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -87,6 +87,9 @@ jobs: IS_LATEST_RELEASE: 'true' APP_VERSION: 1.0.5 + # Add the condition to trigger release based on commit message containing "release" + if: contains(github.event.head_commit.message, 'release') + steps: - name: Checkout Code uses: actions/checkout@v5 From ec9472fd48dbf789ebe99847e584542c5772ccf9 Mon Sep 17 00:00:00 2001 From: Prachi Shivanand Anure Date: Tue, 16 Dec 2025 10:56:52 +0530 Subject: [PATCH 30/54] minor changes --- .github/workflows/release.yml | 138 +++++++++++++++++++++------------- scripts/calculateCoverage.sh | 21 +++--- scripts/publishCoverage.sh | 21 +++--- 3 files changed, 105 insertions(+), 75 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f86e1ee8..b0df810e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,17 +13,41 @@ concurrency: cancel-in-progress: true jobs: + common-setup: + runs-on: ubuntu-latest + outputs: + should_release: ${{ steps.check_release.outputs.should_release }} + + steps: + - name: Checkout code + uses: actions/checkout@v5 + with: + fetch-depth: 0 + + - name: Get commit message + id: get_commit + run: | + message=$(git log -1 --pretty=%B) + echo "message=$message" >> "$GITHUB_OUTPUT" + + - name: Check if release should be triggered + id: check_release + run: | + if [[ "${{ steps.get_commit.outputs.message }}" == *"release"* ]]; then + echo "should_release=true" >> "$GITHUB_OUTPUT" + echo "Release will be triggered (found 'release' in commit message)" + else + echo "should_release=false" >> "$GITHUB_OUTPUT" + echo "Release will NOT be triggered (no 'release' in commit message)" + fi + build-and-test: + needs: common-setup runs-on: ubuntu-latest permissions: contents: write # needed to push coverage to gh-pages pull-requests: write # needed to comment on PRs - strategy: - matrix: - go-version: ["1.24.5"] - fail-fast: false - steps: - name: Checkout code uses: actions/checkout@v5 @@ -33,7 +57,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: ${{ matrix.go-version }} + go-version: "1.24.5" check-latest: true cache: true @@ -74,7 +98,8 @@ jobs: ./scripts/publishCoverage.sh release: - needs: build-and-test + needs: [common-setup, build-and-test] + if: needs.common-setup.outputs.should_release == 'true' permissions: write-all runs-on: ubuntu-latest @@ -87,57 +112,66 @@ jobs: IS_LATEST_RELEASE: 'true' APP_VERSION: 1.0.5 - # Add the condition to trigger release based on commit message containing "release" - if: contains(github.event.head_commit.message, 'release') - steps: - - name: Checkout Code - uses: actions/checkout@v5 + - name: Checkout Code + uses: actions/checkout@v5 - - name: Print Go Version - run: go version + - name: Print Go Version + run: go version - - name: Initialize CodeQL - uses: github/codeql-action/init@v3 - with: - languages: "go" - - name: Run Unit Tests for cos csi mounter - run: sudo make ut-coverage -C ${{ matrix.package_dir }} + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: "go" + + - name: Run Unit Tests for cos csi mounter + run: sudo make ut-coverage -C ${{ matrix.package_dir }} - - name: Build Debian and RPM packages for cos-csi-mounter systemd service - run: | + - name: Build Debian and RPM packages for cos-csi-mounter systemd service + run: | cd ${{ matrix.package_dir }} make packages - - name: Get last commit message - id: check_commit - run: | - message=$(git log -1 --pretty=%B) - message="${message//'%'/'%25'}" # Escape '%' - message="${message//$'\n'/'%0A'}" # Escape newlines - message="${message//$'\r'/'%0D'}" # Escape carriage returns - echo "message=$message" >> "$GITHUB_OUTPUT" - shell: bash - - - name: Check Commit Message - run: | + - name: Get last commit message + id: check_commit + run: | + message=$(git log -1 --pretty=%B) + message="${message//'%'/'%25'}" # Escape '%' + message="${message//$'\n'/'%0A'}" # Escape newlines + message="${message//$'\r'/'%0D'}" # Escape carriage returns + echo "message=$message" >> "$GITHUB_OUTPUT" + shell: bash + + - name: Check Commit Message + run: | echo "Commit Message: ${{ steps.check_commit.outputs.message }}" - - name: Latest Version (Tag and Release) - id: release - if: contains(steps.check_commit.outputs.message, 'publish') - uses: softprops/action-gh-release@v2 - with: - files: | - /home/runner/work/ibm-object-csi-driver/ibm-object-csi-driver/cos-csi-mounter/cos-csi-mounter-${{ env.APP_VERSION }}.deb.tar.gz - /home/runner/work/ibm-object-csi-driver/ibm-object-csi-driver/cos-csi-mounter/cos-csi-mounter-${{ env.APP_VERSION }}.deb.tar.gz.sha256 - /home/runner/work/ibm-object-csi-driver/ibm-object-csi-driver/cos-csi-mounter/cos-csi-mounter-${{ env.APP_VERSION }}.rpm.tar.gz - /home/runner/work/ibm-object-csi-driver/ibm-object-csi-driver/cos-csi-mounter/cos-csi-mounter-${{ env.APP_VERSION }}.rpm.tar.gz.sha256 - tag_name: v1.0.5 - name: v1.0.5 - body: | - ## 🚀 What’s New - - Fix for rclone mount hang issue - prerelease: ${{ env.IS_LATEST_RELEASE != 'true' }} - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 + - name: Check Commit Message for Release Trigger + id: check_commit_condition + run: | + echo "Commit Message: ${{ steps.check_commit.outputs.message }}" + if [[ "${{ steps.check_commit.outputs.message }}" == *"release"* ]]; then + echo "Release job triggered" + else + echo "No 'release' keyword found in the commit message. Skipping release job." + exit 0 # Exit early to skip the release job + fi + + - name: Latest Version (Tag and Release) + if: success() + id: release + uses: softprops/action-gh-release@v2 + with: + files: | + /home/runner/work/ibm-object-csi-driver/ibm-object-csi-driver/cos-csi-mounter/cos-csi-mounter-${{ env.APP_VERSION }}.deb.tar.gz + /home/runner/work/ibm-object-csi-driver/ibm-object-csi-driver/cos-csi-mounter/cos-csi-mounter-${{ env.APP_VERSION }}.deb.tar.gz.sha256 + /home/runner/work/ibm-object-csi-driver/ibm-object-csi-driver/cos-csi-mounter/cos-csi-mounter-${{ env.APP_VERSION }}.rpm.tar.gz + /home/runner/work/ibm-object-csi-driver/ibm-object-csi-driver/cos-csi-mounter/cos-csi-mounter-${{ env.APP_VERSION }}.rpm.tar.gz.sha256 + tag_name: v1.0.5 + name: v1.0.5 + body: | + ## 🚀 What’s New + - Fix for rclone mount hang issue + prerelease: ${{ env.IS_LATEST_RELEASE != 'true' }} + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 diff --git a/scripts/calculateCoverage.sh b/scripts/calculateCoverage.sh index 90540c88..85f6d4ef 100755 --- a/scripts/calculateCoverage.sh +++ b/scripts/calculateCoverage.sh @@ -1,18 +1,17 @@ #!/bin/bash #****************************************************************************** -# Copyright 2021 IBM Corp. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# * Licensed Materials - Property of IBM +# * IBM Cloud Kubernetes Service, 5737-D43 +# * (C) Copyright IBM Corp. 2025 All Rights Reserved. +# * US Government Users Restricted Rights - Use, duplication or +# * disclosure restricted by GSA ADP Schedule Contract with IBM Corp. +#****************************************************************************** # -# http://www.apache.org/licenses/LICENSE-2.0 +# This script calculates the test coverage from cover.html and outputs the percentage. # -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#****************************************************************************** +# It is called by the GitHub Action in the pipeline to calculate the coverage percentage. + +# Extract the coverage percentage from cover.html COVERAGE=$(cat cover.html | grep "%)" | sed 's/[][()><%]/ /g' | awk '{ print $4 }' | awk '{s+=$1}END{print s/NR}') echo "-------------------------------------------------------------------------" diff --git a/scripts/publishCoverage.sh b/scripts/publishCoverage.sh index 8dfab3ab..a1ad8bdc 100755 --- a/scripts/publishCoverage.sh +++ b/scripts/publishCoverage.sh @@ -1,18 +1,15 @@ #!/bin/bash #****************************************************************************** -# Copyright 2022 IBM Corp. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# * Licensed Materials - Property of IBM +# * IBM Cloud Kubernetes Service, 5737-D43 +# * (C) Copyright IBM Corp. 2025 All Rights Reserved. +# * US Government Users Restricted Rights - Use, duplication or +# * disclosure restricted by GSA ADP Schedule Contract with IBM Corp. #****************************************************************************** +# +# This script publishes the coverage results to the PR comment and the GitHub Pages +# coverage badge. It calculates and compares the coverage between branches and posts +# a comment to the pull request with the coverage result. set -euo pipefail echo "===== Publishing the coverage results =====" From aae88d35dd97c2bede43b4f6ba68e0437be08b3d Mon Sep 17 00:00:00 2001 From: Prachi Shivanand Anure Date: Tue, 16 Dec 2025 11:59:57 +0530 Subject: [PATCH 31/54] Revert Dockerfile changes --- Dockerfile | 67 +++++++++++++++++++++--------------------------------- 1 file changed, 26 insertions(+), 41 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7e7870af..6e57b4e0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,61 +7,49 @@ ENV RHSM_PASS="${RHSM_PASS}" ENV RHSM_USER="${RHSM_USER}" ADD register-sys.sh /usr/bin/ - RUN microdnf update --setopt=tsflags=nodocs && \ - microdnf install -y --nodocs hostname subscription-manager findutils xz && \ - microdnf clean all -y - -RUN echo "Skipping RHSM registration in public CI" && hostname - + microdnf install -y --nodocs hostname subscription-manager +RUN hostname; chmod 755 /usr/bin/register-sys.sh && /usr/bin/register-sys.sh RUN microdnf update --setopt=tsflags=nodocs && \ - microdnf install -y --nodocs iputils nmap-ncat udev findutils && \ + microdnf install -y --nodocs iputils nfs-utils rpcbind xfsprogs udev nc e2fsprogs e4fsprogs && \ microdnf clean all -y - RUN microdnf update --setopt=tsflags=nodocs && \ microdnf install -y gcc libstdc++-devel \ gcc-c++ fuse curl-devel \ libxml2-devel openssl-devel mailcap \ - git automake make && \ - microdnf clean all -y + git automake make +RUN microdnf -y install fuse-devel +RUN rm /usr/bin/register-sys.sh && subscription-manager unregister && subscription-manager clean -RUN microdnf -y install fuse-devel && microdnf clean all -y +RUN git clone https://github.com/s3fs-fuse/s3fs-fuse.git && cd s3fs-fuse && \ + git checkout v1.94 && \ + ./autogen.sh && ./configure --prefix=/usr/local --with-openssl && make && make install && \ + rm -rf /var/lib/apt/lists/* -RUN rm /usr/bin/register-sys.sh && subscription-manager unregister && subscription-manager clean || true +FROM registry.access.redhat.com/ubi8/ubi AS rclone-builder +RUN yum install wget git gcc -y -RUN git clone https://github.com/s3fs-fuse/s3fs-fuse.git && \ - cd s3fs-fuse && \ - git checkout v1.94 && \ - ./autogen.sh && ./configure --prefix=/usr/local --with-openssl && \ - make && make install && \ - rm -rf /var/lib/apt/lists/* +ENV ARCH=amd64 +ENV GO_VERSION=1.25.0 +RUN echo $ARCH $GO_VERSION -FROM registry.access.redhat.com/ubi8/ubi AS rclone-builder -RUN yum install wget git gcc -y +RUN wget -q https://dl.google.com/go/go$GO_VERSION.linux-$ARCH.tar.gz && \ + tar -xf go$GO_VERSION.linux-$ARCH.tar.gz && \ + rm go$GO_VERSION.linux-$ARCH.tar.gz && \ + mv go /usr/local -ENV ARCH=amd64 -ENV GO_VERSION=1.25.0 - -RUN echo $ARCH $GO_VERSION - -RUN wget -q https://dl.google.com/go/go$GO_VERSION.linux-$ARCH.tar.gz && \ - tar -xf go$GO_VERSION.linux-$ARCH.tar.gz && \ - rm go$GO_VERSION.linux-$ARCH.tar.gz && \ - mv go /usr/local - -ENV GOROOT=/usr/local/go -ENV GOPATH=/go -ENV PATH=$GOPATH/bin:$GOROOT/bin:$PATH -ENV GOARCH=$ARCH -ENV GO111MODULE=on +ENV GOROOT=/usr/local/go +ENV GOPATH=/go +ENV PATH=$GOPATH/bin:$GOROOT/bin:$PATH +ENV GOARCH=$ARCH +ENV GO111MODULE=on RUN git clone https://github.com/rclone/rclone.git && \ cd rclone && git checkout tags/v1.69.0 && \ go build && ./rclone version && \ cp rclone /usr/local/bin/rclone - FROM registry.access.redhat.com/ubi8/ubi:latest # Default values @@ -72,11 +60,8 @@ ARG build_date=unknown LABEL description="IBM CSI Object Storage Plugin" LABEL build-date=${build_date} LABEL git-commit-id=${git_commit_id} - -RUN yum update -y && \ - yum install -y fuse fuse-libs fuse3 fuse3-libs && \ - yum clean all -y +RUN yum update -y && yum install fuse fuse-libs fuse3 fuse3-libs -y COPY --from=s3fs-builder /usr/local/bin/s3fs /usr/bin/s3fs COPY --from=rclone-builder /usr/local/bin/rclone /usr/bin/rclone COPY ibm-object-csi-driver ibm-object-csi-driver -ENTRYPOINT ["/ibm-object-csi-driver"] +ENTRYPOINT ["/ibm-object-csi-driver"] \ No newline at end of file From 830e7d5364994c7277b66029b1337b3a96b3cb99 Mon Sep 17 00:00:00 2001 From: Prachi Shivanand Anure Date: Tue, 16 Dec 2025 13:27:20 +0530 Subject: [PATCH 32/54] Revert Dockerfile changes --- .github/workflows/release.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b0df810e..2eefdea9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,6 +24,14 @@ jobs: with: fetch-depth: 0 + - name: Export Secrets + run: | + echo "RHSM_PASS=${{ secrets.RHSM_PASS }}" >> $GITHUB_ENV + echo "RHSM_USER=${{ secrets.RHSM_USER }}" >> $GITHUB_ENV + env: + RHSM_PASS: ${{ secrets.RHSM_PASS }} + RHSM_USER: ${{ secrets.RHSM_USER }} + - name: Get commit message id: get_commit run: | From 93b36900f005690598469774cce393b7e2f1fa05 Mon Sep 17 00:00:00 2001 From: Prachi Shivanand Anure Date: Tue, 16 Dec 2025 13:40:32 +0530 Subject: [PATCH 33/54] Revert Dockerfile changes --- .github/workflows/release.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2eefdea9..db572205 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -96,7 +96,8 @@ jobs: touch "Passing" || touch "Failed" - name: Build driver image - run: make driver + run: | + docker build --build-arg RHSM_USER=${{ secrets.RHSM_USER }} --build-arg RHSM_PASS=${{ secrets.RHSM_PASS }} . - name: Publish coverage if: success() From 985c01307a06a5153053fe536c1a8c6b9ea6202c Mon Sep 17 00:00:00 2001 From: Prachi Shivanand Anure Date: Tue, 16 Dec 2025 16:24:46 +0530 Subject: [PATCH 34/54] Revert Dockerfile changes --- Dockerfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6e57b4e0..45043486 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,7 +26,7 @@ RUN git clone https://github.com/s3fs-fuse/s3fs-fuse.git && cd s3fs-fuse && \ ./autogen.sh && ./configure --prefix=/usr/local --with-openssl && make && make install && \ rm -rf /var/lib/apt/lists/* -FROM registry.access.redhat.com/ubi8/ubi AS rclone-builder +FROM registry.access.redhat.com/ubi8/ubi:latest AS rclone-builder RUN yum install wget git gcc -y ENV ARCH=amd64 @@ -63,5 +63,7 @@ LABEL git-commit-id=${git_commit_id} RUN yum update -y && yum install fuse fuse-libs fuse3 fuse3-libs -y COPY --from=s3fs-builder /usr/local/bin/s3fs /usr/bin/s3fs COPY --from=rclone-builder /usr/local/bin/rclone /usr/bin/rclone -COPY ibm-object-csi-driver ibm-object-csi-driver +RUN ls -alh ./ibm-object-csi-driver || echo "ibm-object-csi-driver file not found" + +COPY ./ibm-object-csi-driver /ibm-object-csi-driver ENTRYPOINT ["/ibm-object-csi-driver"] \ No newline at end of file From fa24c1edf654c9a522e7aab8e7a6c0b9cc76b626 Mon Sep 17 00:00:00 2001 From: Prachi Shivanand Anure Date: Tue, 16 Dec 2025 17:00:07 +0530 Subject: [PATCH 35/54] Revert Dockerfile changes --- .github/workflows/release.yml | 5 ++++- Dockerfile | 6 ++---- Makefile | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index db572205..5fa8ed72 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -97,7 +97,10 @@ jobs: - name: Build driver image run: | - docker build --build-arg RHSM_USER=${{ secrets.RHSM_USER }} --build-arg RHSM_PASS=${{ secrets.RHSM_PASS }} . + make driver + env: + RHSM_USER: ${{ secrets.RHSM_USER }} + RHSM_PASS: ${{ secrets.RHSM_PASS }} - name: Publish coverage if: success() diff --git a/Dockerfile b/Dockerfile index 45043486..6e57b4e0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,7 +26,7 @@ RUN git clone https://github.com/s3fs-fuse/s3fs-fuse.git && cd s3fs-fuse && \ ./autogen.sh && ./configure --prefix=/usr/local --with-openssl && make && make install && \ rm -rf /var/lib/apt/lists/* -FROM registry.access.redhat.com/ubi8/ubi:latest AS rclone-builder +FROM registry.access.redhat.com/ubi8/ubi AS rclone-builder RUN yum install wget git gcc -y ENV ARCH=amd64 @@ -63,7 +63,5 @@ LABEL git-commit-id=${git_commit_id} RUN yum update -y && yum install fuse fuse-libs fuse3 fuse3-libs -y COPY --from=s3fs-builder /usr/local/bin/s3fs /usr/bin/s3fs COPY --from=rclone-builder /usr/local/bin/rclone /usr/bin/rclone -RUN ls -alh ./ibm-object-csi-driver || echo "ibm-object-csi-driver file not found" - -COPY ./ibm-object-csi-driver /ibm-object-csi-driver +COPY ibm-object-csi-driver ibm-object-csi-driver ENTRYPOINT ["/ibm-object-csi-driver"] \ No newline at end of file diff --git a/Makefile b/Makefile index 040e6919..e1fe648b 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,7 @@ GOPACKAGES=$(shell go list ./... | grep -v ./tests/... | grep -v /mounter/utils .PHONY: test test: - go run github.com/pierrre/gotestcover@latest -v -race -coverprofile=coverage.out ${GOPACKAGES} + go test -v -race ${GOPACKAGES} -coverprofile=coverage.out .PHONY: deps deps: From 14beee28fd8c3750e169a0a49b1bbc2055a39311 Mon Sep 17 00:00:00 2001 From: Prachi Shivanand Anure Date: Tue, 16 Dec 2025 18:40:53 +0530 Subject: [PATCH 36/54] fixed review comments --- .github/workflows/release.yml | 35 ++++------------------------------- 1 file changed, 4 insertions(+), 31 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5fa8ed72..62441c55 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,15 +23,6 @@ jobs: uses: actions/checkout@v5 with: fetch-depth: 0 - - - name: Export Secrets - run: | - echo "RHSM_PASS=${{ secrets.RHSM_PASS }}" >> $GITHUB_ENV - echo "RHSM_USER=${{ secrets.RHSM_USER }}" >> $GITHUB_ENV - env: - RHSM_PASS: ${{ secrets.RHSM_PASS }} - RHSM_USER: ${{ secrets.RHSM_USER }} - - name: Get commit message id: get_commit run: | @@ -57,26 +48,11 @@ jobs: pull-requests: write # needed to comment on PRs steps: - - name: Checkout code - uses: actions/checkout@v5 - with: - fetch-depth: 0 - - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version: "1.24.5" - check-latest: true - cache: true - - name: Install system dependencies (bc + docker) run: | sudo apt-get update -qq sudo apt-get install -y bc docker-ce-cli - - name: Make scripts executable - run: chmod +x scripts/*.sh || true - - name: Prepare environment run: | export GO111MODULE=on @@ -86,7 +62,7 @@ jobs: - name: Check code formatting run: make fmt - - name: Run unit tests + - name: Run unit tests (entire repo) run: make test - name: Generate coverage @@ -125,9 +101,6 @@ jobs: APP_VERSION: 1.0.5 steps: - - name: Checkout Code - uses: actions/checkout@v5 - - name: Print Go Version run: go version @@ -135,9 +108,9 @@ jobs: uses: github/codeql-action/init@v3 with: languages: "go" - - - name: Run Unit Tests for cos csi mounter - run: sudo make ut-coverage -C ${{ matrix.package_dir }} + + - name: Run Unit Tests for entire repo + run: sudo make ut-coverage - name: Build Debian and RPM packages for cos-csi-mounter systemd service run: | From 2d4c6eb44a25d7fa5d391ffc822273345cc6ebe3 Mon Sep 17 00:00:00 2001 From: Prachi Shivanand Anure Date: Tue, 16 Dec 2025 19:17:56 +0530 Subject: [PATCH 37/54] fixed review comments --- .github/workflows/release.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 62441c55..8623a37b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -48,6 +48,11 @@ jobs: pull-requests: write # needed to comment on PRs steps: + - name: Checkout code + uses: actions/checkout@v5 + with: + fetch-depth: 0 + - name: Install system dependencies (bc + docker) run: | sudo apt-get update -qq @@ -101,6 +106,9 @@ jobs: APP_VERSION: 1.0.5 steps: + - name: Checkout Code + uses: actions/checkout@v5 + - name: Print Go Version run: go version @@ -109,8 +117,8 @@ jobs: with: languages: "go" - - name: Run Unit Tests for entire repo - run: sudo make ut-coverage + - name: Run Unit Tests for cos csi mounter + run: sudo make ut-coverage -C ${{ matrix.package_dir }} - name: Build Debian and RPM packages for cos-csi-mounter systemd service run: | From 663aa858feb96601c1866154188b3c4cc281b590 Mon Sep 17 00:00:00 2001 From: Prachi Shivanand Anure Date: Tue, 16 Dec 2025 19:30:15 +0530 Subject: [PATCH 38/54] minor canges --- .github/workflows/release.yml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8623a37b..c7c354d1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,6 +23,15 @@ jobs: uses: actions/checkout@v5 with: fetch-depth: 0 + + - name: Export Secrets + run: | + echo "RHSM_PASS=${{ secrets.RHSM_PASS }}" >> $GITHUB_ENV + echo "RHSM_USER=${{ secrets.RHSM_USER }}" >> $GITHUB_ENV + env: + RHSM_PASS: ${{ secrets.RHSM_PASS }} + RHSM_USER: ${{ secrets.RHSM_USER }} + - name: Get commit message id: get_commit run: | @@ -53,6 +62,13 @@ jobs: with: fetch-depth: 0 + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: "1.24.5" + check-latest: true + cache: true + - name: Install system dependencies (bc + docker) run: | sudo apt-get update -qq @@ -67,7 +83,7 @@ jobs: - name: Check code formatting run: make fmt - - name: Run unit tests (entire repo) + - name: Run unit tests run: make test - name: Generate coverage From 5fb9f69c48c9b4aae60c1871a477194e6c5a42fc Mon Sep 17 00:00:00 2001 From: Prachi Shivanand Anure Date: Tue, 16 Dec 2025 19:43:15 +0530 Subject: [PATCH 39/54] minor canges --- .github/workflows/release.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c7c354d1..7081e004 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,13 +24,6 @@ jobs: with: fetch-depth: 0 - - name: Export Secrets - run: | - echo "RHSM_PASS=${{ secrets.RHSM_PASS }}" >> $GITHUB_ENV - echo "RHSM_USER=${{ secrets.RHSM_USER }}" >> $GITHUB_ENV - env: - RHSM_PASS: ${{ secrets.RHSM_PASS }} - RHSM_USER: ${{ secrets.RHSM_USER }} - name: Get commit message id: get_commit From 9f01112690d9a571cc08e0ce3a0bdcce0c7d7b51 Mon Sep 17 00:00:00 2001 From: Prachi Shivanand Anure Date: Tue, 16 Dec 2025 20:04:47 +0530 Subject: [PATCH 40/54] minor canges --- pkg/mounter/mounter_test.go | 43 ++++++------------------------------- 1 file changed, 6 insertions(+), 37 deletions(-) diff --git a/pkg/mounter/mounter_test.go b/pkg/mounter/mounter_test.go index fd5543df..d34f9146 100644 --- a/pkg/mounter/mounter_test.go +++ b/pkg/mounter/mounter_test.go @@ -1,27 +1,13 @@ package mounter import ( - "reflect" - "sort" - "testing" - "github.com/IBM/ibm-object-csi-driver/pkg/constants" mounterUtils "github.com/IBM/ibm-object-csi-driver/pkg/mounter/utils" "github.com/stretchr/testify/assert" -) -func stringSlicesEqualIgnoreOrder(a, b []string) bool { - if len(a) != len(b) { - return false - } - aCopy := make([]string, len(a)) - bCopy := make([]string, len(b)) - copy(aCopy, a) - copy(bCopy, b) - sort.Strings(aCopy) - sort.Strings(bCopy) - return reflect.DeepEqual(aCopy, bCopy) -} + "reflect" + "testing" +) func TestNewMounter(t *testing.T) { tests := []struct { @@ -55,7 +41,7 @@ func TestNewMounter(t *testing.T) { AuthType: "iam", KpRootKeyCrn: "test-kp-root-key-crn", MountOptions: []string{"opt1=val1", "cipher_suites=default"}, - MounterUtils: &mounterUtils.MounterOptsUtils{}, + MounterUtils: &(mounterUtils.MounterOptsUtils{}), }, expectedErr: nil, }, @@ -85,7 +71,7 @@ func TestNewMounter(t *testing.T) { UID: "fake-uid", GID: "fake-gid", MountOptions: []string{"opt1=val1", "opt2=val2"}, - MounterUtils: &mounterUtils.MounterOptsUtils{}, + MounterUtils: &(mounterUtils.MounterOptsUtils{}), }, expectedErr: nil, }, @@ -111,7 +97,7 @@ func TestNewMounter(t *testing.T) { AuthType: "hmac", KpRootKeyCrn: "test-kp-root-key-crn", MountOptions: []string{"cipher_suites=default"}, - MounterUtils: &mounterUtils.MounterOptsUtils{}, + MounterUtils: &(mounterUtils.MounterOptsUtils{}), }, expectedErr: nil, }, @@ -123,23 +109,6 @@ func TestNewMounter(t *testing.T) { result := factory.NewMounter(test.attrib, test.secretMap, test.mountOptions, nil) - if s3fs, ok := result.(*S3fsMounter); ok { - expected := test.expected.(*S3fsMounter) - if !stringSlicesEqualIgnoreOrder(s3fs.MountOptions, expected.MountOptions) { - t.Errorf("MountOptions mismatch.\nGot: %v\nWant: %v", s3fs.MountOptions, expected.MountOptions) - } - s3fs.MountOptions = nil - expected.MountOptions = nil - } - if rclone, ok := result.(*RcloneMounter); ok { - expected := test.expected.(*RcloneMounter) - if !stringSlicesEqualIgnoreOrder(rclone.MountOptions, expected.MountOptions) { - t.Errorf("MountOptions mismatch.\nGot: %v\nWant: %v", rclone.MountOptions, expected.MountOptions) - } - rclone.MountOptions = nil - expected.MountOptions = nil - } - assert.Equal(t, result, test.expected) if !reflect.DeepEqual(result, test.expected) { From ade7ad3afa3dcdb6bece96f08a762d6a73fdafaa Mon Sep 17 00:00:00 2001 From: Prachi Shivanand Anure Date: Tue, 16 Dec 2025 20:11:43 +0530 Subject: [PATCH 41/54] minor canges --- pkg/mounter/mounter_test.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pkg/mounter/mounter_test.go b/pkg/mounter/mounter_test.go index d34f9146..0a5c1865 100644 --- a/pkg/mounter/mounter_test.go +++ b/pkg/mounter/mounter_test.go @@ -1,12 +1,13 @@ package mounter import ( + "reflect" + "sort" + "testing" + "github.com/IBM/ibm-object-csi-driver/pkg/constants" mounterUtils "github.com/IBM/ibm-object-csi-driver/pkg/mounter/utils" "github.com/stretchr/testify/assert" - - "reflect" - "testing" ) func TestNewMounter(t *testing.T) { @@ -40,7 +41,7 @@ func TestNewMounter(t *testing.T) { AccessKeys: ":test-api-key", AuthType: "iam", KpRootKeyCrn: "test-kp-root-key-crn", - MountOptions: []string{"opt1=val1", "cipher_suites=default"}, + MountOptions: []string{"cipher_suites=default", "opt1=val1"}, MounterUtils: &(mounterUtils.MounterOptsUtils{}), }, expectedErr: nil, @@ -109,6 +110,8 @@ func TestNewMounter(t *testing.T) { result := factory.NewMounter(test.attrib, test.secretMap, test.mountOptions, nil) + sort.Strings(test.expected.(*S3fsMounter).MountOptions) + sort.Strings(result.(*S3fsMounter).MountOptions) assert.Equal(t, result, test.expected) if !reflect.DeepEqual(result, test.expected) { From f3cf83ec100d2ad12647be4e2a02270e1f3ae56b Mon Sep 17 00:00:00 2001 From: Prachi Shivanand Anure Date: Tue, 16 Dec 2025 20:20:49 +0530 Subject: [PATCH 42/54] minor canges --- pkg/mounter/mounter_test.go | 40 +++++++++++++++++++++++++++++++------ 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/pkg/mounter/mounter_test.go b/pkg/mounter/mounter_test.go index 0a5c1865..fd5543df 100644 --- a/pkg/mounter/mounter_test.go +++ b/pkg/mounter/mounter_test.go @@ -10,6 +10,19 @@ import ( "github.com/stretchr/testify/assert" ) +func stringSlicesEqualIgnoreOrder(a, b []string) bool { + if len(a) != len(b) { + return false + } + aCopy := make([]string, len(a)) + bCopy := make([]string, len(b)) + copy(aCopy, a) + copy(bCopy, b) + sort.Strings(aCopy) + sort.Strings(bCopy) + return reflect.DeepEqual(aCopy, bCopy) +} + func TestNewMounter(t *testing.T) { tests := []struct { name string @@ -41,8 +54,8 @@ func TestNewMounter(t *testing.T) { AccessKeys: ":test-api-key", AuthType: "iam", KpRootKeyCrn: "test-kp-root-key-crn", - MountOptions: []string{"cipher_suites=default", "opt1=val1"}, - MounterUtils: &(mounterUtils.MounterOptsUtils{}), + MountOptions: []string{"opt1=val1", "cipher_suites=default"}, + MounterUtils: &mounterUtils.MounterOptsUtils{}, }, expectedErr: nil, }, @@ -72,7 +85,7 @@ func TestNewMounter(t *testing.T) { UID: "fake-uid", GID: "fake-gid", MountOptions: []string{"opt1=val1", "opt2=val2"}, - MounterUtils: &(mounterUtils.MounterOptsUtils{}), + MounterUtils: &mounterUtils.MounterOptsUtils{}, }, expectedErr: nil, }, @@ -98,7 +111,7 @@ func TestNewMounter(t *testing.T) { AuthType: "hmac", KpRootKeyCrn: "test-kp-root-key-crn", MountOptions: []string{"cipher_suites=default"}, - MounterUtils: &(mounterUtils.MounterOptsUtils{}), + MounterUtils: &mounterUtils.MounterOptsUtils{}, }, expectedErr: nil, }, @@ -110,8 +123,23 @@ func TestNewMounter(t *testing.T) { result := factory.NewMounter(test.attrib, test.secretMap, test.mountOptions, nil) - sort.Strings(test.expected.(*S3fsMounter).MountOptions) - sort.Strings(result.(*S3fsMounter).MountOptions) + if s3fs, ok := result.(*S3fsMounter); ok { + expected := test.expected.(*S3fsMounter) + if !stringSlicesEqualIgnoreOrder(s3fs.MountOptions, expected.MountOptions) { + t.Errorf("MountOptions mismatch.\nGot: %v\nWant: %v", s3fs.MountOptions, expected.MountOptions) + } + s3fs.MountOptions = nil + expected.MountOptions = nil + } + if rclone, ok := result.(*RcloneMounter); ok { + expected := test.expected.(*RcloneMounter) + if !stringSlicesEqualIgnoreOrder(rclone.MountOptions, expected.MountOptions) { + t.Errorf("MountOptions mismatch.\nGot: %v\nWant: %v", rclone.MountOptions, expected.MountOptions) + } + rclone.MountOptions = nil + expected.MountOptions = nil + } + assert.Equal(t, result, test.expected) if !reflect.DeepEqual(result, test.expected) { From 386f9bfe804985604401fd6672b677b1ac69405f Mon Sep 17 00:00:00 2001 From: Prachi Shivanand Anure Date: Wed, 17 Dec 2025 12:48:32 +0530 Subject: [PATCH 43/54] minor canges --- .github/workflows/release.yml | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7081e004..2623c5c4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,8 +23,13 @@ jobs: uses: actions/checkout@v5 with: fetch-depth: 0 - - + + - name: Set up Go + uses: actions/setup-go@v5 + with: + check-latest: true + cache: true + - name: Get commit message id: get_commit run: | @@ -55,13 +60,6 @@ jobs: with: fetch-depth: 0 - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version: "1.24.5" - check-latest: true - cache: true - - name: Install system dependencies (bc + docker) run: | sudo apt-get update -qq From 93880678491f206e9e2e9fb4caeda221c81e8367 Mon Sep 17 00:00:00 2001 From: Prachi Shivanand Anure Date: Wed, 17 Dec 2025 12:59:14 +0530 Subject: [PATCH 44/54] changed go version to 1.25.3 --- .github/workflows/release.yml | 1 + go.mod | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2623c5c4..4b964958 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,6 +27,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: + go-version: "1.25.3" check-latest: true cache: true diff --git a/go.mod b/go.mod index a38714ef..b4daea37 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/IBM/ibm-object-csi-driver -go 1.24.5 +go 1.25.3 require ( github.com/IBM/go-sdk-core/v5 v5.21.0 From 2b2c0d987c553779918a82170b6da30757c9184b Mon Sep 17 00:00:00 2001 From: Prachi Shivanand Anure Date: Wed, 17 Dec 2025 13:11:00 +0530 Subject: [PATCH 45/54] minor canges --- .github/workflows/release.yml | 11 ++--------- go.mod | 2 +- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4b964958..1b7f2217 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,12 +24,8 @@ jobs: with: fetch-depth: 0 - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version: "1.25.3" - check-latest: true - cache: true + - name: Print Go Version + run: go version - name: Get commit message id: get_commit @@ -117,9 +113,6 @@ jobs: - name: Checkout Code uses: actions/checkout@v5 - - name: Print Go Version - run: go version - - name: Initialize CodeQL uses: github/codeql-action/init@v3 with: diff --git a/go.mod b/go.mod index b4daea37..a38714ef 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/IBM/ibm-object-csi-driver -go 1.25.3 +go 1.24.5 require ( github.com/IBM/go-sdk-core/v5 v5.21.0 From 406067fe91d891af1ed028ac04aa161321724243 Mon Sep 17 00:00:00 2001 From: Prachi Shivanand Anure Date: Wed, 17 Dec 2025 13:34:33 +0530 Subject: [PATCH 46/54] minor canges --- .github/workflows/release.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1b7f2217..bd907d6a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -52,11 +52,6 @@ jobs: pull-requests: write # needed to comment on PRs steps: - - name: Checkout code - uses: actions/checkout@v5 - with: - fetch-depth: 0 - - name: Install system dependencies (bc + docker) run: | sudo apt-get update -qq @@ -110,9 +105,6 @@ jobs: APP_VERSION: 1.0.5 steps: - - name: Checkout Code - uses: actions/checkout@v5 - - name: Initialize CodeQL uses: github/codeql-action/init@v3 with: From cf5348ccdd695786307b29a348f62cd8cec3ebf6 Mon Sep 17 00:00:00 2001 From: Prachi Shivanand Anure Date: Wed, 17 Dec 2025 13:37:29 +0530 Subject: [PATCH 47/54] minor canges --- .github/workflows/release.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bd907d6a..1b7f2217 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -52,6 +52,11 @@ jobs: pull-requests: write # needed to comment on PRs steps: + - name: Checkout code + uses: actions/checkout@v5 + with: + fetch-depth: 0 + - name: Install system dependencies (bc + docker) run: | sudo apt-get update -qq @@ -105,6 +110,9 @@ jobs: APP_VERSION: 1.0.5 steps: + - name: Checkout Code + uses: actions/checkout@v5 + - name: Initialize CodeQL uses: github/codeql-action/init@v3 with: From 62e52926849e161667e788e85b54cb9e0c9dda7c Mon Sep 17 00:00:00 2001 From: Prachi Shivanand Anure Date: Wed, 17 Dec 2025 14:00:11 +0530 Subject: [PATCH 48/54] minor canges --- .github/workflows/release.yml | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1b7f2217..efdd1c6f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,11 +19,6 @@ jobs: should_release: ${{ steps.check_release.outputs.should_release }} steps: - - name: Checkout code - uses: actions/checkout@v5 - with: - fetch-depth: 0 - - name: Print Go Version run: go version @@ -118,9 +113,9 @@ jobs: with: languages: "go" - - name: Run Unit Tests for cos csi mounter - run: sudo make ut-coverage -C ${{ matrix.package_dir }} - + - name: Run Unit Tests for entire repo + run: | + sudo make ut-coverage - name: Build Debian and RPM packages for cos-csi-mounter systemd service run: | cd ${{ matrix.package_dir }} From 06d2fe4415530d31063efa73d461bae84819cf03 Mon Sep 17 00:00:00 2001 From: Prachi Shivanand Anure Date: Wed, 17 Dec 2025 14:03:35 +0530 Subject: [PATCH 49/54] minor canges --- .github/workflows/release.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index efdd1c6f..500b5d88 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -113,9 +113,6 @@ jobs: with: languages: "go" - - name: Run Unit Tests for entire repo - run: | - sudo make ut-coverage - name: Build Debian and RPM packages for cos-csi-mounter systemd service run: | cd ${{ matrix.package_dir }} From 2ac127da46ccb30dc592b040a0d718c95bf010cf Mon Sep 17 00:00:00 2001 From: Prachi Shivanand Anure Date: Wed, 17 Dec 2025 14:07:13 +0530 Subject: [PATCH 50/54] minor canges --- .github/workflows/release.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 500b5d88..19052402 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,6 +19,11 @@ jobs: should_release: ${{ steps.check_release.outputs.should_release }} steps: + - name: Checkout Code + uses: actions/checkout@v5 + with: + fetch-depth: 0 + - name: Print Go Version run: go version From b4c22cdb5886473b0a565ee4c72ca53ecae546f4 Mon Sep 17 00:00:00 2001 From: Prachi Shivanand Anure Date: Wed, 17 Dec 2025 15:57:58 +0530 Subject: [PATCH 51/54] minor canges --- .github/workflows/release.yml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 19052402..681af247 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -137,16 +137,6 @@ jobs: run: | echo "Commit Message: ${{ steps.check_commit.outputs.message }}" - - name: Check Commit Message for Release Trigger - id: check_commit_condition - run: | - echo "Commit Message: ${{ steps.check_commit.outputs.message }}" - if [[ "${{ steps.check_commit.outputs.message }}" == *"release"* ]]; then - echo "Release job triggered" - else - echo "No 'release' keyword found in the commit message. Skipping release job." - exit 0 # Exit early to skip the release job - fi - name: Latest Version (Tag and Release) if: success() From 79d49252c58713472dbadbd290c559e1e29189d0 Mon Sep 17 00:00:00 2001 From: Prachi Shivanand Anure Date: Wed, 17 Dec 2025 16:16:32 +0530 Subject: [PATCH 52/54] minor canges --- .github/workflows/release.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 681af247..d53c3af2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -36,12 +36,12 @@ jobs: - name: Check if release should be triggered id: check_release run: | - if [[ "${{ steps.get_commit.outputs.message }}" == *"release"* ]]; then + if [[ "${{ steps.get_commit.outputs.message }}" == *"publish"* ]]; then echo "should_release=true" >> "$GITHUB_OUTPUT" - echo "Release will be triggered (found 'release' in commit message)" + echo "Publish will be triggered (found 'publish' in commit message)" else echo "should_release=false" >> "$GITHUB_OUTPUT" - echo "Release will NOT be triggered (no 'release' in commit message)" + echo "Publish will NOT be triggered (no 'publish' in commit message)" fi build-and-test: @@ -95,7 +95,7 @@ jobs: ./scripts/publishCoverage.sh release: - needs: [common-setup, build-and-test] + needs: common-setup if: needs.common-setup.outputs.should_release == 'true' permissions: write-all runs-on: ubuntu-latest From 599194bae8ddb50f2ec97bbb8eaf2bd7aa07b7e0 Mon Sep 17 00:00:00 2001 From: Ashima-Ashima1 Date: Thu, 18 Dec 2025 12:44:47 +0530 Subject: [PATCH 53/54] minor changes Signed-off-by: Ashima-Ashima1 --- .github/workflows/release.yml | 1 + .pre-commit-config.yaml | 2 +- .secrets.baseline | 12 ++++++------ cos-csi-mounter/Makefile | 8 -------- 4 files changed, 8 insertions(+), 15 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d53c3af2..e71f61d0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -154,5 +154,6 @@ jobs: ## 🚀 What’s New - Fix for rclone mount hang issue prerelease: ${{ env.IS_LATEST_RELEASE != 'true' }} + - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v3 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 91079242..086affc6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,7 +11,7 @@ repos: # You are encouraged to use static refs such as tags, instead of branch name # # Running "pre-commit autoupdate" would automatically updates rev to latest tag - rev: 0.13.1+ibm.62.dss + rev: 0.13.1+ibm.64.dss hooks: - id: detect-secrets # pragma: whitelist secret # Add options for detect-secrets-hook binary. You can run `detect-secrets-hook --help` to list out all possible options. diff --git a/.secrets.baseline b/.secrets.baseline index 4519fb7b..56552985 100644 --- a/.secrets.baseline +++ b/.secrets.baseline @@ -3,7 +3,7 @@ "files": "go.sum|^.secrets.baseline$", "lines": null }, - "generated_at": "2025-09-05T07:59:11Z", + "generated_at": "2025-12-18T07:14:31Z", "plugins_used": [ { "name": "AWSKeyDetector" @@ -126,14 +126,14 @@ { "hashed_secret": "a1f0e99af8b76b514ef9e6a174e9c79970332082", "is_verified": false, - "line_number": 174, + "line_number": 176, "type": "Secret Keyword", "verified_result": null }, { "hashed_secret": "b732fb611fd46a38e8667f9972e0cde777fbe37f", "is_verified": false, - "line_number": 177, + "line_number": 179, "type": "Secret Keyword", "verified_result": null }, @@ -172,7 +172,7 @@ { "hashed_secret": "7e6a3680012346b94b54731e13d8a9ffa3790645", "is_verified": false, - "line_number": 239, + "line_number": 248, "type": "Secret Keyword", "verified_result": null } @@ -227,7 +227,7 @@ { "hashed_secret": "2e7a7ee14caebf378fc32d6cf6f557f347c96773", "is_verified": false, - "line_number": 31, + "line_number": 45, "type": "Secret Keyword", "verified_result": null } @@ -294,7 +294,7 @@ } ] }, - "version": "0.13.1+ibm.62.dss", + "version": "0.13.1+ibm.64.dss", "word_list": { "file": null, "hash": null diff --git a/cos-csi-mounter/Makefile b/cos-csi-mounter/Makefile index 4ec174d7..55da3103 100644 --- a/cos-csi-mounter/Makefile +++ b/cos-csi-mounter/Makefile @@ -18,14 +18,6 @@ RPM_ARCH := x86_64 RPM_RELEASE_NUM := 1 REDHAT_SPEC := $(BUILD_DIR)/red-hat.spec -test: - go test -v -timeout 1800s -coverprofile=cover.out ./... - go tool cover -html=cover.out -o=cover.html - -ut-coverage: test - @./scripts/coverage.sh - rm cover.html cover.out - build-linux: CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -mod mod -o ${BIN_DIR}/cos-csi-mounter-server -ldflags "-s -w -X main.Version=$(APP_VERSION) -X main.GitCommit=$$(git rev-parse HEAD)" -a ./server ./${BIN_DIR}/cos-csi-mounter-server version From 5858c3c8b0e725e8cffc8679ee31ff3292e07cb8 Mon Sep 17 00:00:00 2001 From: Ashima <87809402+ashimagarg27@users.noreply.github.com> Date: Thu, 18 Dec 2025 13:03:35 +0530 Subject: [PATCH 54/54] Fix to build debian and rpm pkg (#287) * test-debian/rpm pkg creation Signed-off-by: Ashima-Ashima1 * publish 0.2.6 Signed-off-by: Ashima-Ashima1 * publish 0.2.6 Signed-off-by: Ashima-Ashima1 * revert versions Signed-off-by: Ashima-Ashima1 * minor changes Signed-off-by: Ashima-Ashima1 --------- Signed-off-by: Ashima-Ashima1 --- .github/workflows/release.yml | 39 ++++++++++++++--------------------- .secrets.baseline | 2 +- 2 files changed, 17 insertions(+), 24 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e71f61d0..fda02cad 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,27 +21,33 @@ jobs: steps: - name: Checkout Code uses: actions/checkout@v5 - with: - fetch-depth: 0 - name: Print Go Version run: go version - - name: Get commit message - id: get_commit - run: | + - name: Get last commit message + id: check_commit + run: | message=$(git log -1 --pretty=%B) + message="${message//'%'/'%25'}" # Escape '%' + message="${message//$'\n'/'%0A'}" # Escape newlines + message="${message//$'\r'/'%0D'}" # Escape carriage returns echo "message=$message" >> "$GITHUB_OUTPUT" + shell: bash + + - name: Check Commit Message + run: | + echo "Commit Message: ${{ steps.check_commit.outputs.message }}" - name: Check if release should be triggered id: check_release run: | - if [[ "${{ steps.get_commit.outputs.message }}" == *"publish"* ]]; then + if [[ "${{ steps.check_commit.outputs.message }}" == *"publish"* ]]; then echo "should_release=true" >> "$GITHUB_OUTPUT" - echo "Publish will be triggered (found 'publish' in commit message)" + echo "Debian/RPM packages will be created" else echo "should_release=false" >> "$GITHUB_OUTPUT" - echo "Publish will NOT be triggered (no 'publish' in commit message)" + echo "Debian/RPM packages will not be created" fi build-and-test: @@ -123,21 +129,6 @@ jobs: cd ${{ matrix.package_dir }} make packages - - name: Get last commit message - id: check_commit - run: | - message=$(git log -1 --pretty=%B) - message="${message//'%'/'%25'}" # Escape '%' - message="${message//$'\n'/'%0A'}" # Escape newlines - message="${message//$'\r'/'%0D'}" # Escape carriage returns - echo "message=$message" >> "$GITHUB_OUTPUT" - shell: bash - - - name: Check Commit Message - run: | - echo "Commit Message: ${{ steps.check_commit.outputs.message }}" - - - name: Latest Version (Tag and Release) if: success() id: release @@ -153,6 +144,8 @@ jobs: body: | ## 🚀 What’s New - Fix for rclone mount hang issue + - Add support for s3fs disable_noobj_cache flag + - Skip unmount for 'is not a mountpoint' error prerelease: ${{ env.IS_LATEST_RELEASE != 'true' }} - name: Perform CodeQL Analysis diff --git a/.secrets.baseline b/.secrets.baseline index 56552985..675075a7 100644 --- a/.secrets.baseline +++ b/.secrets.baseline @@ -3,7 +3,7 @@ "files": "go.sum|^.secrets.baseline$", "lines": null }, - "generated_at": "2025-12-18T07:14:31Z", + "generated_at": "2025-12-18T07:17:56Z", "plugins_used": [ { "name": "AWSKeyDetector"