kubernetes-sigs / kubebuilder

Kubebuilder - SDK for building Kubernetes APIs using CRDs
http://book.kubebuilder.io
Apache License 2.0
7.97k stars 1.46k forks source link

Add e2e test to validate webhook conversion from one version to another #4255

Open camilamacedo86 opened 1 month ago

camilamacedo86 commented 1 month ago

What do you want to happen?

Description:

To enhance the MultiVersion tutorial, which demonstrates version conversion in webhooks, we created a sample project under: https://github.com/kubernetes-sigs/kubebuilder/tree/master/docs/book/src/multiversion-tutorial/testdata/project

This sample is auto-generated and updated when running make generate-docs as defined here:
https://github.com/kubernetes-sigs/kubebuilder/blob/master/Makefile#L82-L84

Code generation and insertion for documentation (including comments) are handled within:
https://github.com/kubernetes-sigs/kubebuilder/tree/master/hack/docs/internal/multiversion-tutorial

Additionally, we have a GitHub Action that runs e2e tests scaffolded by default for this sample project:
https://github.com/kubernetes-sigs/kubebuilder/blob/e02bbd46b0a4c3b0fed5025210a0419c718b49b0/.github/workflows/test-e2e-book.yml#L78-L106

Goal

The objective of this issue is to supplement the tests in the e2e_test.go file by implementing an e2e test that:

  1. Applies a CronJob resource in v1 and verifies that it converts correctly to v2.
  2. Runs as part of our CI to validate the accuracy of our scaffolded code examples and ensure the functionality is as expected.
  3. Provides additional e2e testing examples, aiding users in creating and validating similar solutions.

By adding this test, we ensure that our examples and scaffolding are validated, providing greater confidence to our users.

Extra Labels

/kind documentation

TAM360 commented 1 month ago

/assign

camilamacedo86 commented 4 weeks ago

Hi @TAM360

I was looking this one it is a little hard to do. So, I will remove "good first issue" but if you still want to look on that please feel free.

TAM360 commented 4 weeks ago

@camilamacedo86 I am gonna try working on it.

priyansh3006 commented 3 weeks ago

/assign