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

Initial changes for v1beta2 CRD #1077

Merged
merged 10 commits into from
Mar 10, 2022
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
4 changes: 0 additions & 4 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ jobs:
KUBEBUILDER_VER: "2.3.2"
KUSTOMIZE_VER: "v3.9.4"
KIND_VER: "v0.11.1"
YQ_VERSION: "v4.6.1"
run: |
# Only download all dependencies
go get -v -t -d ./...
Expand All @@ -68,7 +67,6 @@ jobs:
curl --fail -L "https://github.com/kubernetes-sigs/kubebuilder/releases/download/v${KUBEBUILDER_VER}/kubebuilder_${KUBEBUILDER_VER}_${os}_${arch}.tar.gz" -o kubebuilder.tar.gz
curl --fail -L "https://github.com/apple/foundationdb/releases/download/${{ matrix.fdbver }}/foundationdb-clients_${{ matrix.fdbver }}-1_amd64.deb" -o fdb.deb
curl -Lo kind https://kind.sigs.k8s.io/dl/${KIND_VER}/kind-linux-amd64
curl -Lo yq.tar.gz https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_amd64.tar.gz
- name: Install dependencies
env:
KUBEBUILDER_VER: "2.3.2"
Expand All @@ -85,8 +83,6 @@ jobs:
chmod +x kind
sudo mv kind /usr/local/bin/kind
./scripts/setup_kind_local_registry.sh ${{ matrix.kubever }}
tar xvfz yq.tar.gz
sudo mv ./yq_linux_amd64 /usr/bin/yq
- name: Check for uncommitted changes
run: |
make clean all
Expand Down
20 changes: 8 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Image URL to use all building/pushing image targets
IMG ?= fdb-kubernetes-operator:latest
CRD_OPTIONS ?= "crd:trivialVersions=true,maxDescLen=0,crdVersions=v1,generateEmbeddedObjectMeta=true"
CRD_OPTIONS ?= "crd:maxDescLen=0,crdVersions=v1,generateEmbeddedObjectMeta=true"

ifneq "$(FDB_WEBSITE)" ""
img_build_args := $(img_build_args) --build-arg FDB_WEBSITE=$(FDB_WEBSITE)
Expand Down Expand Up @@ -55,7 +55,7 @@ $(eval $(call godep,kustomize,KUSTOMIZE))
$(eval $(call godep,yq,YQ))

GO_SRC=$(shell find . -name "*.go" -not -name "zz_generated.*.go")
GENERATED_GO=api/v1beta1/zz_generated.deepcopy.go
GENERATED_GO=api/v1beta2/zz_generated.deepcopy.go
GO_ALL=${GO_SRC} ${GENERATED_GO}
MANIFESTS=config/crd/bases/apps.foundationdb.org_foundationdbbackups.yaml config/crd/bases/apps.foundationdb.org_foundationdbclusters.yaml config/crd/bases/apps.foundationdb.org_foundationdbrestores.yaml

Expand Down Expand Up @@ -135,10 +135,6 @@ manifests: ${MANIFESTS}

${MANIFESTS}: ${CONTROLLER_GEN} ${GO_SRC}
$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases
# See: https://github.com/kubernetes-sigs/controller-tools/issues/476 remove after the next release (and add a note in the release)
yq e '.spec.preserveUnknownFields = false' -i ./config/crd/bases/apps.foundationdb.org_foundationdbbackups.yaml
yq e '.spec.preserveUnknownFields = false' -i ./config/crd/bases/apps.foundationdb.org_foundationdbclusters.yaml
yq e '.spec.preserveUnknownFields = false' -i ./config/crd/bases/apps.foundationdb.org_foundationdbrestores.yaml

# Run go fmt against code
fmt: bin/fmt_check
Expand Down Expand Up @@ -184,14 +180,14 @@ config/samples/deployment.yaml: config/samples/deployment/*.yaml
bin/po-docgen: cmd/po-docgen/*.go
go build -o bin/po-docgen cmd/po-docgen/main.go cmd/po-docgen/api.go

docs/cluster_spec.md: bin/po-docgen api/v1beta1/foundationdbcluster_types.go
bin/po-docgen api api/v1beta1/foundationdbcluster_types.go > docs/cluster_spec.md
docs/cluster_spec.md: bin/po-docgen api/v1beta2/foundationdbcluster_types.go
bin/po-docgen api api/v1beta2/foundationdbcluster_types.go > docs/cluster_spec.md

docs/backup_spec.md: bin/po-docgen api/v1beta1/foundationdbbackup_types.go
bin/po-docgen api api/v1beta1/foundationdbbackup_types.go > docs/backup_spec.md
docs/backup_spec.md: bin/po-docgen api/v1beta2/foundationdbbackup_types.go
bin/po-docgen api api/v1beta2/foundationdbbackup_types.go > docs/backup_spec.md

docs/restore_spec.md: bin/po-docgen api/v1beta1/foundationdbrestore_types.go
bin/po-docgen api api/v1beta1/foundationdbrestore_types.go > docs/restore_spec.md
docs/restore_spec.md: bin/po-docgen api/v1beta2/foundationdbrestore_types.go
bin/po-docgen api api/v1beta2/foundationdbrestore_types.go > docs/restore_spec.md

documentation: docs/cluster_spec.md docs/backup_spec.md docs/restore_spec.md

Expand Down
17 changes: 16 additions & 1 deletion PROJECT
Original file line number Diff line number Diff line change
@@ -1,7 +1,22 @@
version: "2"
domain: foundationdb.org
repo: github.com/FoundationDB/fdb-kubernetes-operator
resources:
- group: apps
kind: FoundationDBCluster
version: v1beta1
- group: apps
kind: FoundationDBRestore
version: v1beta1
- group: apps
kind: FoundationDBBackup
version: v1beta1
- group: apps
kind: FoundationDBCluster
version: v1beta2
- group: apps
kind: FoundationDBRestore
version: v1beta2
- group: apps
kind: FoundationDBBackup
version: v1beta2
version: "2"
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ the [API documentation](docs/cluster_spec.md).
3. Set your $GOPATH, e.x. `/Users/me/Code/go`.
4. Install [kustomize](https://github.com/kubernetes-sigs/kustomize).
5. Install the [foundationDB client package](https://www.foundationdb.org/download).
6. If you want to modify the manifests you currently need [yq](https://github.com/mikefarah/yq), we use the `v4.6.1` version.

### Running Locally

Expand Down
2 changes: 1 addition & 1 deletion api/v1beta1/foundationdb_custom_parameter.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* This source file is part of the FoundationDB open source project
*
* Copyright 2021 Apple Inc. and the FoundationDB project authors
* Copyright 2021-2022 Apple Inc. and the FoundationDB project authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion api/v1beta1/foundationdb_custom_parameter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* This source file is part of the FoundationDB open source project
*
* Copyright 2021 Apple Inc. and the FoundationDB project authors
* Copyright 2021-2022 Apple Inc. and the FoundationDB project authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Loading