Open camilamacedo86 opened 2 days ago
c/c @varshaprasad96 @Kavinjsir @mogsie @TAM360 @Adembc @pgaxatte @rkosegi @lorenzofelletti @mateusoliveira43
This release is going to be big and exciting, with a bunch of breaking changes! Thanks all for all the effort in getting it through. Lgtm for the draft from my end 👍
Looks good to me 👍🏼 @camilamacedo86 Appreciated for the huge contribution!
Everything looks good! @camilamacedo86
What do you want to happen?
Please take a look at the draft for the upcoming 4.3.0 release and what’s been merged into the master branch so far bellow.
We’ve been working to improve the documentation for this upcoming release. We’ve reviewed and rewritten sections, cleaning up outdated information and making significant revisions to areas such as "Watching Resources," "Getting Started," and "Plugins." You can check the current state of the docs and how they will appear in production after the release by visiting the “nightly” docs at:master.book.kubebuilder.io.
Please let us know if you have any suggestions, objections, or other feedback for the next release. If no objections are raised, we are planning to push the release any time after Monday, the 14th.
------ Draft ----
⚠️ Important Notice:
(Only projects using webhooks are impacted by)
Controller runtime has deprecated the
webhook.Validator
andwebhook.Defaulter
interfaces, and they will no longer be provided in future versions. Therefore, projects must adopt the newCustomValidator
andCustomDefaulter
interfaces to remain compatible with controller-runtimev0.20.0
and upper versions. For more details, refer to controller-runtime/issues/2641.Additionally, webhooks should no longer be placed under the
api
directory. They should be moved tointernal/webhook
. You can temporarily scaffold using--legacy=true
, but this flag will be removed in future releases.Steps to Migrate:
Move Webhook Files to the Internal Directory:
Depending on your project structure, move the webhook files:
Single Group Layout: Move from
api/<version>
tointernal/webhook/<version>
.Before:
After:
Multigroup Layout: Move from
api/<group>/<version>
tointernal/webhook/<group>/<version>
.Before:
After:
Update Imports:
After moving the files, ensure that all references to webhooks are updated in your
main.go
and other files. For example, update the import:Before:
After:
Replace Deprecated Interfaces with Custom Ones:
Replace
webhook.Validator
andwebhook.Defaulter
with the newCustomValidator
andCustomDefaulter
interfaces:Before:
After:
Example: See the tutorial: CronJob Webhook Example.
Note: You might want to use the Upgrade Assistance to re-scaffold your project and then apply your code changes on top, ensuring that all necessary updates are addressed.
⚠️ Breaking Changes
webhook.Validator
andwebhook.Defaulter
interfaces withCustomValidator
andCustomDefaulter
. Projects using the old interfaces must migrate to ensure compatibility with future versions. (#4060)api/<version>
orapi/<group>/<version>
tointernal/webhook/<version>
orinternal/webhook/<group>/<version>
. This restructuring improves project organization. (#4150)APIPackagePathLegacy
method, which has been obsolete since release 4.0.0. This change cleans up unused code. (#4182)HasFragment
method, favoringHasFileContentWith
to reduce duplication and simplify the codebase. (#4191)✨ New Features
e2e/tests
, covering the manager and webhooks. These tests are designed to fail when not run against clusters using Kind, and they avoid re-installing Prometheus and Cert-Manager if already present. See the final scaffolded tests in the samples under testdata here. Key improvements include:make manifests
andmake generate
are run as part of the e2e tests. (#4122)make test-e2e
withmake test
for consistent behavior. (#4125)+kubebuilder:scaffold:e2e-webhooks-checks
marker. (#4121)e2e/test.go
. (#4141, #4158, #4166, #4175)v1.14.4
tov1.16.0
for better compatibility and features. (#4209)🐛 Bug Fixes
typeNamespaceName
withtypeNamespacedName
to ensure accurate variable naming. (#4100)nolint
where necessary to prevent failures for specific cases that should not fail during checks. (#4111)godot
,gofumpt
, andnlreturn
, ensuring better code formatting and style. (#4133)HasResource
package method to stop once a match is found, improving performance and accuracy in resource handling. (#4190)webhookcainjection_patch
and clarified the use of cert-manager as a replacement. (#4123)What's Changed
api/<version>
orapi/<group>/<version>
tointernal/webhook/<version>
orinternal/webhook/<group>/<version>
) by @camilamacedo86 in https://github.com/kubernetes-sigs/kubebuilder/pull/4150New Contributors
Full Changelog: https://github.com/kubernetes-sigs/kubebuilder/compare/v4.2.0...v4.3.0
Extra Labels
No response