Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove v1 client and pkg code #252

Merged
merged 3 commits into from
Oct 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 0 additions & 10 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,8 @@ jobs:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v2
- name: Build
run: |
go build -v -a -o ./bin/csi-proxy.exe ./cmd/csi-proxy
- name: Run Windows Integration Tests
run: |
# start the CSI Proxy before running tests on windows
Start-Job -Name CSIProxy -ScriptBlock {
.\bin\csi-proxy.exe
};
Start-Sleep -Seconds 30;
Write-Output "getting named pipes"
[System.IO.Directory]::GetFiles("\\.\\pipe\\")
$env:CSI_PROXY_GH_ACTIONS="TRUE"
go test -v -race ./integrationtests/...
unit_tests:
Expand Down
48 changes: 4 additions & 44 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
CMDS=csi-proxy
all: build test
all: test

# include release tools for building binary and testing targets
include release-tools/build.make
Expand All @@ -10,42 +9,6 @@ REPO_ROOT = $(CURDIR)
BUILD_DIR = bin
BUILD_TOOLS_DIR = $(BUILD_DIR)/tools
GO_ENV_VARS = GO111MODULE=on GOOS=windows
CSI_PROXY_API_GEN = $(BUILD_DIR)/csi-proxy-api-gen

.PHONY: compile-csi-proxy-api-gen
compile-csi-proxy-api-gen:
GO111MODULE=on go build -o $(CSI_PROXY_API_GEN) ./cmd/csi-proxy-api-gen

.PHONY: generate
generate: generate-protobuf generate-csi-proxy-api-gen

# using xargs instead of -exec since the latter doesn't propagate exit statuses
.PHONY: generate-protobuf
generate-protobuf:
@ if ! which protoc > /dev/null 2>&1; then echo 'Unable to find protoc binary' ; exit 1; fi
@ generate_protobuf_for() { \
local FILE="$$1"; \
local FILE_DIR="$$(dirname "$(GOPATH)/$$FILE")"; \
echo "Generating protobuf file from $$FILE in $$FILE_DIR"; \
protoc -I "$(GOPATH)/src/" -I '$(REPO_ROOT)/client/api' "$$FILE" --go_out=plugins="grpc:$(GOPATH)/src"; \
} ; \
export -f generate_protobuf_for; \
find '$(REPO_ROOT)' -not -path './vendor/*' -name '*.proto' | sed -e "s|$(GOPATH)/src/||g" | xargs -n1 '$(SHELL)' -c 'generate_protobuf_for "$$0"'

.PHONY: generate-csi-proxy-api-gen
generate-csi-proxy-api-gen: compile-csi-proxy-api-gen
$(CSI_PROXY_API_GEN) -i github.com/kubernetes-csi/csi-proxy/client/api,github.com/kubernetes-csi/csi-proxy/integrationtests/apigroups/api/dummy --v=8

.PHONY: clean
clean: clean-protobuf clean-generated

.PHONY: clean-protobuf
clean-protobuf:
find '$(REPO_ROOT)' -name '*.proto' -exec '$(SHELL)' -c 'rm -vf "$$(dirname {})/$$(basename {} .proto).pb.go"' \;

.PHONY: clean-generated
clean-generated:
find '$(REPO_ROOT)' -name '*_generated.go' -exec '$(SHELL)' -c '[[ "$$(head -n 1 "{}")" == "// Code generated by csi-proxy-api-gen"* ]] && rm -v {}' \;

# see https://github.com/golangci/golangci-lint/releases
GOLANGCI_LINT_VERSION = v1.21.0
Expand All @@ -60,17 +23,14 @@ lint: $(GOLANGCI_LINT)
test: test-go
test-go:
@ echo; echo "### $@:"
# TODO: After issue https://github.com/microsoft/go-winio/pull/169 is resolved, remove the filter on the test path.
GO111MODULE=on go test `find ./internal/server/ -type d -not -name server`;\
cd client && GO111MODULE=on go test `go list ./... | grep -v group` && cd ../
@ echo "No need to run test. Testing is done in GitHub Actions and custom Prow job."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is ok and not worth it to set additional infra for this to work given that we already have other jobs that are running the tests we want:

  • integration tests are run in Prow (pull-kubernetes-csi-csi-proxy-integration)
  • unit tests are run in Windows Tests / unit_tests (1.16, windows-latest) (pull_request)


.PHONY: test-vet
test: test-vet
test-vet:
@ echo; echo "### $@:"
# TODO: After issue https://github.com/microsoft/go-winio/pull/169 is resolved, remove the filter on the test path.
# GO111MODULE=on go vet `find ./internal/server/ -type d -not -name server`;\
cd client && GO111MODULE=on go vet `go list ./... | grep -v group` && cd ../
@ echo "No need to run vet. Testing is done in GitHub Actions and custom Prow job."

# see https://github.com/golangci/golangci-lint#binary-release
$(GOLANGCI_LINT):
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b "$$(dirname '$(GOLANGCI_LINT)')" '$(GOLANGCI_LINT_VERSION)'
202 changes: 0 additions & 202 deletions client/LICENSE

This file was deleted.

5 changes: 0 additions & 5 deletions client/README.md

This file was deleted.

Loading