You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CRD Validation for Etcd resource using CEL expressions (#995)
* validation markers without cron regex fix and update rules
* Added integration test framework for validating CRD fields
* used common function to generate etcd object for tests + consistent cron expression
* Upgraded env-test k8s version, and fixed corresponding bugs.
* Added `itTestEnv.StartManager()` to start the manager in `setupTestEnvironment()`.
* Upgraded teh env-test k8s version to `1.30`.
* Changed the timeout to `20s` in `assertReconcileSuspensionEventRecorded`
to prevent the test timing out.
* Removed an unnecessary `time.Sleep` in `TestValidateSpecReplicas`.
* 1) reduced timeout to 10s
2) added version compatibility docs
3) reduced code reuse in specUpdate_test.go
Reverted the timeout value in test/it/helper.go which was increased to handle failure of prow jobs
1) Renamed "test/it/crd-validation" to "test/crdvalidation"
2) Removed Camel casing from the file names in test/crdvalidation/etcd
3) Changed version-compatibility matrix to 1.29 since CEL expressions are valid from this version onwards
4) Removed config/crd/bases/crd-druid.gardener.cloud_etcds.yaml
* generate both crds based on k8s version
1) make prepare-helm-charts now takes an additional parameter to deploy the crd either with or without the CEL expressions based on the k8s version.
2) modified api/hack/generate.sh to generate 2 versions of the etcd crd. One with and one without CEL expressions
3) added deploy.sh which is called when make deploy is called. Additional functionality: get k8s version and deploy accordingly.
* changed the crds API to accept a k8sversion and added unit test
* removed deploy.sh, changed Makefile targets and refactored prepare-chart-resources
* modified generate.sh to conditionally generate crd without cel validations
* added missing license headers
* changed it tests to skip test cases based on k8s version + removed validation for requests field in etcd
1) Changed the Makefile target for deploy to install the dependecies if not present
2) Removed existing validations for fields of type resources where the request field was mandatory.
3) reverted the cron expressions in examples/etcd/druid_v1alpha1_etcd_localstack.yaml
4) exported the kubernetes version variable.
5) removed duplicate variable in hack/tools.mk
6) Added path to etcd crd without CEL as a return type in assets.go if the k8s version is < 1.29. Added the function to get k8s version as well
7) Changes to test/it/controller/etcd/reconciler_test.go and test/it/crdvalidation/etcd/validation_test.go based on changes to test/it/assets/assets.go
8) Skip test cases based on k8s versions
* renamed function skipTestBasedOnK8SVersion to skipCELTestsForOlderK8sVersions + added comment(description) to exported function
* fixed incorrect invocation of prepare-chart-resources for e2e tests resulting in incorrect SANs
* Updated the version-compatibility-matrix to remove supported versions of k8s for v0.28
* prepare chart resources will regenerate PKI artifacts when namespace changes
* added check for unspecified k8s version
---------
Co-authored-by: Shreyas Rao <[email protected]>
Co-authored-by: Saketh Kalaga <[email protected]>
Co-authored-by: madhav bhargava <[email protected]>
# While preparing helm charts, it will by default attempt to get the k8s version by invoking kubectl command assuming that you are already connected to a k8s cluster.
181
+
# If you wish to specify a specific k8s version, then set K8S_VERSION environment variable to a value of your choice.
// KindEtcdCopyBackupsTask is the kind of the etcd-copy-backup-task CRD.
26
+
KindEtcdCopyBackupsTask="EtcdCopyBackupsTask"
27
+
)
28
+
29
+
// GetAll returns all CRDs for the given k8s version.
30
+
// There are currently two sets of CRDs maintained.
31
+
// 1. One set is for Kubernetes version 1.29 and above. These CRDs contain embedded CEL validation expressions. CEL expressions are only GA since Kubernetes 1.29 onwards.
32
+
// 2. The other set is for Kubernetes versions below 1.29. These CRDs do not contain embedded CEL validation expressions.
0 commit comments