-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into fix/subtract-previous-usage
- Loading branch information
Showing
68 changed files
with
3,599 additions
and
918 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 |
---|---|---|
@@ -1,29 +1,57 @@ | ||
.PHONY: all generate manager test lint kind e2e | ||
SHELL := /bin/bash | ||
|
||
all: manager | ||
BUILD_FLAGS := | ||
BINARY := manager | ||
|
||
# Generate code | ||
.PHONY: all | ||
all: build | ||
|
||
# Production build | ||
.PHONY: build | ||
build: | ||
mkdir -p output | ||
go build $(BUILD_FLAGS) -o output/$(BINARY) cmd/controller-manager/main.go | ||
|
||
# Debug build | ||
.PHONY: debug | ||
debug: BUILD_FLAGS+=-race | ||
debug: BINARY:=$(BINARY)_debug | ||
debug: build | ||
|
||
# Clean built binaries | ||
.PHONY: clean | ||
clean: | ||
rm -r output | ||
|
||
# Generate code and artifacts | ||
.PHONY: generate | ||
generate: pkg/client | ||
pkg/client: $(shell find pkg/apis) | ||
bash ./hack/generate-groups.sh | ||
# update the directory mtime to avoid unnecessary re-runs | ||
touch pkg/client | ||
|
||
# Build manager binary | ||
manager: | ||
mkdir -p output | ||
go build -o output/manager cmd/controller-manager/main.go | ||
|
||
# Run tests | ||
test: | ||
go test -race -coverprofile coverage.out ./pkg/... | ||
LINT_FLAGS := --timeout=5m --max-issues-per-linter=0 --max-same-issues=0 --uniq-by-line=false | ||
|
||
# Run golangci-lint | ||
.PHONY: lint | ||
lint: | ||
golangci-lint run | ||
golangci-lint run $(LINT_FLAGS) | ||
|
||
# Creates federation using kind | ||
kind: generate | ||
bash ./hack/dev-up.sh | ||
# Run golangci-lint on files changed from the default branch | ||
.PHONY: lint-new | ||
lint-new: LINT_FLAGS += --new-from-rev=main --whole-files | ||
lint-new: lint | ||
|
||
# Run tests | ||
.PHONY: test | ||
test: | ||
go test -race -coverprofile coverage0.out ./pkg/... | ||
# exclude generated files from coverage calculation | ||
sed '/generated/d' coverage0.out > coverage.out | ||
rm coverage0.out | ||
|
||
# Run e2e tests | ||
.PHONY: e2e | ||
e2e: | ||
ginkgo run -tags=e2e $(EXTRA_GINKGO_FLAGS) test/e2e -- --kubeconfig=$(KUBECONFIG) $(EXTRA_E2E_FLAGS) | ||
ginkgo run -race -tags=e2e $(EXTRA_GINKGO_FLAGS) test/e2e -- --kubeconfig=$(KUBECONFIG) $(EXTRA_E2E_FLAGS) |
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 |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
|
||
set -eux | ||
|
||
make manager | ||
make build |
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
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
Oops, something went wrong.