Skip to content

Commit

Permalink
feat(overlay): support overlay pod (pingcap#125)
Browse files Browse the repository at this point in the history
Signed-off-by: liubo02 <liubo02@pingcap.com>
  • Loading branch information
liubog2008 authored Oct 30, 2024
1 parent d17f864 commit a223393
Show file tree
Hide file tree
Showing 16 changed files with 14,164 additions and 21 deletions.
50 changes: 33 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,26 @@ OUTPUT_DIR = $(ROOT)/_output
BIN_DIR = $(OUTPUT_DIR)/bin
CORE_API_PATH = $(ROOT)/apis/core
PD_API_PATH = $(ROOT)/pkg/timanager/apis/pd
OVERLAY_PKG_DIR = $(ROOT)/pkg/overlay
BOILERPLATE_FILE = $(ROOT)/hack/boilerplate/boilerplate.go.txt
# TODO: use kubectl in _output
KUBECTL = kubectl -n tidb-admin --context kind-tidb-operator


ALL_CMD = operator checker
.PHONY: build
build:
$(ROOT)/hack/build.sh
build: $(addprefix build/,$(ALL_CMD))
build/%:
$(ROOT)/hack/build.sh $*

.PHONY: image
image:
$(ROOT)/hack/image.sh
image: $(addprefix image/,$(ALL_CMD))
image/%:
$(ROOT)/hack/image.sh $*

.PHONY: push
push:
$(ROOT)/hack/image.sh --push
push: $(addprefix push/,$(ALL_CMD))
push/%:
$(ROOT)/hack/image.sh $* --push

.PHONY: deploy
deploy: crd rbac
Expand All @@ -26,27 +31,34 @@ deploy: crd rbac
$(KUBECTL) apply --server-side=true -f $(ROOT)/manifests/deploy

.PHONY: codegen
codegen: bin/deepcopy-gen bin/register-gen
codegen: bin/deepcopy-gen bin/register-gen bin/overlay-gen
$(REGISTER_GEN) \
--output-file=zz_generated.register.go \
--go-header-file=$(ROOT)/hack/boilerplate/boilerplate.go.txt \
--go-header-file=$(BOILERPLATE_FILE) \
$(CORE_API_PATH)/...

$(DEEPCOPY_GEN) \
--output-file=zz_generated.deepcopy.go \
--go-header-file=$(ROOT)/hack/boilerplate/boilerplate.go.txt \
--go-header-file=$(BOILERPLATE_FILE) \
$(CORE_API_PATH)/...

$(REGISTER_GEN) \
--output-file=zz_generated.register.go \
--go-header-file=$(ROOT)/hack/boilerplate/boilerplate.go.txt \
--go-header-file=$(BOILERPLATE_FILE) \
$(PD_API_PATH)/...

$(DEEPCOPY_GEN) \
--output-file=zz_generated.deepcopy.go \
--go-header-file=$(ROOT)/hack/boilerplate/boilerplate.go.txt \
--go-header-file=$(BOILERPLATE_FILE) \
$(PD_API_PATH)/...

.PHONY: overlaygen
overlaygen: bin/overlay-gen
$(OVERLAY_GEN) \
--output-dir=$(OVERLAY_PKG_DIR) \
--go-header-file=$(BOILERPLATE_FILE) \
k8s.io/api/core/v1


.PHONY: crd
crd: bin/controller-gen
Expand All @@ -61,12 +73,12 @@ tidy:
cd $(CORE_API_PATH) && go mod tidy
go mod tidy

ALL_GENERATION= tidy codegen crd rbac
ALL_GEN = tidy codegen crd rbac
.PHONY: generate
generate: $(ALL_GENERATION)
generate: $(ALL_GEN)

.PHONY: verify
verify: $(addprefix verify/,$(ALL_GENERATION))
verify: $(addprefix verify/,$(ALL_GEN))
verify/%:
$(ROOT)/hack/verify.sh make $*

Expand Down Expand Up @@ -99,8 +111,6 @@ logs/operator:
$(KUBECTL) logs -f `$(KUBECTL) get pods | awk '/operator/{ print $$1 }'`




CONTROLLER_GEN = $(BIN_DIR)/controller-gen
bin/controller-gen:
$(ROOT)/hack/download.sh go_install $(CONTROLLER_GEN) sigs.k8s.io/controller-tools/cmd/controller-gen
Expand All @@ -113,6 +123,10 @@ REGISTER_GEN = $(BIN_DIR)/register-gen
bin/register-gen:
$(ROOT)/hack/download.sh go_install $(REGISTER_GEN) k8s.io/code-generator/cmd/register-gen

OVERLAY_GEN = $(BIN_DIR)/overlay-gen
bin/overlay-gen:
$(ROOT)/hack/build.sh overlay-gen

.PHONY: bin/golangci-lint
GOLANGCI_LINT = $(BIN_DIR)/golangci-lint
bin/golangci-lint:
Expand All @@ -123,3 +137,5 @@ bin/golangci-lint:
KIND = $(BIN_DIR)/kind
bin/kind:
$(ROOT)/hack/download.sh go_install $(KIND) sigs.k8s.io/kind v0.23.0 "version | awk '{print \$$2}'"


Loading

0 comments on commit a223393

Please sign in to comment.