-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #360 from openebs/nix-fixes
build(nix-shell): add missing lvm packages to pure nix-shell Adds lvm2 and jq Also ensure sudo works in a pure shell Signed-off-by: Tiago Castro <[email protected]> --- test: cleanup ginkgo loop vgs gingko lvm_utils creates some loop devices and vgs, which are not cleanup in some cases (eg: test failures). furthermore, even between test cases, leftovers are causing subsequent tests to fails, but that's another matter that needs fixing. also ensure make clean cleans these up Signed-off-by: Tiago Castro <[email protected]> --- test: default namespace and set image pull policy Ensure the namespace is always set correctly to openebs by default. Set the image pull policy properly (wrong var was used...) Signed-off-by: Tiago Castro <[email protected]> --- build(nix-shell): use musl libc and static build The non-buildx Dockerfile copies a binary built outside of the docker build, which may be broken if the dependencies are not met. This happens on nix-shell as the deps exist on /nix/store. Get around this by building static binaries in the nix-shell. We now depend on golang-alpine image and install musl-dev as well. Signed-off-by: Tiago Castro <[email protected]> --- build: a number of fixes on Makefile and nix-shell Pin a few packages version which are not compatible on latest. Perhaps all of them should be pinned! Remove a few uses of sudo which should not be required? Add a few packages missing from nix-shell Allow make clean to work properly Don't bootstrap by default, though this may be discussed further. Setup goenv env variables on github actions workflows Add gitignore for the coverage data Signed-off-by: Tiago Castro <[email protected]> --- refactor: deal with shellcheck A lot of issues on the existing code but seems they are only warned if the file is modified...
- Loading branch information
Showing
11 changed files
with
127 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,4 @@ tags | |
*.idea | ||
*.test | ||
coverage.txt | ||
/tests/bdd_coverage.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,10 +10,10 @@ VETARGS?=-asmdecl -atomic -bool -buildtags -copylocks -methods \ | |
EXTERNAL_TOOLS=\ | ||
golang.org/x/tools/cmd/cover \ | ||
golang.org/x/lint/golint \ | ||
github.com/axw/gocov/gocov \ | ||
github.com/axw/gocov/gocov@v1.1 \ | ||
github.com/matm/gocov-html/cmd/gocov-html \ | ||
github.com/onsi/ginkgo/ginkgo \ | ||
github.com/onsi/gomega/... | ||
github.com/onsi/gomega/...@v1.35 | ||
|
||
# The images can be pushed to any docker/image registeries | ||
# like docker hub, quay. The registries are specified in | ||
|
@@ -86,6 +86,9 @@ clean: | |
@echo "--> Cleaning Directory" ; | ||
go clean -testcache | ||
rm -rf bin | ||
CLEANUP_ONLY=1 ./ci/ci-test.sh | ||
chmod -R u+w ${GOPATH}/bin/${CSI_DRIVER} 2>/dev/null || true | ||
chmod -R u+w ${GOPATH}/pkg/* 2>/dev/null || true | ||
rm -rf ${GOPATH}/bin/${CSI_DRIVER} | ||
rm -rf ${GOPATH}/pkg/* | ||
|
||
|
@@ -119,7 +122,10 @@ verify-deps: deps | |
bootstrap: controller-gen install-golangci-lint | ||
@for tool in $(EXTERNAL_TOOLS) ; do \ | ||
echo "+ Installing $$tool" ; \ | ||
cd && GO111MODULE=on go install $$tool@latest; \ | ||
if ! echo $$tool | grep "@"; then \ | ||
tool=$$tool@latest ; \ | ||
fi ; \ | ||
GO111MODULE=on go install $$tool; \ | ||
done | ||
|
||
## golangci-lint tool used to check linting tools in codebase | ||
|
@@ -130,11 +136,11 @@ bootstrap: controller-gen install-golangci-lint | |
## Install golangci-lint only if tool doesn't exist in system | ||
.PHONY: install-golangci-lint | ||
install-golangci-lint: | ||
$(if $(shell which golangci-lint), echo "golangci-lint already exist in system", (curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sudo sh -s -- -b "${GOPATH}/bin" v1.56.2)) | ||
$(if $(shell which golangci-lint), echo "golangci-lint already exist in system", (curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b "${GOPATH}/bin" v1.56.2)) | ||
|
||
.PHONY: controller-gen | ||
controller-gen: | ||
TMP_DIR=$(shell mktemp -d) && cd $$TMP_DIR && go mod init tmp && go install sigs.k8s.io/controller-tools/cmd/[email protected] && rm -rf $$TMP_DIR; | ||
@go install -mod=mod sigs.k8s.io/controller-tools/cmd/[email protected] | ||
|
||
# SRC_PKG is the path of code files | ||
SRC_PKG := github.com/openebs/lvm-localpv/pkg | ||
|
@@ -222,16 +228,9 @@ lvm-driver-image: lvm-driver | |
@echo "+ Generating ${CSI_DRIVER} image" | ||
@echo "--------------------------------" | ||
@cp bin/${CSI_DRIVER}/${CSI_DRIVER} buildscripts/${CSI_DRIVER}/ | ||
cd buildscripts/${CSI_DRIVER} && sudo docker build -t ${IMAGE_ORG}/${CSI_DRIVER}:${IMAGE_TAG} ${DBUILD_ARGS} . && sudo docker tag ${IMAGE_ORG}/${CSI_DRIVER}:${IMAGE_TAG} quay.io/${IMAGE_ORG}/${CSI_DRIVER}:${IMAGE_TAG} | ||
cd buildscripts/${CSI_DRIVER} && docker build -t ${IMAGE_ORG}/${CSI_DRIVER}:${IMAGE_TAG} ${DBUILD_ARGS} . && docker tag ${IMAGE_ORG}/${CSI_DRIVER}:${IMAGE_TAG} quay.io/${IMAGE_ORG}/${CSI_DRIVER}:${IMAGE_TAG} | ||
@rm buildscripts/${CSI_DRIVER}/${CSI_DRIVER} | ||
|
||
.PHONY: ansible-runner-image | ||
ansible-runner-image: | ||
@echo "------------------" | ||
@echo "--> Build ansible-runner image for lvm-localpv e2e-tests" | ||
@echo "------------------" | ||
sudo docker build . -f e2e-tests/Dockerfile -t ${IMAGE_ORG}/lvm-localpv-e2e:ci | ||
|
||
.PHONY: ci | ||
ci: | ||
@echo "--> Running ci test"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
.go/ | ||
.tmp/ | ||
/bins/ |
Oops, something went wrong.