Update dependency kubernetes-sigs/kubebuilder to v4 #63
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
v3.8.0
->v4.3.1
Release Notes
kubernetes-sigs/kubebuilder (kubernetes-sigs/kubebuilder)
v4.3.1
Compare Source
✨ New Features
controller-runtime
fromv0.19.0
tov0.19.1
. (#4234)kustomize
fromv5.4.3
tov5.5.0
(#4235)golangci-lint
fromv1.59
tov1.61
with minor adjustments for lint rules. (#4236)🐛 Bug Fixes
config/crd/patches
to ensure the/convert
service patch is only created for webhooks configured with--conversion
. (#4280)cmd/main.go
, providing clarity on secure metrics setup. (#4245)--make=false
option for webhook creation, ensuring consistency with other command options and improved flexibility. (#4275)cert-manager
uncomment block to the top ofkustomization.yaml
to enhance visibility (#4283)main.go
boilerplate into thecmd/
directory. This change is relevant for users consuming the framework as a library and Kubebuilder maintainers only, providing a cleaner separation of code. (#4246)What's Changed
New Contributors
Full Changelog: kubernetes-sigs/kubebuilder@v4.3.0...v4.3.1
v4.3.0
Compare Source
(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.Furthermore, webhooks should no longer reside under the
api
directory. Instead, they should be relocated tointernal/webhook
. For now, you can scaffold webhooks in the legacy path (underapi
) by using the commandkubebuilder create webhook [OPTIONS] --legacy=true
, which scaffolds using theCustomValidator
andCustomDefaulter
interfaces. However, please note that this flag is deprecated and will be removed in upcoming 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. Also,
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: kubernetes-sigs/kubebuilder@v4.2.0...v4.3.0
v4.2.0
Compare Source
changes since v4.1.1
✨ New Features
🐛 Bug Fixes
pkg/plugin/util
(#4065)What's Changed (Full Changelog)
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.