Skip to content

Commit

Permalink
vendor
Browse files Browse the repository at this point in the history
Signed-off-by: Zbynek Roubalik <zroubalik@gmail.com>
  • Loading branch information
zroubalik committed Nov 9, 2022
1 parent 971ab94 commit cfa7bb9
Show file tree
Hide file tree
Showing 42 changed files with 65 additions and 343 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ apiserver.local.config/
# VSCode specific files
.vscode

# GO Vendor
vendor
cover.out

# GO debug binary
Expand Down
4 changes: 4 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ run:
- e2e
# timeout for analysis, e.g. 30s, 5m, default is 1m
timeout: 10m
# skip vendor directory
skip-dirs:
- vendor
modules-download-mode: vendor
linters:
# please, do not use `enable-all`: it's deprecated and will be removed soon.
# inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint
Expand Down
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
default_stages: [commit, push]
minimum_pre_commit_version: "1.20.0"
exclude: ^vendor/
repos:
- repo: https://github.com/dnephin/pre-commit-golang
rev: v0.3.5
Expand Down
5 changes: 1 addition & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ WORKDIR /workspace
# Copy the Go Modules manifests
COPY go.mod go.mod
COPY go.sum go.sum
# cache deps before building and copying source so that we don't need to re-download as much
# and so that source changes don't invalidate our downloaded layer
RUN go mod download

COPY Makefile Makefile

# Copy the go source
Expand All @@ -24,6 +20,7 @@ COPY adapter/ adapter/
COPY apis/ apis/
COPY controllers/ controllers/
COPY pkg/ pkg/
COPY vendor/ vendor/

# Build
# https://www.docker.com/blog/faster-multi-platform-builds-dockerfile-cross-compilation-guide/
Expand Down
5 changes: 2 additions & 3 deletions Dockerfile.adapter
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ WORKDIR /workspace
# Copy the Go Modules manifests
COPY go.mod go.mod
COPY go.sum go.sum
# cache deps before building and copying source so that we don't need to re-download as much
# and so that source changes don't invalidate our downloaded layer
RUN go mod download


COPY Makefile Makefile

Expand All @@ -24,6 +22,7 @@ COPY adapter/ adapter/
COPY apis/ apis/
COPY controllers/ controllers/
COPY pkg/ pkg/
COPY vendor/ vendor/

RUN mkdir -p /apiserver.local.config/certificates && chmod -R 777 /apiserver.local.config

Expand Down
18 changes: 8 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -144,14 +144,10 @@ golangci: ## Run golangci against code.
golangci-lint run

clientset-verify: ## Verify that generated client-go clientset, listers and informers are up to date.
go mod vendor
./hack/verify-codegen.sh
rm -rf vendor

clientset-generate: ## Generate client-go clientset, listers and informers.
go mod vendor
./hack/update-codegen.sh
rm -rf vendor

# Generate Liiklus proto
pkg/scalers/liiklus/LiiklusService.pb.go: protoc-gen-go
Expand All @@ -172,10 +168,12 @@ pkg/mock/mock_scaling/mock_interface.go: pkg/scaling/scale_handler.go
$(MOCKGEN) -destination=$@ -package=mock_scaling -source=$^
pkg/mock/mock_scaler/mock_scaler.go: pkg/scalers/scaler.go
$(MOCKGEN) -destination=$@ -package=mock_scalers -source=$^
pkg/mock/mock_scale/mock_interfaces.go: $(shell go list -mod=readonly -f '{{ .Dir }}' -m k8s.io/client-go)/scale/interfaces.go
$(MOCKGEN) -destination=$@ -package=mock_scale -source=$^
pkg/mock/mock_client/mock_interfaces.go: $(shell go list -mod=readonly -f '{{ .Dir }}' -m sigs.k8s.io/controller-runtime)/pkg/client/interfaces.go
$(MOCKGEN) -destination=$@ -package=mock_client -source=$^
pkg/mock/mock_scale/mock_interfaces.go: vendor/k8s.io/client-go/scale/interfaces.go
# $(MOCKGEN) -destination=$@ -package=mock_scale -source=$^
$(MOCKGEN) k8s.io/client-go/scale ScalesGetter,ScaleInterface > pkg/mock/mock_scale/mock_interfaces.go
pkg/mock/mock_client/mock_interfaces.go: vendor/sigs.k8s.io/controller-runtime/pkg/client/interfaces.go
# $(MOCKGEN) -destination=$@ -package=mock_client -source=$^
$(MOCKGEN) sigs.k8s.io/controller-runtime/pkg/client Patch,Reader,Writer,StatusClient,StatusWriter,Client,WithWatch,FieldIndexer > pkg/mock/mock_client/mock_interfaces.go
pkg/scalers/liiklus/mocks/mock_liiklus.go:
$(MOCKGEN) -destination=$@ github.com/kedacore/keda/v2/pkg/scalers/liiklus LiiklusServiceClient

Expand All @@ -188,10 +186,10 @@ pkg/scalers/liiklus/mocks/mock_liiklus.go:
build: generate fmt vet manager adapter ## Build Operator (manager) and Metrics Server (adapter) binaries.

manager: generate
${GO_BUILD_VARS} go build -ldflags $(GO_LDFLAGS) -o bin/keda main.go
${GO_BUILD_VARS} go build -ldflags $(GO_LDFLAGS) -mod=vendor -o bin/keda main.go

adapter: generate adapter/generated/openapi/zz_generated.openapi.go
${GO_BUILD_VARS} go build -ldflags $(GO_LDFLAGS) -o bin/keda-adapter adapter/main.go
${GO_BUILD_VARS} go build -ldflags $(GO_LDFLAGS) -mod=vendor -o bin/keda-adapter adapter/main.go

run: manifests generate ## Run a controller from your host.
WATCH_NAMESPACE="" go run -ldflags $(GO_LDFLAGS) ./main.go $(ARGS)
Expand Down
275 changes: 0 additions & 275 deletions adapter/generated/openapi/zz_generated.openapi.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit cfa7bb9

Please sign in to comment.