Skip to content

Commit 01b90bd

Browse files
authored
Move CRDs and respective API to be under v1alpha1 (#1026)
* moved crds to be under v1alpha1 * fixed crd paths for IT tests * updated crd assets path for ginkgo IT tests * reorder imports
1 parent a019603 commit 01b90bd

15 files changed

+17
-17
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![REUSE status](https://api.reuse.software/badge/github.com/gardener/etcd-druid)](https://api.reuse.software/info/github.com/gardener/etcd-druid) [![CI Build status](https://concourse.ci.gardener.cloud/api/v1/teams/gardener/pipelines/etcd-druid-master/jobs/master-head-update-job/badge)](https://concourse.ci.gardener.cloud/teams/gardener/pipelines/etcd-druid-master/jobs/master-head-update-job) [![Go Report Card](https://goreportcard.com/badge/github.com/gardener/etcd-druid)](https://goreportcard.com/report/github.com/gardener/etcd-druid) [![License: Apache-2.0](https://img.shields.io/badge/License-Apache--2.0-blue.svg)](LICENSE) [![Release](https://img.shields.io/github/v/release/gardener/etcd-druid.svg?style=flat)](https://github.com/gardener/etcd-druid) [![Go Reference](https://pkg.go.dev/badge/github.com/gardener/etcd-druid.svg)](https://pkg.go.dev/github.com/gardener/etcd-druid) [![Docs](https://img.shields.io/badge/Docs-reference-orange)](https://gardener.github.io/etcd-druid/index.html)
44

5-
`etcd-druid` is an [etcd](https://github.com/etcd-io/etcd) [operator](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/) which makes it easy to configure, provision, reconcile, monitor and delete etcd clusters. It enables management of etcd clusters through [declarative Kubernetes API model](api/core/crds/druid.gardener.cloud_etcds.yaml).
5+
`etcd-druid` is an [etcd](https://github.com/etcd-io/etcd) [operator](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/) which makes it easy to configure, provision, reconcile, monitor and delete etcd clusters. It enables management of etcd clusters through [declarative Kubernetes API model](api/core/v1alpha1/crds/druid.gardener.cloud_etcds.yaml).
66

77
In every etcd cluster managed by `etcd-druid`, each etcd member is a two container `Pod` which consists of:
88

File renamed without changes.
File renamed without changes.

api/hack/generate.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ function generate_clientset() {
3838
}
3939

4040
function generate_crds() {
41-
local output_dir="${API_GO_MODULE_ROOT}/core/crds"
41+
local output_dir="${API_GO_MODULE_ROOT}/core/v1alpha1/crds"
4242
local package="github.com/gardener/etcd-druid/api/core/v1alpha1"
4343
local package_path="$(go list -f '{{.Dir}}' "${package}")"
4444

@@ -60,7 +60,7 @@ function generate_crds() {
6060
}
6161

6262
function generate_crd_without_cel_expressions() {
63-
local output_dir="${API_GO_MODULE_ROOT}/core/crds"
63+
local output_dir="${API_GO_MODULE_ROOT}/core/v1alpha1/crds"
6464
local source_file="${output_dir}/druid.gardener.cloud_etcds.yaml"
6565
local target_file="${output_dir}/druid.gardener.cloud_etcds_without_cel.yaml"
6666
yq 'del(.. | select(has("x-kubernetes-validations")).x-kubernetes-validations)' "${source_file}" > "${target_file}"
@@ -88,10 +88,10 @@ function main() {
8888
echo "> Generate clientset for Etcd API..."
8989
generate_clientset
9090

91-
lastMd5Sum=$(getMd5Sum "${API_GO_MODULE_ROOT}/core/crds/druid.gardener.cloud_etcds.yaml")
91+
lastMd5Sum=$(getMd5Sum "${API_GO_MODULE_ROOT}/core/v1alpha1/crds/druid.gardener.cloud_etcds.yaml")
9292
echo "> Generate CRDs..."
9393
generate_crds
94-
latestMd5Sum=$(getMd5Sum "${API_GO_MODULE_ROOT}/core/crds/druid.gardener.cloud_etcds.yaml")
94+
latestMd5Sum=$(getMd5Sum "${API_GO_MODULE_ROOT}/core/v1alpha1/crds/druid.gardener.cloud_etcds.yaml")
9595
if [[ ${lastMd5Sum} == ${latestMd5Sum} ]]; then
9696
echo "CRD file has not changed, skipping generation of CRD without CEL-validations"
9797
exit 0

docs/deployment/getting-started-locally/getting-started-locally.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Prior to deploying `etcd-druid`, it can be configured via CLI-args and environme
4444

4545
### Deploying etcd-druid
4646

47-
Any variant of `make deploy-*` command uses [helm](https://helm.sh/) and [skaffold](https://skaffold.dev/) to build and deploy `etcd-druid` to the target Kubernetes cluster. In addition to deploying `etcd-druid` it will also install the [Etcd CRD](https://github.com/gardener/etcd-druid/blob/master/api/core/crds/druid.gardener.cloud_etcds.yaml) and [EtcdCopyBackupTask CRD](https://github.com/gardener/etcd-druid/blob/master/api/core/crds/druid.gardener.cloud_etcdcopybackupstasks.yaml).
47+
Any variant of `make deploy-*` command uses [helm](https://helm.sh/) and [skaffold](https://skaffold.dev/) to build and deploy `etcd-druid` to the target Kubernetes cluster. In addition to deploying `etcd-druid` it will also install the [Etcd CRD](https://github.com/gardener/etcd-druid/blob/master/api/core/v1alpha1/crds/druid.gardener.cloud_etcds.yaml) and [EtcdCopyBackupTask CRD](https://github.com/gardener/etcd-druid/blob/master/api/core/v1alpha1/crds/druid.gardener.cloud_etcdcopybackupstasks.yaml).
4848

4949
#### Regular mode
5050

docs/deployment/prepare-helm-charts.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ To leverage etcd-druid helm charts you need to ensure that the charts contains t
3434

3535
### CRDs
3636

37-
[Heml-3](https://helm.sh/docs/topics/charts/#custom-resource-definitions-crds) provides special status to CRDs. CRD YAML files should be placed in `crds/` directory inside of a chart. Helm will attempt to load all the files in this directory. We now generate the CRDs and keep these at `etcd-druid/api/core/crds` which serves as a single source of truth for all custom resource specifications under etcd-druid operator. These CRDs needs to be copied to `etcd-druid/charts/crds`.
37+
[Heml-3](https://helm.sh/docs/topics/charts/#custom-resource-definitions-crds) provides special status to CRDs. CRD YAML files should be placed in `crds/` directory inside of a chart. Helm will attempt to load all the files in this directory. We now generate the CRDs and keep these at `etcd-druid/api/core/v1alpha1/crds` which serves as a single source of truth for all custom resource specifications under etcd-druid operator. These CRDs needs to be copied to `etcd-druid/charts/crds`.
3838

3939
### PKI resources
4040

docs/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
</a>
2727
</p>
2828

29-
`etcd-druid` is an [etcd](https://github.com/etcd-io/etcd) [operator](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/) which makes it easy to configure, provision, reconcile, monitor and delete etcd clusters. It enables management of etcd clusters through [declarative Kubernetes API model](../api/core/crds/druid.gardener.cloud_etcds.yaml).
29+
`etcd-druid` is an [etcd](https://github.com/etcd-io/etcd) [operator](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/) which makes it easy to configure, provision, reconcile, monitor and delete etcd clusters. It enables management of etcd clusters through [declarative Kubernetes API model](../api/core/v1alpha1/crds/druid.gardener.cloud_etcds.yaml).
3030

3131
In every etcd cluster managed by `etcd-druid`, each etcd member is a two container `Pod` which consists of:
3232

hack/prepare-chart-resources.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,9 @@ function copy_crds() {
118118
rm -rf "${target_path}"/*
119119
crd_file_names=($(get_crd_file_names))
120120
for crd_file_name in "${crd_file_names[@]}"; do
121-
local source_crd_path="${PROJECT_ROOT}/api/core/crds/${crd_file_name}"
121+
local source_crd_path="${PROJECT_ROOT}/api/core/v1alpha1/crds/${crd_file_name}"
122122
if [ ! -f ${source_crd_path} ]; then
123-
echo -e "CRD ${crd_file_name} not found in ${PROJECT_ROOT}/api/core/crds, run 'make generate' first"
123+
echo -e "CRD ${crd_file_name} not found in ${PROJECT_ROOT}/api/core/v1alpha1/crds, run 'make generate' first"
124124
exit 1
125125
fi
126126
echo "Copying CRD ${crd_file_name} to ${target_path}"

test/integration/controllers/assets/assets.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ import (
1515

1616
// GetEtcdCrdPath returns the path to the Etcd CRD.
1717
func GetEtcdCrdPath() string {
18-
return filepath.Join("..", "..", "..", "..", "api", "core", "crds", "druid.gardener.cloud_etcds.yaml")
18+
return filepath.Join("..", "..", "..", "..", "api", "core", "v1alpha1", "crds", "druid.gardener.cloud_etcds.yaml")
1919
}
2020

2121
// GetEtcdCopyBackupsTaskCrdPath returns the path to the EtcdCopyBackupsTask CRD.
2222
func GetEtcdCopyBackupsTaskCrdPath() string {
23-
return filepath.Join("..", "..", "..", "..", "api", "core", "crds", "druid.gardener.cloud_etcdcopybackupstasks.yaml")
23+
return filepath.Join("..", "..", "..", "..", "api", "core", "v1alpha1", "crds", "druid.gardener.cloud_etcdcopybackupstasks.yaml")
2424
}
2525

2626
// CreateImageVector creates an image vector.

test/it/assets/assets.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ func GetK8sVersionFromEnv() (string, error) {
3131
// GetEtcdCrdPath returns the path to the Etcd CRD for k8s versions >= 1.29 or the path to the Etcd CRD without CEL expressions (For versions < 1.29)
3232
func GetEtcdCrdPath(k8sVersionAbove129 bool) string {
3333
if k8sVersionAbove129 {
34-
return filepath.Join("..", "..", "..", "..", "api", "core", "crds", "druid.gardener.cloud_etcds.yaml")
34+
return filepath.Join("..", "..", "..", "..", "api", "core", "v1alpha1", "crds", "druid.gardener.cloud_etcds.yaml")
3535
}
36-
return filepath.Join("..", "..", "..", "..", "api", "core", "crds", "druid.gardener.cloud_etcds_without_cel.yaml")
36+
return filepath.Join("..", "..", "..", "..", "api", "core", "v1alpha1", "crds", "druid.gardener.cloud_etcds_without_cel.yaml")
3737
}
3838

3939
// GetEtcdCopyBackupsTaskCrdPath returns the path to the EtcdCopyBackupsTask CRD.
4040
func GetEtcdCopyBackupsTaskCrdPath() string {
41-
return filepath.Join("..", "..", "..", "..", "api", "core", "crds", "druid.gardener.cloud_etcdcopybackupstasks.yaml")
41+
return filepath.Join("..", "..", "..", "..", "api", "core", "v1alpha1", "crds", "druid.gardener.cloud_etcdcopybackupstasks.yaml")
4242
}
4343

4444
// CreateImageVector creates an image vector.

test/it/controller/etcd/reconciler_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import (
1111
"testing"
1212
"time"
1313

14-
"github.com/gardener/etcd-druid/api/core/crds"
1514
druidv1alpha1 "github.com/gardener/etcd-druid/api/core/v1alpha1"
15+
"github.com/gardener/etcd-druid/api/core/v1alpha1/crds"
1616
"github.com/gardener/etcd-druid/internal/common"
1717
"github.com/gardener/etcd-druid/internal/component"
1818
"github.com/gardener/etcd-druid/internal/utils/kubernetes"

test/it/crdvalidation/etcd/validation_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
"os"
1010
"testing"
1111

12-
"github.com/gardener/etcd-druid/api/core/crds"
12+
"github.com/gardener/etcd-druid/api/core/v1alpha1/crds"
1313
"github.com/gardener/etcd-druid/test/it/assets"
1414
"github.com/gardener/etcd-druid/test/it/setup"
1515
)

0 commit comments

Comments
 (0)