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

Makefile: Generate OpenAPI only when building Metrics Adapter #1515

Merged
merged 1 commit into from
Jan 20, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ adapter: adapter-dockerfile gofmt govet
# are already in CI, we don't need to run them every
# time we build the image
.PHONY: adapter-dockerfile
adapter-dockerfile: generate
adapter-dockerfile: generate adapter/generated/openapi/zz_generated.openapi.go
${GO_BUILD_VARS} go build \
-ldflags "-X=github.com/kedacore/keda/version.GitCommit=$(GIT_COMMIT) -X=github.com/kedacore/keda/version.Version=$(VERSION)" \
-o bin/keda-adapter adapter/main.go
Expand All @@ -173,9 +173,10 @@ manifests: controller-gen

# Generate code (API)
.PHONY: generate
generate: controller-gen adapter/generated/openapi/zz_generated.openapi.go
generate: controller-gen
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..."

# Generate OpenAPI for Metrics Adapter
adapter/generated/openapi/zz_generated.openapi.go: go.mod go.sum
@OPENAPI_PATH=`go list -mod=readonly -m -f '{{.Dir}}' k8s.io/kube-openapi`; \
go run $${OPENAPI_PATH}/cmd/openapi-gen/openapi-gen.go --logtostderr \
Expand Down