Skip to content

Commit

Permalink
feat(deps): Bump golang, k8s and lib-csi versions (#444)
Browse files Browse the repository at this point in the history
- go: 1.19.9
- k8s: v1.27.2
- klog: v2
- lib-csi: v0.7.0

Signed-off-by: shubham <[email protected]>
  • Loading branch information
shubham14bajpai authored May 28, 2023
1 parent ef61a51 commit c0343d0
Show file tree
Hide file tree
Showing 3,102 changed files with 798 additions and 1,149,218 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
reporter: github-pr-review
path: '.'
pattern: '*.sh'
exclude: './.git/*,./vendor/*'
exclude: './.git/*'


unit-test:
Expand Down Expand Up @@ -74,10 +74,10 @@ jobs:
truncate -s 100G /tmp/disk.img
sudo zpool create zfspv-pool `sudo losetup -f /tmp/disk.img --show`
- name: Set up Go 1.16
- name: Set up Go 1.19
uses: actions/setup-go@v2
with:
go-version: 1.16.5
go-version: 1.19.9

- name: Setup Minikube-Kubernetes
uses: manusa/[email protected]
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ jobs:
reporter: github-pr-review
path: '.'
pattern: '*.sh'
exclude: './vendor/*'


unit-test:
Expand Down Expand Up @@ -74,15 +73,15 @@ jobs:
truncate -s 100G /tmp/disk.img
sudo zpool create zfspv-pool `sudo losetup -f /tmp/disk.img --show`
- name: Set up Go 1.16
- name: Set up Go 1.19
uses: actions/setup-go@v2
with:
go-version: 1.16.5
go-version: 1.19.9

- name: Setup Minikube-Kubernetes
uses: manusa/[email protected]
with:
minikube version: v1.30.1
minikube version: 'v1.26.1'
kubernetes version: ${{ matrix.kubernetes }}
github token: ${{ secrets.GITHUB_TOKEN }}

Expand Down
19 changes: 9 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
# limitations under the License.

# list only csi source code directories
PACKAGES = $(shell go list ./... | grep -v 'vendor\|pkg/generated')
PACKAGES = $(shell go list ./... | grep -v 'pkg/generated')

UNIT_TEST_PACKAGES = $(shell go list ./... | grep -v 'vendor\|pkg/generated\|tests')
UNIT_TEST_PACKAGES = $(shell go list ./... | grep -v 'pkg/generated\|tests')

# Lint our code. Reference: https://golang.org/cmd/vet/
VETARGS?=-asmdecl -atomic -bool -buildtags -copylocks -methods \
Expand All @@ -31,7 +31,6 @@ EXTERNAL_TOOLS=\
github.com/onsi/ginkgo/ginkgo \
github.com/onsi/gomega/...


# The images can be pushed to any docker/image registeries
# like docker hub, quay. The registries are specified in
# the `build/push` script.
Expand Down Expand Up @@ -137,12 +136,12 @@ vendor: go.mod go.sum deps
bootstrap: controller-gen
@for tool in $(EXTERNAL_TOOLS) ; do \
echo "+ Installing $$tool" ; \
cd && GO111MODULE=on go get $$tool; \
cd && GO111MODULE=on go install -mod=mod $$tool@latest; \
done

.PHONY: controller-gen
controller-gen:
TMP_DIR=$(shell mktemp -d) && cd $$TMP_DIR && go mod init tmp && go get sigs.k8s.io/controller-tools/cmd/[email protected] && rm -rf $$TMP_DIR;
TMP_DIR=$(shell mktemp -d) && cd $$TMP_DIR && go mod init tmp && go install -mod=mod sigs.k8s.io/controller-tools/cmd/[email protected] && rm -rf $$TMP_DIR;

# SRC_PKG is the path of code files
SRC_PKG := github.com/openebs/zfs-localpv/pkg
Expand All @@ -161,7 +160,7 @@ kubegendelete:

.PHONY: deepcopy-install
deepcopy-install:
@go install -mod=vendor ./vendor/k8s.io/code-generator/cmd/deepcopy-gen
@go install -mod=mod k8s.io/code-generator/cmd/deepcopy-gen

.PHONY: deepcopy
deepcopy:
Expand All @@ -173,7 +172,7 @@ deepcopy:

.PHONY: clientset-install
clientset-install:
@go install -mod=vendor ./vendor/k8s.io/code-generator/cmd/client-gen
@go install -mod=mod k8s.io/code-generator/cmd/client-gen

.PHONY: clientset
clientset:
Expand All @@ -187,7 +186,7 @@ clientset:

.PHONY: lister-install
lister-install:
@go install -mod=vendor ./vendor/k8s.io/code-generator/cmd/lister-gen
@go install -mod=mod k8s.io/code-generator/cmd/lister-gen

.PHONY: lister
lister:
Expand All @@ -199,7 +198,7 @@ lister:

.PHONY: informer-install
informer-install:
@go install -mod=vendor ./vendor/k8s.io/code-generator/cmd/informer-gen
@go install -mod=mod k8s.io/code-generator/cmd/informer-gen

.PHONY: informer
informer:
Expand Down Expand Up @@ -263,7 +262,7 @@ golint:
.PHONY: license-check
license-check:
@echo "--> Checking license header..."
@licRes=$$(for file in $$(find . -type f -regex '.*\.sh\|.*\.go\|.*Docker.*\|.*\Makefile*' ! -path './vendor/*' ) ; do \
@licRes=$$(for file in $$(find . -type f -regex '.*\.sh\|.*\.go\|.*Docker.*\|.*\Makefile*') ; do \
awk 'NR<=5' $$file | grep -Eq "(Copyright|generated|GENERATED)" || echo $$file; \
done); \
if [ -n "$${licRes}" ]; then \
Expand Down
46 changes: 23 additions & 23 deletions buildscripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,22 @@ DIR="$( cd -P "$( dirname "$SOURCE" )/../" && pwd )"
cd "$DIR"

# Get the git commit
if [ -f $GOPATH/src/github.com/openebs/zfs-localpv/GITCOMMIT ];
if [ -f "$GOPATH"/src/github.com/openebs/zfs-localpv/GITCOMMIT ];
then
GIT_COMMIT="$(cat $GOPATH/src/github.com/openebs/zfs-localpv/GITCOMMIT)"
GIT_COMMIT=$(cat "$GOPATH"/src/github.com/openebs/zfs-localpv/GITCOMMIT)
else
GIT_COMMIT="$(git rev-parse HEAD)"
fi

# Set BUILDMETA based on travis tag
if [[ -n "$RELEASE_TAG" ]] && [[ $RELEASE_TAG != *"RC"* ]]; then
if [[ -n "$RELEASE_TAG" ]] && [[ "$RELEASE_TAG" != *"RC"* ]]; then
echo "released" > BUILDMETA
fi

CURRENT_BRANCH=""
if [ -z ${BRANCH} ];
if [ -z "${BRANCH}" ];
then
CURRENT_BRANCH=$(git branch | grep \* | cut -d ' ' -f2)
CURRENT_BRANCH=$(git branch | grep '\*' | cut -d ' ' -f2)
else
CURRENT_BRANCH=${BRANCH}
fi
Expand All @@ -49,19 +49,18 @@ fi
if [ -n "$RELEASE_TAG" ]; then
VERSION="$RELEASE_TAG"
else
BUILDDATE=`date +%m-%d-%Y`
BUILDDATE="$(date +%m-%d-%Y)"
SHORT_COMMIT="$(git rev-parse --short HEAD)"
VERSION="$CURRENT_BRANCH-$SHORT_COMMIT:$BUILDDATE"
fi

echo -e "\nbuilding the ZFS Driver version :- $VERSION\n"

VERSION_META="$(cat $PWD/BUILDMETA)"
VERSION_META=$(cat "$PWD/BUILDMETA")

# Determine the arch/os combos we're building for
UNAME=$(uname)
ARCH=$(uname -m)
if [ "$UNAME" != "Linux" -a "$UNAME" != "Darwin" ] ; then
if [ "$UNAME" != "Linux" ] && [ "$UNAME" != "Darwin" ] ; then
echo "Sorry, this OS is not supported yet."
exit 1
fi
Expand All @@ -80,8 +79,8 @@ fi

# Delete the old dir
echo "==> Removing old directory..."
rm -rf bin/${PNAME}/*
mkdir -p bin/${PNAME}/
rm -rf bin/"$PNAME"/*
mkdir -p bin/"$PNAME"/

XC_OS=$(go env GOOS)
XC_ARCH=$(go env GOARCH)
Expand All @@ -91,17 +90,17 @@ echo "==> Building ${CTLNAME} using $(go version)... "

GOOS="${XC_OS}"
GOARCH="${XC_ARCH}"
output_name="bin/${PNAME}/"$GOOS"_"$GOARCH"/"$CTLNAME
output_name=bin/"$PNAME"/"$GOOS"_"$GOARCH"/$CTLNAME

if [ $GOOS = "windows" ]; then
if [ "$GOOS" = "windows" ]; then
output_name+='.exe'
fi
env GOOS=$GOOS GOARCH=$GOARCH go build -ldflags \
env GOOS="$GOOS" GOARCH="$GOARCH" CGO_ENABLED=0 go build -mod=mod -ldflags \
"-X github.com/openebs/zfs-localpv/pkg/version.GitCommit=${GIT_COMMIT} \
-X main.CtlName='${CTLNAME}' \
-X github.com/openebs/zfs-localpv/pkg/version.Version=${VERSION} \
-X github.com/openebs/zfs-localpv/pkg/version.VersionMeta=${VERSION_META}"\
-o $output_name\
-o "$output_name"\
./cmd

echo ""
Expand All @@ -110,24 +109,25 @@ echo ""
GOPATH=${GOPATH:-$(go env GOPATH)}
case $(uname) in
CYGWIN*)
GOPATH="$(cygpath $GOPATH)"
GOPATH=$(cygpath "$GOPATH")
;;
esac
OLDIFS=$IFS
IFS=: MAIN_GOPATH=($GOPATH)
IFS=: MAIN_GOPATH="$GOPATH"
IFS=$OLDIFS

# Create the gopath bin if not already available
mkdir -p ${MAIN_GOPATH}/bin/
mkdir -p "${MAIN_GOPATH}"/bin/

# Copy our OS/Arch to the bin/ directory
DEV_PLATFORM="./bin/${PNAME}/$(go env GOOS)_$(go env GOARCH)"
for F in $(find ${DEV_PLATFORM} -mindepth 1 -maxdepth 1 -type f); do
cp ${F} bin/${PNAME}/
cp ${F} ${MAIN_GOPATH}/bin/
DEV_PLATFORM=./bin/"${PNAME}"/$(go env GOOS)_$(go env GOARCH)
find "${DEV_PLATFORM}" -mindepth 1 -maxdepth 1 -type f -print0 | while IFS= read -r -d '' file
do
cp "$file" bin/"${PNAME}"/
cp "$file" "${MAIN_GOPATH}"/bin/
done

# Done!
echo
echo "==> Results:"
ls -hl bin/${PNAME}/
ls -hl bin/"${PNAME}"/
2 changes: 1 addition & 1 deletion buildscripts/test-cov.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
set -e
echo "" > coverage.txt

for d in $(go list ./... | grep -v 'vendor\|pkg/apis\|pkg/generated\|tests'); do
for d in $(go list ./... | grep -v 'pkg/apis\|pkg/generated\|tests'); do
#TODO - Include -race while creating the coverage profile.
go test -coverprofile=profile.out -covermode=atomic $d
if [ -f profile.out ]; then
Expand Down
2 changes: 1 addition & 1 deletion buildscripts/zfs-driver/zfs-driver.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM golang:1.14.7 as build
FROM golang:1.19.9 as build

ARG BRANCH
ARG RELEASE_TAG
Expand Down
2 changes: 1 addition & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
"github.com/openebs/zfs-localpv/pkg/version"
zfs "github.com/openebs/zfs-localpv/pkg/zfs"
"github.com/spf13/cobra"
"k8s.io/klog"
"k8s.io/klog/v2"
)

/*
Expand Down
Loading

0 comments on commit c0343d0

Please sign in to comment.