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

api: remove v1beta1 #602

Merged
merged 3 commits into from
Nov 21, 2023
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Tool versions
CTRL_TOOLS_VERSION=0.12.0
CTRL_RUNTIME_VERSION := $(shell awk '/sigs.k8s.io\/controller-runtime/ {print substr($$2, 2)}' go.mod)
CODE_GENERATOR_VERSION := $(shell awk '/k8s.io\/client-go/ {print substr($$2, 2)}' go.mod)
KUSTOMIZE_VERSION = 5.0.3
HELM_VERSION = 3.12.0
CRD_TO_MARKDOWN_VERSION = 0.0.3
Expand Down Expand Up @@ -63,20 +62,17 @@ manifests: controller-gen kustomize yq ## Generate WebhookConfiguration, Cluster
rm -rf charts/moco/templates/generated/
mkdir -p charts/moco/templates/generated/crds/
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases
$(KUSTOMIZE) build config/crd -o config/crd/tests # Outputs static CRDs with conversion webhook enabled for use with Envtest.
$(KUSTOMIZE) build config/crd -o config/crd/tests # Outputs static CRDs for use with Envtest.
$(KUSTOMIZE) build config/kustomize-to-helm/overlays/crds | $(YQ) e "." - > charts/moco/templates/generated/crds/moco_crds.yaml
$(KUSTOMIZE) build config/kustomize-to-helm/overlays/templates | $(YQ) e "." - > charts/moco/templates/generated/generated.yaml

.PHONY: generate
generate: controller-gen conversion-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
generate: controller-gen ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..."
$(CONVERSION_GEN) -i ./api/v1beta1/ -o . -O zz_generated.conversion --go-header-file hack/boilerplate.go.txt

.PHONY: apidoc
apidoc: crd-to-markdown $(wildcard api/*/*_types.go)
$(CRD_TO_MARKDOWN) --links docs/links.csv -f api/v1beta1/mysqlcluster_types.go -f api/v1beta1/job_types.go -n MySQLCluster > docs/crd_mysqlcluster_v1beta1.md
$(CRD_TO_MARKDOWN) --links docs/links.csv -f api/v1beta2/mysqlcluster_types.go -f api/v1beta2/job_types.go -n MySQLCluster > docs/crd_mysqlcluster_v1beta2.md
$(CRD_TO_MARKDOWN) --links docs/links.csv -f api/v1beta1/backuppolicy_types.go -f api/v1beta1/job_types.go -n BackupPolicy > docs/crd_backuppolicy_v1beta1.md
$(CRD_TO_MARKDOWN) --links docs/links.csv -f api/v1beta2/backuppolicy_types.go -f api/v1beta2/job_types.go -n BackupPolicy > docs/crd_backuppolicy_v1beta2.md

.PHONY: book
Expand Down Expand Up @@ -149,10 +145,6 @@ CONTROLLER_GEN := $(shell pwd)/bin/controller-gen
controller-gen: ## Download controller-gen locally if necessary.
$(call go-get-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen@v$(CTRL_TOOLS_VERSION))

CONVERSION_GEN := $(shell pwd)/bin/conversion-gen
conversion-gen: ## Donwload conversion-gen locally if necessary.
$(call go-get-tool,$(CONVERSION_GEN),k8s.io/code-generator/cmd/conversion-gen@v$(CODE_GENERATOR_VERSION))

SETUP_ENVTEST := $(shell pwd)/bin/setup-envtest
.PHONY: setup-envtest
setup-envtest: ## Download setup-envtest locally if necessary
Expand Down
16 changes: 2 additions & 14 deletions PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,6 @@ resources:
domain: cybozu.com
group: moco
kind: MySQLCluster
path: github.com/cybozu-go/moco/api/v1beta1
version: v1beta1
webhooks:
conversion: true
webhookVersion: v1
- api:
crdVersion: v1
namespaced: true
controller: false
domain: cybozu.com
group: moco
kind: MySQLCluster
path: github.com/cybozu-go/moco/api/v1beta2
version: v1beta2
webhooks:
Expand All @@ -35,8 +23,8 @@ resources:
domain: cybozu.com
group: moco
kind: BackupPolicy
path: github.com/cybozu-go/moco/api/v1beta1
version: v1beta1
path: github.com/cybozu-go/moco/api/v1beta2
version: v1beta2
webhooks:
validation: true
webhookVersion: v1
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ You can then create a three-instance MySQL cluster as follows:

```console
$ cat > mycluster.yaml <<'EOF'
apiVersion: moco.cybozu.com/v1beta1
apiVersion: moco.cybozu.com/v1beta2
kind: MySQLCluster
metadata:
namespace: default
Expand Down
108 changes: 0 additions & 108 deletions api/v1beta1/backuppolicy_types.go

This file was deleted.

Loading