Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependency kubernetes-sigs/kubebuilder to v4 #203

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented May 24, 2024

This PR contains the following updates:

Package Update Change
kubernetes-sigs/kubebuilder major v3.15.1 -> v4.5.0

Release Notes

kubernetes-sigs/kubebuilder (kubernetes-sigs/kubebuilder)

v4.5.0

Compare Source

changes since v4.4.0

⚠️ Breaking Changes

  • (go-v4): Upgrade controller-runtime from v0.19.4 to v0.20.0 and add support for Kubernetes 1.32 (#​4492). See the controller-runtime release notes to learn more about the breaking changes introduced.

    (Projects using webhooks):
    Controller-runtime removed the deprecated webhook.Validator and webhook.Defaulter interfaces. Additionally, webhooks should no longer reside under the api directory. Kubebuilder projects have not scaffolded webhooks in this directory or used the deprecated interfaces since v4.3.0.

    If you are using these interfaces or the legacy apis directory for webhooks, please refer to the v4.3.0 release notes, which provide guidance on updating your projects to align with the current standards.

    To assist with migration or reduce the burden on users, Kubebuilder has introduced a flag option to allow scaffolding webhooks using the new interfaces in the legacy path. For now, you can scaffold webhooks in the legacy path (under api) by using the command kubebuilder create webhook [OPTIONS] --legacy=true. For reference, you can look at the CronJob Tutorial sample webhooks implementation.

✨ New Features

  • (go-v4): Upgrade controller-gen from v0.17.0 to v0.17.1 (#​4493)
  • (go-v4): Upgrade GolangCI Lint from v1.62.2 to v1.63.4 (#​4494)
  • (go-v4): e2e tests: upgrade cert-manager version used from v1.16.0 to v1.16.3 (#​4497)
  • (go-v4): e2e tests: follow cert-manager org name changes (#​4505)

🐛 Bug Fixes

  • (CLI) Ensure minimal golang version 1.23.0 (#​4491)
  • (helm/alpha-v1): Fix YAML lint in the ServiceMonitor file (#​4502)
  • (alpha generate command): Fix scenario where the output-dir path is not informed; default to the current directory (#​4500)
  • (alpha generate command): Allow re-creating projects with webhooks for external-apis (#​4501)
  • (go-v4): Use explicit docker.io prefix for Docker Hub images (#​4513)

What's Changed

New Contributors

Full Changelog: kubernetes-sigs/kubebuilder@v4.4.0...v4.5.0

v4.4.0

Compare Source

changes since v4.3.1

✨ New Features

  • (go/v4): Upgrade golangci-lint from v1.61.0 to v1.62.2 (#​4448)
  • (go/v4): Add support for go 1.23 (#​4446)
  • (go/v4): Upgraded controller-gen from v0.16.4 to v0.17.0. (#​4254, #​4457)
  • (go/v4): Upgrade controller-runtime v0.19.1 to v0.19.4 (#​4482)
  • (kustomize/v2): Kubebuilder scaffolds rules under config/rbac to help cluster admins manage the permissions for their solutions. The comments and explanations added to these scaffolds have been improved. Furthermore, it now includes admin-specific rules to make it easier for cluster admins to work with features like aggregation (e.g., rbac.authorization.k8s.io/aggregate-to-admin). More info. (#​4299)
  • (go/v4): Added configurations for securing Metrics Server and Prometheus integration using TLS and certificates managed by CertManager, enabling users to align their solutions with best practices, enhance security, and achieve production readiness. (#​4243, #​4312, #​4400)
  • (go/v4): Added webhook CertWatcher and flags for custom certificate configuration #​4429)
  • (go/v4): Ensures that the manager container adheres to Restricted Pod Security Standards and can operate in namespaces labelled for restricted policies, following best practices. (#​4251).
  • (go/v4): Ensure that e2e test scaffolds will validate that the enforcement is prepared to ensure that all can run as restricted. See that the curl pod to use the metrics was updated and changed (#​4435)
  • (go/v4): Improved developer experience and maintainability by updating actions and the Makefile to utilize go.mod for Go version management and automating ENVTEST versioning by retrieving the version directly from go.mod, based on the controller-runtime dependency in use. (#​4385) (#​4401)
  • (helm/v1-alpha): Introduced the new helm.kubebuilder.io/v1-alpha plugin to enable users to distribute solutions using Helm Charts. Example scaffolds are available under testdata/project-v4-with-plugins/dist/chart. (#​4227, #​4315, #​4350, #​4351, #​4356, #​4357, #​4371, #​4377, #​4383, #​4380, #​4373, #​4386, #​4375, #​4388, #​4406, #​4399, #​4419,#​4451). IMPORTANT: The helm.kubebuilder.io/v1-alpha is an experimental initial version. (More info)
  • (go/v4,kustomize/v2): Add app.kubernetes.io/name label to allow more precise configurations (#​4437)
  • (go/v4): Standardize the webhook and controller test suites (#​4447)
  • (go/v4): Add new makefile target to check and validate the linter config (#​4462)
  • (go/v4): Added Hub and Spoke support for conversion webhooks. Developers can now scaffold webhooks for resource conversion more easily. (#​4254) Example:

Create API to test conversion from v1 to v2

$ kubebuilder create api --group crew --version v1 --kind FirstMate --controller=true --resource=true --make=false
$ kubebuilder create api --group crew --version v2 --kind FirstMate --controller=false --resource=true --make=false
$ kubebuilder create webhook --group crew --version v1 --kind FirstMate --conversion --make=false --spoke v2

#### 🐛 Bug Fixes

- **(go/v4):** Fixed an issue where GitHub Actions workflows were overwritten by commands, ensuring users can now customize workflows freely without their changes being overridden. ([#​4379](https://redirect.github.com/kubernetes-sigs/kubebuilder/pull/4379))
- **(go/v4):** Resolved linting issues in generated scaffolds. ([#​4384](https://redirect.github.com/kubernetes-sigs/kubebuilder/pull/4384))
- **(kustomize/v2, go/v4):** Fixed CA injection for conversion webhooks. Previously, the CA injection patch was not accurate; The injection should occur only for CRDs, which are conversion types and not for all CRDs when a webhook with `--conversion` option is scaffolded. The issue goes back to release `3.5.0` (_where to replace vars for replacements was done and the `kustomize/v2-alpha` plugin was introduced_). It was not previously found, likely because conversion webhook features were incomplete, which is addressed in this release. Now, users can use the tool to generate the conversion webhooks properly ([#​4254](https://redirect.github.com/kubernetes-sigs/kubebuilder/pull/4254)). ([#​4282](https://redirect.github.com/kubernetes-sigs/kubebuilder/pull/4282))
- **(go/v4):** Ensure that schemas are added before starting EnvTest-based suite tests for webhooks and controllers ([#​4466](https://redirect.github.com/kubernetes-sigs/kubebuilder/pull/4466))
- **(go/v4):** e2e-tests: cleanup by removing calls to call make generate and manifests ([#​4471](https://redirect.github.com/kubernetes-sigs/kubebuilder/pull/4471))
#### What's Changed
* ✨ Adds a patch to configure ServiceMonitor to ensure TLS verification using cert-manager certificates by @​camilamacedo86 in https://github.com/kubernetes-sigs/kubebuilder/pull/4243
* ✨  Include admin ClusterRole and add it to the scaffold by @​damsien in https://github.com/kubernetes-sigs/kubebuilder/pull/4299
* ✨  (go/v4): Enable `seccompProfile.type: RuntimeDefault` by default in scaffolded projects by @​camilamacedo86 in https://github.com/kubernetes-sigs/kubebuilder/pull/4251
* ✨ Add helm plugin to distribute projects by @​camilamacedo86 in https://github.com/kubernetes-sigs/kubebuilder/pull/4227
* 📖 Proposal: New Plugin to allow project distribution via helm charts by @​dashanji in https://github.com/kubernetes-sigs/kubebuilder/pull/3632
* ✨ Follow-up to PR #​4243: Limit permissions to access the metrics-server-cert secret by @​camilamacedo86 in https://github.com/kubernetes-sigs/kubebuilder/pull/4312
* 📖 doc: update roadmap for 2024 by @​camilamacedo86 in https://github.com/kubernetes-sigs/kubebuilder/pull/4313
* ✨ (helm/v1-alpha): add missed info to chart values by @​camilamacedo86 in https://github.com/kubernetes-sigs/kubebuilder/pull/4315
* 📖 Update README.md - Fix typo by @​monteiro-renato in https://github.com/kubernetes-sigs/kubebuilder/pull/4318
* 📖 Bump sigs.k8s.io/kubebuilder/v4 from 4.3.0 to 4.3.1 in /docs/book/src/simple-external-plugin-tutorial/testdata/sampleexternalplugin/v1 by @​dependabot in https://github.com/kubernetes-sigs/kubebuilder/pull/4322
* 📖: Fix typo in CONTRIBUTING-ROLES.md by @​monteiro-renato in https://github.com/kubernetes-sigs/kubebuilder/pull/4324
* :book: Fix readme wrong url your-own-plugin by @​damsien in https://github.com/kubernetes-sigs/kubebuilder/pull/4325
* 📖 doc: add .github/SECURITY.md with further information by @​camilamacedo86 in https://github.com/kubernetes-sigs/kubebuilder/pull/4253
* 📖: update testdata reference by @​emmanuel-ferdman in https://github.com/kubernetes-sigs/kubebuilder/pull/4328
* 📖 : Fix typo in contributing roles by @​damsien in https://github.com/kubernetes-sigs/kubebuilder/pull/4329
* 🌱 : Fix `make remove-spaces` for GNU system by @​damsien in https://github.com/kubernetes-sigs/kubebuilder/pull/4330
* 🌱 : Revert Fix `make remove-spaces` for GNU system" by @​camilamacedo86 in https://github.com/kubernetes-sigs/kubebuilder/pull/4331
* ✨ Upgrade controller-gen from v0.16.4 to v0.16.5 by @​camilamacedo86 in https://github.com/kubernetes-sigs/kubebuilder/pull/4332
* 📖 Fix incorrect link address by @​LJTian in https://github.com/kubernetes-sigs/kubebuilder/pull/4333
* 📖 Docs: removed typeDegradedMemcached and comment by @​vtrenton in https://github.com/kubernetes-sigs/kubebuilder/pull/4335
* 📖 small fixes to extending_cli_features_and_plugins.md by @​monteiro-renato in https://github.com/kubernetes-sigs/kubebuilder/pull/4336
* 📖 Fix broken reference to project-file instead of project-file-config by @​monteiro-renato in https://github.com/kubernetes-sigs/kubebuilder/pull/4337
* 📖 small fixes to extending_cli_features_and_plugins.md by @​monteiro-renato in https://github.com/kubernetes-sigs/kubebuilder/pull/4343
* 📖 fix : typo in README.md by @​monteiro-renato in https://github.com/kubernetes-sigs/kubebuilder/pull/4349
* 📖 Fix: typo in external-plugins.md by @​monteiro-renato in https://github.com/kubernetes-sigs/kubebuilder/pull/4345
* 📖 small fixes to extending_cli_features_and_plugins.md by @​monteiro-renato in https://github.com/kubernetes-sigs/kubebuilder/pull/4338
* 📖 Fix: typo in external-plugins.md by @​monteiro-renato in https://github.com/kubernetes-sigs/kubebuilder/pull/4347
* 🐛 fix: (helm/v1-alpha): Remove extra space before the labels section by @​monteiro-renato in https://github.com/kubernetes-sigs/kubebuilder/pull/4350
* 🐛 fix: (helm/alpha-v1): Fix rendered value for app.kubernetes.io/name by @​monteiro-renato in https://github.com/kubernetes-sigs/kubebuilder/pull/4351
* 📖 Fix: missing url to plugin-utils in extending_cli_features_and_plug… by @​monteiro-renato in https://github.com/kubernetes-sigs/kubebuilder/pull/4340
* 📖 Fix: broken urls in testing-plugins.md by @​monteiro-renato in https://github.com/kubernetes-sigs/kubebuilder/pull/4348
* 📖 update metrics documentation to bring more clarity by @​camilamacedo86 in https://github.com/kubernetes-sigs/kubebuilder/pull/4358
* 🌱 fix: run make generate to fix ci by @​monteiro-renato in https://github.com/kubernetes-sigs/kubebuilder/pull/4353
* 📖 follow up of update metrics documentation to bring more clarity #​4358 by @​camilamacedo86 in https://github.com/kubernetes-sigs/kubebuilder/pull/4359
* 📖 add notice to make bring awareness to the need to move away and no longer use old images provide via the registry by @​camilamacedo86 in https://github.com/kubernetes-sigs/kubebuilder/pull/4363
* 📖 Readme: Make more clear notice about kube-rbac-proxy by @​camilamacedo86 in https://github.com/kubernetes-sigs/kubebuilder/pull/4364
* 📖 Update README.md - Fix layout from notice by @​camilamacedo86 in https://github.com/kubernetes-sigs/kubebuilder/pull/4365
* 📖 nit - remove spaces by @​camilamacedo86 in https://github.com/kubernetes-sigs/kubebuilder/pull/4366
* 🌱 Bump github.com/onsi/ginkgo/v2 from 2.21.0 to 2.22.0 by @​dependabot in https://github.com/kubernetes-sigs/kubebuilder/pull/4367
* 🌱 fix file.Template to machinery.Template in the comments by @​monteiro-renato in https://github.com/kubernetes-sigs/kubebuilder/pull/4339
* 🐛 fix: (helm/v1alpha1): add missing replicas field to the Deployment generated by @​monteiro-renato in https://github.com/kubernetes-sigs/kubebuilder/pull/4356
* 🐛 fix: (helm/v1alpha1) add missing name prefix and namespace to leader-election-role and leader-election-rolebinding by @​monteiro-renato in https://github.com/kubernetes-sigs/kubebuilder/pull/4357
* 🐛 fix: (helm/v1alpha1): env config should not be dependent on DeployImages by @​monteiro-renato in https://github.com/kubernetes-sigs/kubebuilder/pull/4371
* 📖 Update discontinue_usage_of_kube_rbac_proxy.md - Typos/grammar fixes and use the right link for the new location of the images by @​camilamacedo86 in https://github.com/kubernetes-sigs/kubebuilder/pull/4374
* :seedling: Make `make remove-spaces` compatible with GNU and MAC OS X system by @​damsien in https://github.com/kubernetes-sigs/kubebuilder/pull/4354
* 📖 Fix broken plugin URL in getting-started.md by @​pengqun in https://github.com/kubernetes-sigs/kubebuilder/pull/4372
* 🐛 (helm/v1alpha): fix the default value of the force flag by @​camilamacedo86 in https://github.com/kubernetes-sigs/kubebuilder/pull/4375
* 📖 Fix: broken url in extending_cli_features_and_plugins.md by @​monteiro-renato in https://github.com/kubernetes-sigs/kubebuilder/pull/4341
* 📖 Fix: broken url in go-v4-plugin.md by @​monteiro-renato in https://github.com/kubernetes-sigs/kubebuilder/pull/4352
* 📖 Fix: broken URL in external-plugins.md by @​monteiro-renato in https://github.com/kubernetes-sigs/kubebuilder/pull/4346
* ✨ (helm/v1alpha1): add GitHub action to make it easier to validate the chart generates by @​camilamacedo86 in https://github.com/kubernetes-sigs/kubebuilder/pull/4377
* 🐛 fix: ensure that GitHub actions are not overwritten by @​camilamacedo86 in https://github.com/kubernetes-sigs/kubebuilder/pull/4379
* 📖 Fix: broken url in extending_cli_features_and_plugins.md by @​monteiro-renato in https://github.com/kubernetes-sigs/kubebuilder/pull/4344
* 📖 remove duplicated entry [plugin-subc], [plugin-sub-command] is the one being used by @​monteiro-renato in https://github.com/kubernetes-sigs/kubebuilder/pull/4342
* 🐛 : (go/v4) fixes based on golangci-lint run -v by @​monteiro-renato in https://github.com/kubernetes-sigs/kubebuilder/pull/4384
* 📖 Update roadmap_2024.md - Latest Status - Nov 2024 by @​camilamacedo86 in https://github.com/kubernetes-sigs/kubebuilder/pull/4334
* 🐛 fix: (helm/v1alpha1): install the Prometheus-operator CRDs before installing a chart which configures a ServiceMonitor by @​monteiro-renato in https://github.com/kubernetes-sigs/kubebuilder/pull/4383
* ✨ feat: (helm/v1alpha1): Allow ServiceAccount annotations to be configurable by @​monteiro-renato in https://github.com/kubernetes-sigs/kubebuilder/pull/4380
* ✨ feat: (helm/v1alpha1): Allow extra pod labels to be configured by @​monteiro-renato in https://github.com/kubernetes-sigs/kubebuilder/pull/4373
* ✨ (helm/v1alpha1): Add a step to render the chart in the GitHub Action by @​monteiro-renato in https://github.com/kubernetes-sigs/kubebuilder/pull/4386
* ✨ (go/v4): Update actions to use go.mod for Go version management by @​camilamacedo86 in https://github.com/kubernetes-sigs/kubebuilder/pull/4385
* 🐛 fix: (helm/v1alpha1): Add missing prefixes in various k8s resources by @​monteiro-renato in https://github.com/kubernetes-sigs/kubebuilder/pull/4388
* :seedling: remove everettraven from reviewers by @​everettraven in https://github.com/kubernetes-sigs/kubebuilder/pull/4389
* :seedling: Bump github.com/onsi/gomega from 1.35.1 to 1.36.0 by @​dependabot in https://github.com/kubernetes-sigs/kubebuilder/pull/4392
* :seedling: fix: centralize plugin key declaration by @​mateusoliveira43 in https://github.com/kubernetes-sigs/kubebuilder/pull/4390
* :sparkles: (go/v4):  Add Hub and Spoke for conversion webhooks by @​camilamacedo86 in https://github.com/kubernetes-sigs/kubebuilder/pull/4254
* 🐛 fix: (helm/v1alpha1): Use the ServiceAccount name defined in the values.yaml by @​wjiec in https://github.com/kubernetes-sigs/kubebuilder/pull/4406
* ✨ feat: Automate ENVTEST version from go.mod by @​camilamacedo86 in https://github.com/kubernetes-sigs/kubebuilder/pull/4401
* ✨ (deployimage/v1alpha1): Improve error handling and pointer usage for value setting in controller by @​mateusoliveira43 in https://github.com/kubernetes-sigs/kubebuilder/pull/4399
* :seedling: Bump golang.org/x/tools from 0.27.0 to 0.28.0 by @​dependabot in https://github.com/kubernetes-sigs/kubebuilder/pull/4409
* :book: doc: validating and parsing CRD fields by @​mateusoliveira43 in https://github.com/kubernetes-sigs/kubebuilder/pull/4396
* 📖 Update getting-started.md by @​dsolerh in https://github.com/kubernetes-sigs/kubebuilder/pull/4413
* :sparkles: (go/v4): add support to inject conversion webhook for the marker +kubebuilder:scaffold:e2e-webhooks-checks  by @​mateusoliveira43 in https://github.com/kubernetes-sigs/kubebuilder/pull/4407
* 📖 [ISSUE-4414] Fix typo in getting-started.md by @​jameskim0987 in https://github.com/kubernetes-sigs/kubebuilder/pull/4415
* 🐛 (kustomize/v2, go/v4):  Fix ca injection for conversion webhooks by @​camilamacedo86 in https://github.com/kubernetes-sigs/kubebuilder/pull/4282
* 📖 [ISSUE-4417] Fix minor hyperlink formatting in `emptymain.go` by @​jameskim0987 in https://github.com/kubernetes-sigs/kubebuilder/pull/4418
* 🐛 fix: (helm/v1alpha1): remove redundant condition in if clause by @​monteiro-renato in https://github.com/kubernetes-sigs/kubebuilder/pull/4419
* :seedling: Bump github.com/onsi/gomega from 1.36.0 to 1.36.1 by @​dependabot in https://github.com/kubernetes-sigs/kubebuilder/pull/4421
* 🌱Build the kubebuilder binary before and use it to regenerate the helm chart by @​monteiro-renato in https://github.com/kubernetes-sigs/kubebuilder/pull/4420
* ✨ feat: add webhook CertWatcher and flags for custom certificate configuration by @​camilamacedo86 in https://github.com/kubernetes-sigs/kubebuilder/pull/4429
* ✨ (go/v4): feat/fix: enhance cert-manager integration for metrics endpoints (follow-up to PR #​4243) by @​camilamacedo86 in https://github.com/kubernetes-sigs/kubebuilder/pull/4400
* 🌱 : Ensure that golangci-lint CI version is passed for the templates by @​mateusoliveira43 in https://github.com/kubernetes-sigs/kubebuilder/pull/4432
* 📖 Fix: move v2vsv3.md to the legacy folder and update references by @​monteiro-renato in https://github.com/kubernetes-sigs/kubebuilder/pull/4431
* ✨ feat: enforce restricted Pod Security Context Compliance in testing by @​lunarwhite in https://github.com/kubernetes-sigs/kubebuilder/pull/4435
* 🌱 Bump github.com/onsi/ginkgo/v2 from 2.22.0 to 2.22.1 by @​dependabot in https://github.com/kubernetes-sigs/kubebuilder/pull/4436
* 🌱  add better description to MarshalYAML and UnmarshalYAML methods by @​fengshunli in https://github.com/kubernetes-sigs/kubebuilder/pull/4438
* ✨ (kustomize/v2) feat: add app.kubernetes.io/name label to allow more precise configurations  by @​wjiec in https://github.com/kubernetes-sigs/kubebuilder/pull/4437
* 🌱 Bump github.com/onsi/gomega from 1.36.1 to 1.36.2 by @​dependabot in https://github.com/kubernetes-sigs/kubebuilder/pull/4440
*  📖improve tutorial test docs by @​mateusoliveira43 in https://github.com/kubernetes-sigs/kubebuilder/pull/4443
* 🌱improve Ginkgo/Gomega test style by @​Sijoma in https://github.com/kubernetes-sigs/kubebuilder/pull/4426
* 🌱 (ci): Improve GitHub Action to linter samples under testdata by @​camilamacedo86 in https://github.com/kubernetes-sigs/kubebuilder/pull/4444
* ✨ (go/v4): Standardize the webhook and controller test suites by @​mateusoliveira43 in https://github.com/kubernetes-sigs/kubebuilder/pull/4447
* ✨ Upgrade golangci-lint from v1.61.0 to  v1.62.2 by @​camilamacedo86 in https://github.com/kubernetes-sigs/kubebuilder/pull/4448
* 📖 (doc): Add "Kubebuilder Project Roadmap 2025" by @​camilamacedo86 in https://github.com/kubernetes-sigs/kubebuilder/pull/4316
* ✨ Upgrade scaffolds to use go 1.23 by @​camilamacedo86 in https://github.com/kubernetes-sigs/kubebuilder/pull/4446
* 🌱 e2e - ensure that error from command is checked by @​camilamacedo86 in https://github.com/kubernetes-sigs/kubebuilder/pull/4452
* :seedling: Bump github.com/onsi/ginkgo/v2 from 2.22.1 to 2.22.2 by @​dependabot in https://github.com/kubernetes-sigs/kubebuilder/pull/4455
* :seedling: fix: use Go version from go.mod file in CI by @​mateusoliveira43 in https://github.com/kubernetes-sigs/kubebuilder/pull/4454
* 🌱 e2e tests improve assertions by simplify style of checks by @​camilamacedo86 in https://github.com/kubernetes-sigs/kubebuilder/pull/4456
* ✨ Upgrade controller-gen from v0.16.5 to v0.17.0 by @​camilamacedo86 in https://github.com/kubernetes-sigs/kubebuilder/pull/4457
* 🌱 Add lint-config target to validate config and fix issues faced by @​camilamacedo86 in https://github.com/kubernetes-sigs/kubebuilder/pull/4458
* 🌱 Enable lint check empty-block and fix issues by @​camilamacedo86 in https://github.com/kubernetes-sigs/kubebuilder/pull/4459
* 🌱 Enable var-naming lint and fix issues for Kubebuilder CLI by @​camilamacedo86 in https://github.com/kubernetes-sigs/kubebuilder/pull/4460
* 🌱 Enable if-return linter check and fix issues for Kubebuilder CLI by @​camilamacedo86 in https://github.com/kubernetes-sigs/kubebuilder/pull/4461
* ✨ (go/v4): Add new makefile target to check and validate the linter config by @​camilamacedo86 in https://github.com/kubernetes-sigs/kubebuilder/pull/4462
* 🌱 Enable the lint to check exported methods and fix issues by @​camilamacedo86 in https://github.com/kubernetes-sigs/kubebuilder/pull/4463
* 🐛 (go/v4) Ensure that schemas are added before starting EnvTest-based suite tests for webhooks and controllers by @​mateusoliveira43 in https://github.com/kubernetes-sigs/kubebuilder/pull/4466
* 🌱 Enable govet settings and fix the issue found by @​mateusoliveira43 in https://github.com/kubernetes-sigs/kubebuilder/pull/4465
* 🌱 simplify E2E Book Samples job by @​mateusoliveira43 in https://github.com/kubernetes-sigs/kubebuilder/pull/4469
* 🌱 fix: remaining Go upgrades by @​mateusoliveira43 in https://github.com/kubernetes-sigs/kubebuilder/pull/4470
* 🌱 fix: remove unused nolint comments by @​mateusoliveira43 in https://github.com/kubernetes-sigs/kubebuilder/pull/4468
* 🌱 Bump golang.org/x/tools from 0.28.0 to 0.29.0 by @​dependabot in https://github.com/kubernetes-sigs/kubebuilder/pull/4473
* 🐛  e2e-tests: cleanup by removing calls to call make generate and manifests by @​mateusoliveira43 in https://github.com/kubernetes-sigs/kubebuilder/pull/4471
* 🌱 Bump github.com/spf13/afero from 1.11.0 to 1.12.0 by @​dependabot in https://github.com/kubernetes-sigs/kubebuilder/pull/4480
* ✨ Upgrade controller-runtime v0.19.1 to v0.19.4 by @​camilamacedo86 in https://github.com/kubernetes-sigs/kubebuilder/pull/4482
* 🐛 (helm/v1alpha1) - fix webhooks generation by removing data from helm chart values by @​camilamacedo86 in https://github.com/kubernetes-sigs/kubebuilder/pull/4451
#### New Contributors
* @​emmanuel-ferdman made their first contribution in https://github.com/kubernetes-sigs/kubebuilder/pull/4328
* @​LJTian made their first contribution in https://github.com/kubernetes-sigs/kubebuilder/pull/4333
* @​pengqun made their first contribution in https://github.com/kubernetes-sigs/kubebuilder/pull/4372
* @​wjiec made their first contribution in https://github.com/kubernetes-sigs/kubebuilder/pull/4406
* @​dsolerh made their first contribution in https://github.com/kubernetes-sigs/kubebuilder/pull/4413
* @​jameskim0987 made their first contribution in https://github.com/kubernetes-sigs/kubebuilder/pull/4415

**Full Changelog**: https://github.com/kubernetes-sigs/kubebuilder/compare/v4.3.1...v4.4.0

v4.3.1

Compare Source

changes since v4.3.0

✨ New Features

Note: Only minor version updates were applied in this release.

  • (go/v4): Upgraded controller-runtime from v0.19.0 to v0.19.1. (#​4234)
  • (go/v4): Updated kustomize from v5.4.3 to v5.5.0 (#​4235)
  • (go/v4): Upgraded golangci-lint from v1.59 to v1.61 with minor adjustments for lint rules. (#​4236)

🐛 Bug Fixes

  • (kustomize/v2, go/v4): Corrected the generation of manifests under config/crd/patches to ensure the /convert service patch is only created for webhooks configured with --conversion. (#​4280)
  • (go/v4): Fixed path configuration for webhook markers generated for core types with non-"core" group values, ensuring accurate path handling in core-type webhooks. (#​4301)
  • (go/v4): Resolved misleading comments regarding metrics configuration for certs in cmd/main.go, providing clarity on secure metrics setup. (#​4245)
  • (go/v4): Enabled the --make=false option for webhook creation, ensuring consistency with other command options and improved flexibility. (#​4275)
  • (kustomize/v2, go/v4): Moved the cert-manager uncomment block to the top of kustomization.yaml to enhance visibility (#​4283)
  • (Impact only for library users): ⚠️ Restructured internal layout to move main.go boilerplate into the cmd/ 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

changes since v4.2.0

⚠️ Important Notice:

(Only projects using webhooks are impacted by)

Controller runtime has deprecated the webhook.Validator and webhook.Defaulter interfaces, and they will no longer be provided in future versions. Therefore, projects must adopt the new CustomValidator and CustomDefaulter interfaces to remain compatible with controller-runtime v0.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 to internal/webhook. For now, you can scaffold webhooks in the legacy path (under api) by using the command kubebuilder create webhook [OPTIONS] --legacy=true, which scaffolds using the CustomValidator and CustomDefaulter interfaces. However, please note that this flag is deprecated and will be removed in upcoming releases.

Steps to Migrate:
  1. Move Webhook Files to the Internal Directory:

    Depending on your project structure, move the webhook files:

    • Single Group Layout: Move from api/<version> to internal/webhook/<version>.

      Before:

      api/
      ├── <version>/
      │   ├── <kind>_webhook.go
      │   ├── <kind>_webhook_test.go
      │   └── webhook_suite_test.go
      

      After:

      internal/
      ├── webhook/
      │   └── <version>/
      │       ├── <kind>_webhook.go
      │       ├── <kind>_webhook_test.go
      │       └── webhook_suite_test.go
      
    • Multigroup Layout: Move from api/<group>/<version> to internal/webhook/<group>/<version>.

      Before:

      api/
      ├── <group>/
      │   └── <version>/
      │       ├── <kind>_webhook.go
      │       ├── <kind>_webhook_test.go
      │       └── webhook_suite_test.go
      

      After:

      internal/
      ├── webhook/
      │   └── <group>/
      │       └── <version>/
      │           ├── <kind>_webhook.go
      │           ├── <kind>_webhook_test.go
      │           └── webhook_suite_test.go
      
  2. 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:

      import "your_project/api/v1"
    • After:

      import "your_project/internal/webhook/v1"
  3. Replace Deprecated Interfaces with Custom Ones:

    Replace webhook.Validator and webhook.Defaulter with the new CustomValidator and CustomDefaulter interfaces:

    • Before:

      var _ webhook.Validator = &MyResource{}
      
      func (r *MyResource) ValidateCreate() error { ... }
      func (r *MyResource) ValidateUpdate() error { ... }
      func (r *MyResource) ValidateDelete() error { ... }
      
      var _ webhook.Defaulter = &MyResource{}
      
      func (r *MyResource) Default() { ... }
    • After:

      var _ webhook.CustomValidator = &MyResource{}
      
      func (v *MyResource) ValidateCreate(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
          myResource, ok := obj.(*MyResource)
          if !ok { return nil, fmt.Errorf("expected MyResource, got %T", obj) }
          return nil, validateMyResource(myResource)
      }
      
      func (v *MyResource) ValidateUpdate(ctx context.Context, oldObj, newObj runtime.Object) (admission.Warnings, error) {
          myResource, ok := newObj.(*MyResource)
          if !ok { return nil, fmt.Errorf("expected MyResource, got %T", newObj) }
          return nil, validateMyResource(myResource)
      }
      
      func (v *MyResource) ValidateDelete(ctx context.Context, obj runtime.Object) (admission.Warnings, error) {
          myResource, ok := obj.(*MyResource)
          if !ok { return nil, fmt.Errorf("expected MyResource, got %T", obj) }
          return nil, nil
      }
      
      var _ webhook.CustomDefaulter = &MyResource{}
      
      func (d *MyResource) Default(ctx context.Context, obj runtime.Object) error {
          myResource, ok := obj.(*MyResource)
          if !ok { return fmt.Errorf("expected MyResource, got %T", obj) }
          // Defaulting logic
          return nil
      }

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,

⚠️ Breaking Changes

  • (Only projects using webhooks are impacted by) (go/v4): Replaced the deprecated webhook.Validator and webhook.Defaulter interfaces with CustomValidator and CustomDefaulter. Projects using the old interfaces must migrate to ensure compatibility with future versions. (#​4060)
  • (Only projects using webhooks are impacted by) (go/v4): Webhooks are now decoupled from the API directory. Webhook files should be moved from api/<version> or api/<group>/<version> to internal/webhook/<version> or internal/webhook/<group>/<version>. This restructuring improves project organization. (#​4150)
  • (Impact only for library users): Removed the APIPackagePathLegacy method, which has been obsolete since release 4.0.0. This change cleans up unused code. (#​4182)
  • (Impact only for library users): cleanup/refactor: Alpha Generate command. Move code source implementation to internal since this alpha feature is not designed to be imported by other tools (#​4180)
  • (Impact only for library users): Removed the redundant HasFragment method, favoring HasFileContentWith to reduce duplication and simplify the codebase. (#​4191)

✨ New Features

  • (go/v4): Added DevContainer support, making development in environments like GitHub Workspaces easier by removing the need for local setup. (#​4078)
  • (go/v4): The e2e test scaffolding has been improved with a comprehensive set of tests under 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:
    • Added checks to detect existing Prometheus and Cert-Manager installations to prevent re-installation. (#​4117)
    • Enhanced e2e tests to ensure proper execution with Kind and clarified usage. (#​4106)
    • Ensured make manifests and make generate are run as part of the e2e tests. (#​4122)
    • Aligned make test-e2e with make test for consistent behavior. (#​4125)
    • Improved tests to validate metrics endpoints and ensure proper metric exposure, including guidance for using metrics in reconciliation validation. (#​4131)
    • Added support for scaffolded e2e webhook tests with the +kubebuilder:scaffold:e2e-webhooks-checks marker. (#​4121)
    • Simplified Gomega assertions for better readability and improved error handling and logging in e2e/test.go. (#​4141, #​4158, #​4166, #​4175)
  • (go/v4): Improved the webhook tests by adding examples. Also, enhanced the CronJob tutorial to clarify usage and validate changes. (#​4130)
  • (deploy-image/v1alpha): Improved the tests scaffolded for controllers to ensure better coverage. (#​4197)
  • (go/v4): Added support for scaffolding controllers and webhooks for External Types, making it easier to work with external resources in projects. (#​4171, #​4203, #​4217)
  • (go/v4): Add Support for Scaffolding Webhooks for Core Types (#​4210)
  • (go/v4): Upgraded the cert-manager version used in tests from v1.14.4 to v1.16.0 for better compatibility and features. (#​4209)
  • (deploy-image/v1-alpha1): Added comments to clarify how resource watching and reconciliation logic w

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.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot force-pushed the renovate/kubernetes-sigs-kubebuilder-4.x branch from 011b917 to 4c2c7de Compare July 5, 2024 11:32
@renovate renovate bot force-pushed the renovate/kubernetes-sigs-kubebuilder-4.x branch 2 times, most recently from 688af83 to 6267bf7 Compare July 23, 2024 09:57
@renovate renovate bot force-pushed the renovate/kubernetes-sigs-kubebuilder-4.x branch from 6267bf7 to 08919aa Compare August 17, 2024 10:31
@renovate renovate bot force-pushed the renovate/kubernetes-sigs-kubebuilder-4.x branch from 08919aa to 712fcd9 Compare October 22, 2024 06:49
@renovate renovate bot force-pushed the renovate/kubernetes-sigs-kubebuilder-4.x branch from 712fcd9 to 0921917 Compare November 9, 2024 16:21
@renovate renovate bot force-pushed the renovate/kubernetes-sigs-kubebuilder-4.x branch 4 times, most recently from e6d1f5e to 2d12e5b Compare January 5, 2025 18:19
@renovate renovate bot force-pushed the renovate/kubernetes-sigs-kubebuilder-4.x branch from 2d12e5b to 98b2d05 Compare January 12, 2025 16:27
@renovate renovate bot force-pushed the renovate/kubernetes-sigs-kubebuilder-4.x branch from 98b2d05 to 6c7fd83 Compare January 21, 2025 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants